mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
KeyboardSettings: Fix adding empty keymaps
In the Keymap Settings dialog, a check was missing when the Keymap selection dialog was cancelled. Not checking the return value causes an empty string to be added to the keymap list.
This commit is contained in:
Notes:
sideshowbarker
2024-07-19 17:08:02 +09:00
Author: https://github.com/tsymalla 🔰 Commit: https://github.com/SerenityOS/serenity/commit/1e31c1260a7 Pull-request: https://github.com/SerenityOS/serenity/pull/12831 Reviewed-by: https://github.com/bgianfo
@@ -163,7 +163,8 @@ KeyboardSettingsWidget::KeyboardSettingsWidget()
|
||||
|
||||
m_add_keymap_button->on_click = [&](auto) {
|
||||
auto keymap = KeymapSelectionDialog::select_keymap(window(), keymaps_list_model.keymaps());
|
||||
keymaps_list_model.add_keymap(keymap);
|
||||
if (!keymap.is_empty())
|
||||
keymaps_list_model.add_keymap(keymap);
|
||||
};
|
||||
|
||||
m_remove_keymap_button = find_descendant_of_type_named<GUI::Button>("remove_keymap_button");
|
||||
|
||||
Reference in New Issue
Block a user