Remove a hack of using flags to emit a signal-change from the GUI
authorRobin Gareus <robin@gareus.org>
Sun, 31 Mar 2019 20:25:29 +0000 (22:25 +0200)
committerRobin Gareus <robin@gareus.org>
Sun, 31 Mar 2019 20:25:29 +0000 (22:25 +0200)
The GUI should not be calling `manager.PluginListChanged();`
It's up to the plugin-manager to emit relevant signals.

This fixes an issue when adding/removing plugin-favorites using the
mixer's sidebar or via remote-control/surfaces or script.

gtk2_ardour/plugin_selector.cc
gtk2_ardour/plugin_selector.h

index 7b599bc25d62ef16f0cc5f26b0a99d2f6ccea52a..338d3aa9eeb8fdf6f05b2de7d1e379adca3df88f 100644 (file)
@@ -69,10 +69,9 @@ PluginSelector::PluginSelector (PluginManager& mgr)
        _plugin_menu = 0;
        in_row_change = false;
 
-       //anytime the list changes ( Status, Tags, or scanned plugins ) we need to rebuild redirect-box plugin selector menu
        manager.PluginListChanged.connect (plugin_list_changed_connection, invalidator (*this), boost::bind (&PluginSelector::build_plugin_menu, this), gui_context());
+       manager.PluginStatusChanged.connect (plugin_list_changed_connection, invalidator (*this), boost::bind (&PluginSelector::build_plugin_menu, this), gui_context());
 
-       //these are used to update the info of specific entries, while they are being edited
        manager.PluginStatusChanged.connect (plugin_list_changed_connection, invalidator (*this), boost::bind (&PluginSelector::plugin_status_changed, this, _1, _2, _3), gui_context());
        manager.PluginTagChanged.connect(plugin_list_changed_connection, invalidator (*this), boost::bind (&PluginSelector::tags_changed, this, _1, _2, _3), gui_context());
 
@@ -788,10 +787,6 @@ PluginSelector::run ()
                manager.save_statuses();
        }
 
-       if ( _need_tag_save || _need_status_save || _need_menu_rebuild ) {
-               manager.PluginListChanged();  //emit signal
-       }
-
        return (int) r;
 }
 
@@ -810,7 +805,6 @@ PluginSelector::tag_reset_button_clicked ()
                manager.reset_tags (pi);
                display_selection_changed ();
                _need_tag_save = true;
-               _need_menu_rebuild = true;
        }
 }
 
@@ -833,7 +827,6 @@ PluginSelector::tag_entry_changed ()
                manager.set_tags (pi->type, pi->unique_id, tag_entry->get_text(), pi->name, PluginManager::FromGui);
 
                _need_tag_save = true;
-               _need_menu_rebuild = true;
        }
 }
 
@@ -888,7 +881,6 @@ PluginSelector::on_show ()
 
        _need_tag_save = false;
        _need_status_save = false;
-       _need_menu_rebuild = false;
 }
 
 struct PluginMenuCompareByCreator {
@@ -1172,7 +1164,6 @@ PluginSelector::favorite_changed (const std::string& path)
                manager.set_status (pi->type, pi->unique_id, status);
 
                _need_status_save = true;
-               _need_menu_rebuild = true;
        }
        in_row_change = false;
 }
@@ -1205,7 +1196,6 @@ PluginSelector::hidden_changed (const std::string& path)
                manager.set_status (pi->type, pi->unique_id, status);
 
                _need_status_save = true;
-               _need_menu_rebuild = true;
        }
        in_row_change = false;
 }
index fda03c10f339acefa5e55d43a8f4658d85a926b3..ba09b08f7ffdaebdb7286ff93b9539be9e2b5b0a 100644 (file)
@@ -186,7 +186,6 @@ private:
 
        bool _need_tag_save;
        bool _need_status_save;
-       bool _need_menu_rebuild;
 
        bool _inhibit_refill;
 };