derive TriggerUI from sigc::trackable so that it can be automically disconnected from signals

Note: this still seems suspicious: we explicitly disconnected from signals in the destructor. However,
it is better form to be able to use invalidator() in the connection call
This commit is contained in:
Paul Davis 2022-02-21 13:28:17 -07:00
parent 28db0c1d2b
commit 06eb154db2
2 changed files with 3 additions and 3 deletions

View File

@ -132,8 +132,8 @@ TriggerUI::trigger_swap (uint32_t n)
}
trigger_connections.drop_connections ();
trigger()->PropertyChanged.connect (trigger_connections, MISSING_INVALIDATOR, boost::bind (&TriggerUI::trigger_changed, this, _1), gui_context ());
tref.box->PropertyChanged.connect (trigger_connections, MISSING_INVALIDATOR, boost::bind (&TriggerUI::trigger_changed, this, _1), gui_context ());
trigger()->PropertyChanged.connect (trigger_connections, invalidator (*this), boost::bind (&TriggerUI::trigger_changed, this, _1), gui_context ());
tref.box->PropertyChanged.connect (trigger_connections, invalidator (*this), boost::bind (&TriggerUI::trigger_changed, this, _1), gui_context ());
trigger_changed (Properties::name);
}

View File

@ -37,7 +37,7 @@ namespace Gtk
class TriggerJumpDialog;
class TriggerUI
class TriggerUI : virtual public sigc::trackable
{
public:
TriggerUI ();