13
0

Fix crash looking up smart-mode

we need to call
  get_toggle_action (char const*, char const, bool d = false)
and not
  get_toggle_action (const string& name, bool)

For whatever reason `(string, char*)` matches the latter
function's signature.
This commit is contained in:
Robin Gareus 2024-11-08 19:10:13 +01:00
parent bbdb6b0e63
commit c8b2c0c543
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 3 additions and 7 deletions

View File

@ -284,13 +284,13 @@ EditorSections::selection_changed ()
/* OK */ /* OK */
break; break;
case Editing::MouseObject: case Editing::MouseObject:
if (ActionManager::get_toggle_action ("MouseMode", "set-mouse-mode-object-range")->get_active ()) { if (ActionManager::get_toggle_action (PublicEditor::instance().editor_name().c_str(), "set-mouse-mode-object-range")->get_active ()) {
/* smart mode; OK */ /* smart mode; OK */
break; break;
} }
/*fallthrough*/ /*fallthrough*/
default: default:
Glib::RefPtr<RadioAction> ract = ActionManager::get_radio_action (X_("MouseMode"), X_("set-mouse-mode-range")); Glib::RefPtr<RadioAction> ract = ActionManager::get_radio_action (PublicEditor::instance().editor_name().c_str(), X_("set-mouse-mode-range"));
ract->set_active (true); ract->set_active (true);
break; break;
} }

View File

@ -313,11 +313,7 @@ TimeInfoBox::selection_changed ()
case Editing::MouseRange: case Editing::MouseRange:
if (selection.time.empty()) { if (selection.time.empty()) {
/* XXX we really ought to be calling Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (PublicEditor::instance().editor_name().c_str(), "set-mouse-mode-object-range");
::get_mouse_mode_action() here but there is no actual
mouse emode enum for smart mode (object-range).
*/
Glib::RefPtr<ToggleAction> tact = ActionManager::get_toggle_action (PublicEditor::instance().editor_name(), "set-mouse-mode-object-range");
if (tact->get_active() && !selection.regions.empty()) { if (tact->get_active() && !selection.regions.empty()) {
/* show selected regions */ /* show selected regions */