From: Soeren Apel Date: Tue, 29 Dec 2015 22:15:19 +0000 (+0100) Subject: Fix #717 by only updating the name widget when necessary X-Git-Tag: pulseview-0.3.0~14 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=fcb97d775ddc37e59efc195666d612da9dba04d1;p=pulseview.git Fix #717 by only updating the name widget when necessary --- diff --git a/pv/view/signal.cpp b/pv/view/signal.cpp index 09a6da8f..67f8dde9 100644 --- a/pv/view/signal.cpp +++ b/pv/view/signal.cpp @@ -66,8 +66,7 @@ Signal::Signal(pv::Session &session, channel_(channel), scale_handle_(make_shared(*this)), items_({scale_handle_}), - name_widget_(nullptr), - updating_name_widget_(false) + name_widget_(nullptr) { assert(channel_); } @@ -75,9 +74,9 @@ Signal::Signal(pv::Session &session, void Signal::set_name(QString name) { Trace::set_name(name); - updating_name_widget_ = true; - name_widget_->setEditText(name); - updating_name_widget_ = false; + + if (name != name_widget_->currentText()) + name_widget_->setEditText(name); // Store the channel name in sigrok::Channel so that it // will end up in the .sr file upon save. diff --git a/pv/view/signal.hpp b/pv/view/signal.hpp index bcd4e2eb..517bbf4a 100644 --- a/pv/view/signal.hpp +++ b/pv/view/signal.hpp @@ -111,7 +111,6 @@ protected: const item_list items_; QComboBox *name_widget_; - bool updating_name_widget_; }; } // namespace view