Mercurial > octave
changeset 33420:d055934fe2d4 bytecode-interpreter
maint: merge default to bytecode-interpreter
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 16 Apr 2024 15:07:13 -0400 |
parents | ea29311fbd44 (current diff) 3cf213d5b479 (diff) |
children | e4e172cb662c |
files | |
diffstat | 1 files changed, 12 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/libgui/src/shortcuts-tree-widget.cc Tue Apr 16 14:33:05 2024 -0400 +++ b/libgui/src/shortcuts-tree-widget.cc Tue Apr 16 15:07:13 2024 -0400 @@ -290,6 +290,9 @@ // Note that m_settings_key doesn't begin with the sc_group prefix. QString my_section = get_shortcut_section (m_settings_key); + if (my_section.contains ('_')) // get top level section + my_section = my_section.section ('_', 0, 0, QString::SectionSkipEmpty); + QString actual_text = m_edit_actual->text (); bool conflict = false; @@ -298,7 +301,7 @@ gui_settings settings; settings.beginGroup (sc_group); - const QStringList shortcut_settings_keys = settings.allKeys (); + const QStringList shortcut_settings_keys = all_shortcut_preferences::keys (); settings.endGroup (); for (const auto& settings_key : shortcut_settings_keys) @@ -307,11 +310,16 @@ continue; QString section = get_shortcut_section (settings_key); + if (section.contains ('_')) // get top level section + section = section.section ('_', 0, 0, QString::SectionSkipEmpty); - if (section == my_section || section.startsWith ("main_")) + if (section == my_section || section == "main") { - QString shortcut_text - = settings.value (sc_group + "/" + settings_key).toString (); + const sc_pref scpref = all_shortcut_preferences::value (settings_key); + QString shortcut_text = settings.sc_value (scpref); + + if (shortcut_text.isEmpty ()) + continue; if (shortcut_text == actual_text) {