replace ::cast_dynamic() with relevant ActionManager::get_*_action() calls
authorPaul Davis <paul@linuxaudiosystems.com>
Wed, 12 Dec 2018 13:41:57 +0000 (08:41 -0500)
committerPaul Davis <paul@linuxaudiosystems.com>
Wed, 12 Dec 2018 15:08:01 +0000 (10:08 -0500)
libs/gtkmm2ext/gtk_ui.cc

index c321d94d4fe91493b33eb5a75ad8fd0291c21126..0e28f150c3f7371d689c8292b71f7240380df40b 100644 (file)
@@ -617,27 +617,14 @@ UI::process_error_message (Transmitter::Channel chn, const char *str)
 void
 UI::show_errors ()
 {
-       Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("toggle-log-window"));
-       if (!act) {
-               return;
-       }
-
-       Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
-        if (tact) {
-                tact->set_active ();
-        }
+       Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (X_("Editor"), X_("toggle-log-window"));
+       tact->set_active ();
 }
 
 void
 UI::toggle_errors ()
 {
-       Glib::RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("toggle-log-window"));
-       if (!act) {
-               return;
-       }
-
-       Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
-
+       Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (X_("Editor"), X_("toggle-log-window"));
        if (tact->get_active()) {
                errors->set_position (WIN_POS_MOUSE);
                errors->show ();