From 3c43fe54bb50a83ab9adff183adb755274d70913 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 15 Jul 2021 16:18:20 +0200 Subject: [PATCH] Fix C++11ism (template argument uses local type) --- gtk2_ardour/plugin_manager_ui.cc | 43 +++++++++----------------------- gtk2_ardour/plugin_manager_ui.h | 17 ++++++++++++- 2 files changed, 28 insertions(+), 32 deletions(-) diff --git a/gtk2_ardour/plugin_manager_ui.cc b/gtk2_ardour/plugin_manager_ui.cc index 14c23b54b1..26a34b4323 100644 --- a/gtk2_ardour/plugin_manager_ui.cc +++ b/gtk2_ardour/plugin_manager_ui.cc @@ -240,9 +240,19 @@ PluginManagerUI::~PluginManagerUI () } void -PluginManagerUI::on_show () +PluginManagerUI::PluginCount::set (PluginScanLogEntry const& psle) { - ArdourWindow::on_show (); + ++total; + if (!psle.recent ()) { + ++stale; + return; + } + PluginScanLogEntry::PluginScanResult sr = psle.result (); + if ((int)sr & (PluginScanLogEntry::TimeOut | PluginScanLogEntry::Updated | PluginScanLogEntry::New)) { + ++ndscn; + } else if (sr != PluginScanLogEntry::OK) { + ++error; + } } static std::string @@ -329,35 +339,6 @@ PluginManagerUI::refill () bool rescan_err = false; bool have_stale = false; - - struct PluginCount { - PluginCount () - : total (0) - , error (0) - , stale (0) - , ndscn (0) - {} - - void set (PluginScanLogEntry const& psle) { - ++total; - if (!psle.recent ()) { - ++stale; - return; - } - PluginScanLogEntry::PluginScanResult sr = psle.result (); - if ((int)sr & (PluginScanLogEntry::TimeOut | PluginScanLogEntry::Updated | PluginScanLogEntry::New)) { - ++ndscn; - } else if (sr != PluginScanLogEntry::OK) { - ++error; - } - } - - unsigned int total; - unsigned int error; - unsigned int stale; - unsigned int ndscn; - }; - std::map plugin_count; std::vector > psl; diff --git a/gtk2_ardour/plugin_manager_ui.h b/gtk2_ardour/plugin_manager_ui.h index 057604daa1..3009ea6e1a 100644 --- a/gtk2_ardour/plugin_manager_ui.h +++ b/gtk2_ardour/plugin_manager_ui.h @@ -44,7 +44,6 @@ public: private: void refill (); - void on_show (); void selection_changed (); void blacklist_changed (std::string const&); void favorite_changed (std::string const&); @@ -61,6 +60,22 @@ private: void plugin_status_changed (ARDOUR::PluginType, std::string, ARDOUR::PluginManager::PluginStatusType); + struct PluginCount { + PluginCount () + : total (0) + , error (0) + , stale (0) + , ndscn (0) + {} + + void set (ARDOUR::PluginScanLogEntry const& psle); + + unsigned int total; + unsigned int error; + unsigned int stale; + unsigned int ndscn; + }; + struct PluginColumns : public Gtk::TreeModel::ColumnRecord { PluginColumns () { add (status);