diff options
author | Simon Danner <danner.simon@gmail.com> | 2021-01-01 17:32:49 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-01-01 22:50:56 +0100 |
commit | 138c3c7d582c3d900f4a57e0cf04d7c18a550106 (patch) | |
tree | e2ff410fbff50b44e47b37e6cbb23b01b508a964 | |
parent | 3eca77bd860cd742867010928da9b165322789d9 (diff) | |
download | serenity-138c3c7d582c3d900f4a57e0cf04d7c18a550106.zip |
ClipboardHistory: Fix crash when deleting without selection
* Fix by only activating the deletion action if we have a selection
-rw-r--r-- | MenuApplets/ClipboardHistory/main.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/MenuApplets/ClipboardHistory/main.cpp b/MenuApplets/ClipboardHistory/main.cpp index 39c7510759..00750cc823 100644 --- a/MenuApplets/ClipboardHistory/main.cpp +++ b/MenuApplets/ClipboardHistory/main.cpp @@ -85,6 +85,7 @@ int main(int argc, char* argv[]) auto entry_context_menu = GUI::Menu::construct(); entry_context_menu->add_action(delete_action); table_view.on_context_menu_request = [&](const GUI::ModelIndex&, const GUI::ContextMenuEvent& event) { + delete_action->set_enabled(!table_view.selection().is_empty()); entry_context_menu->popup(event.screen_position()); }; |