From b41e83e0ad1d32b68386fbbfc8edc9d0ecf893a7 Mon Sep 17 00:00:00 2001 From: John Greb Date: Fri, 14 Nov 2014 21:11:27 +0000 Subject: [PATCH] Unexplained segfault when saving Presets. --- sdrbase/gui/scopewindow.cpp | 7 +++++++ sdrbase/settings/preset.cpp | 8 ++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/sdrbase/gui/scopewindow.cpp b/sdrbase/gui/scopewindow.cpp index 2f6200f19..13f90777e 100644 --- a/sdrbase/gui/scopewindow.cpp +++ b/sdrbase/gui/scopewindow.cpp @@ -53,16 +53,19 @@ void ScopeWindow::resetToDefaults() QByteArray ScopeWindow::serialize() const { SimpleSerializer s(1); +#if 0 s.writeS32(1, m_displayData); s.writeS32(2, m_displayOrientation); s.writeS32(3, m_timeBase); s.writeS32(4, m_timeOffset); s.writeS32(5, m_amplification); +#endif return s.final(); } bool ScopeWindow::deserialize(const QByteArray& data) { +#if 0 SimpleDeserializer d(data); if(!d.isValid()) { @@ -84,6 +87,10 @@ bool ScopeWindow::deserialize(const QByteArray& data) resetToDefaults(); return false; } +#else + resetToDefaults(); + return false; +#endif } void ScopeWindow::on_amp_valueChanged(int value) diff --git a/sdrbase/settings/preset.cpp b/sdrbase/settings/preset.cpp index 6680caa6a..8af9dc972 100644 --- a/sdrbase/settings/preset.cpp +++ b/sdrbase/settings/preset.cpp @@ -13,8 +13,8 @@ void Preset::resetToDefaults() m_centerFrequency = 0; m_spectrumConfig.clear(); m_scopeConfig.clear(); - m_dcOffsetCorrection = true; - m_iqImbalanceCorrection = true; + m_dcOffsetCorrection = false; + m_iqImbalanceCorrection = false; m_showScope = true; m_layout.clear(); m_spectrumConfig.clear(); @@ -64,8 +64,8 @@ bool Preset::deserialize(const QByteArray& data) d.readBool(4, &m_showScope, true); d.readBlob(5, &m_layout); d.readBlob(6, &m_spectrumConfig); - d.readBool(7, &m_dcOffsetCorrection, true); - d.readBool(8, &m_iqImbalanceCorrection, true); + d.readBool(7, &m_dcOffsetCorrection, false); + d.readBool(8, &m_iqImbalanceCorrection, false); d.readBlob(9, &m_scopeConfig); d.readString(10, &m_source); d.readBlob(11, &m_sourceGeneralConfig);