summaryrefslogtreecommitdiff
path: root/gtk2_ardour/ardour_ui2.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2019-02-28 23:54:42 +0100
committerRobin Gareus <robin@gareus.org>2019-02-28 23:54:42 +0100
commit82440265339b69983eda71167a563407bb35acb8 (patch)
tree6ad08e7a0d01605d193824af72766dfe03a4dab9 /gtk2_ardour/ardour_ui2.cc
parent00934aec0db8c9fbf0361cdbc4472ae909f1212d (diff)
Consolidate ToggleAction cast, use new API
Furthermore we can assume that all Actions are registered and Unregistered actions will ::abort() execution.
Diffstat (limited to 'gtk2_ardour/ardour_ui2.cc')
-rw-r--r--gtk2_ardour/ardour_ui2.cc12
1 files changed, 3 insertions, 9 deletions
diff --git a/gtk2_ardour/ardour_ui2.cc b/gtk2_ardour/ardour_ui2.cc
index d0d51fbda6..91761a162c 100644
--- a/gtk2_ardour/ardour_ui2.cc
+++ b/gtk2_ardour/ardour_ui2.cc
@@ -594,9 +594,8 @@ ARDOUR_UI::error_alert_press (GdkEventButton* ev)
if (ev->button == 1) {
if (_log_not_acknowledged == LogLevelError) {
// just acknowledge the error, don't hide the log if it's already visible
- RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("toggle-log-window"));
- Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
- if (tact && tact->get_active()) {
+ RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (X_("Editor"), X_("toggle-log-window"));
+ if (tact->get_active()) {
do_toggle = false;
}
}
@@ -781,12 +780,7 @@ ARDOUR_UI::sync_button_clicked (GdkEventButton* ev)
void
ARDOUR_UI::toggle_follow_edits ()
{
- RefPtr<Action> act = ActionManager::get_action (X_("Transport"), X_("ToggleFollowEdits"));
- assert (act);
-
- RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic (act);
- assert (tact);
-
+ RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (X_("Transport"), X_("ToggleFollowEdits"));
UIConfiguration::instance().set_follow_edits (tact->get_active ());
}