From: Soeren Apel Date: Tue, 16 Aug 2016 19:34:30 +0000 (+0200) Subject: Fix signal connection for view::Signal and SignalBase enabled state X-Git-Tag: pulseview-0.4.0~269 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=a45b9b9ee6f15da272c2e743122097e6696fc7b5;p=pulseview.git Fix signal connection for view::Signal and SignalBase enabled state --- diff --git a/pv/view/signal.cpp b/pv/view/signal.cpp index a8de4d50..ffe4f67d 100644 --- a/pv/view/signal.cpp +++ b/pv/view/signal.cpp @@ -68,6 +68,9 @@ Signal::Signal(pv::Session &session, name_widget_(nullptr) { assert(base_); + + connect(base_.get(), SIGNAL(enabled_changed(bool)), + this, SLOT(on_enabled_changed(bool))); } void Signal::set_name(QString name) @@ -83,14 +86,6 @@ bool Signal::enabled() const return base_->enabled(); } -void Signal::enable(bool enable) -{ - base_->set_enabled(enable); - - if (owner_) - owner_->extents_changed(true, true); -} - shared_ptr Signal::base() const { return base_; @@ -162,7 +157,15 @@ void Signal::on_name_changed(const QString &text) void Signal::on_disable() { - enable(false); + base_->set_enabled(false); +} + +void Signal::on_enabled_changed(bool enabled) +{ + (void)enabled; + + if (owner_) + owner_->extents_changed(true, true); } } // namespace view diff --git a/pv/view/signal.hpp b/pv/view/signal.hpp index 72c97e1d..a449382f 100644 --- a/pv/view/signal.hpp +++ b/pv/view/signal.hpp @@ -64,8 +64,6 @@ public: */ bool enabled() const; - void enable(bool enable = true); - std::shared_ptr base() const; /** @@ -102,6 +100,8 @@ protected Q_SLOTS: void on_disable(); + void on_enabled_changed(bool enabled); + protected: pv::Session &session_;