mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:07:34 +00: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:
parent
451fee8fd7
commit
1e31c1260a
1 changed files with 2 additions and 1 deletions
|
@ -163,7 +163,8 @@ KeyboardSettingsWidget::KeyboardSettingsWidget()
|
||||||
|
|
||||||
m_add_keymap_button->on_click = [&](auto) {
|
m_add_keymap_button->on_click = [&](auto) {
|
||||||
auto keymap = KeymapSelectionDialog::select_keymap(window(), keymaps_list_model.keymaps());
|
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");
|
m_remove_keymap_button = find_descendant_of_type_named<GUI::Button>("remove_keymap_button");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue