diff options
author | Sam Atkins <atkinssj@serenityos.org> | 2022-05-13 15:03:21 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-05-13 16:28:36 +0200 |
commit | 80174439a960c4c28fda2287595b2cba3bcd0828 (patch) | |
tree | 5436e03d0064414125b112f7bc47107c946b7898 | |
parent | cd5210a87abf2960dfcaea0ec557663e6ecc4717 (diff) | |
download | serenity-80174439a960c4c28fda2287595b2cba3bcd0828.zip |
Revert "FileManager: Reduce scope of some variables related to context…
menu"
This reverts commit 61dc48977832c7f705b9ccd29b74c9dd69ef5627.
This commit was causing FileManager to crash whenever you selected to
open a file using the context menu.
-rw-r--r-- | Userland/Applications/FileManager/main.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Applications/FileManager/main.cpp b/Userland/Applications/FileManager/main.cpp index a9c0b52378..ff1d45c46d 100644 --- a/Userland/Applications/FileManager/main.cpp +++ b/Userland/Applications/FileManager/main.cpp @@ -1153,6 +1153,8 @@ ErrorOr<int> run_in_windowed_mode(String const& initial_location, String const& TRY(tree_view_directory_context_menu->try_add_action(properties_action)); RefPtr<GUI::Menu> file_context_menu; + NonnullRefPtrVector<LauncherHandler> current_file_handlers; + RefPtr<GUI::Action> file_context_menu_action_default_action; directory_view->on_context_menu_request = [&](GUI::ModelIndex const& index, GUI::ContextMenuEvent const& event) { if (index.is_valid()) { @@ -1163,8 +1165,6 @@ ErrorOr<int> run_in_windowed_mode(String const& initial_location, String const& folder_specific_paste_action->set_enabled(should_get_enabled); directory_context_menu->popup(event.screen_position(), directory_open_action); } else { - NonnullRefPtrVector<LauncherHandler> current_file_handlers; - RefPtr<GUI::Action> file_context_menu_action_default_action; file_context_menu = GUI::Menu::construct("Directory View File"); bool added_launch_file_handlers = add_launch_handler_actions_to_menu(file_context_menu, directory_view, node.full_path(), file_context_menu_action_default_action, current_file_handlers); |