From d8350bd35e9b35e27267856cdad9003ebc8fb45a Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Sat, 30 Apr 2016 23:24:19 +0000 Subject: [PATCH] Fix re-initialization issue in Configuration Do not use a static scope variable where a class instance variable is needed. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6660 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- Configuration.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Configuration.cpp b/Configuration.cpp index 4c053fa0d..270b57f5c 100644 --- a/Configuration.cpp +++ b/Configuration.cpp @@ -489,6 +489,7 @@ private: TransceiverFactory::ParameterPack rig_params_; TransceiverFactory::ParameterPack saved_rig_params_; + bool last_port_type_; bool rig_is_dummy_; bool rig_active_; bool have_rig_; @@ -753,6 +754,8 @@ Configuration::impl::impl (Configuration * self, QDir const& temp_directory, , current_tx_offset_ {0} , frequency_dialog_ {new FrequencyDialog {&modes_, this}} , station_dialog_ {new StationDialog {&next_stations_, &bands_, this}} + , last_port_type_ {TransceiverFactory::Capabilities::none} + , rig_is_dummy_ {false} , rig_active_ {false} , have_rig_ {false} , rig_changed_ {false} @@ -1417,7 +1420,6 @@ void Configuration::impl::set_rig_invariants () ui_->CAT_poll_interval_label->setEnabled (!asynchronous_CAT); ui_->CAT_poll_interval_spin_box->setEnabled (!asynchronous_CAT); - static auto last_port_type = TransceiverFactory::Capabilities::none; auto port_type = transceiver_factory_.CAT_port_type (rig); bool is_serial_CAT (TransceiverFactory::Capabilities::serial == port_type); @@ -1464,9 +1466,9 @@ void Configuration::impl::set_rig_invariants () ui_->test_CAT_push_button->setEnabled (true); ui_->test_PTT_push_button->setEnabled (false); ui_->TX_audio_source_group_box->setEnabled (transceiver_factory_.has_CAT_PTT_mic_data (rig) && TransceiverFactory::PTT_method_CAT == ptt_method); - if (port_type != last_port_type) + if (port_type != last_port_type_) { - last_port_type = port_type; + last_port_type_ = port_type; switch (port_type) { case TransceiverFactory::Capabilities::serial: