]> sigrok.org Git - pulseview.git/commitdiff
Fix #717 by only updating the name widget when necessary
authorSoeren Apel <redacted>
Tue, 29 Dec 2015 22:15:19 +0000 (23:15 +0100)
committerUwe Hermann <redacted>
Wed, 30 Dec 2015 22:15:52 +0000 (23:15 +0100)
pv/view/signal.cpp
pv/view/signal.hpp

index 09a6da8f17a3d7b9b2377cfa0dc1a251e454edde..67f8dde9c1316c27f17c8830cf234f2285d755d6 100644 (file)
@@ -66,8 +66,7 @@ Signal::Signal(pv::Session &session,
        channel_(channel),
        scale_handle_(make_shared<SignalScaleHandle>(*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.
index bcd4e2eb617eef83a46a5c1e98bf308751b48d8e..517bbf4a763da925e347f9add1cab83afc5b4bb3 100644 (file)
@@ -111,7 +111,6 @@ protected:
        const item_list items_;
 
        QComboBox *name_widget_;
-       bool updating_name_widget_;
 };
 
 } // namespace view