From 80174439a960c4c28fda2287595b2cba3bcd0828 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Fri, 13 May 2022 15:03:21 +0100 Subject: [PATCH] =?UTF-8?q?Revert=20"FileManager:=20Reduce=20scope=20of=20?= =?UTF-8?q?some=20variables=20related=20to=20context=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit menu" This reverts commit 61dc48977832c7f705b9ccd29b74c9dd69ef5627. This commit was causing FileManager to crash whenever you selected to open a file using the context menu. --- Userland/Applications/FileManager/main.cpp | 4 ++-- 1 file 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 run_in_windowed_mode(String const& initial_location, String const& TRY(tree_view_directory_context_menu->try_add_action(properties_action)); RefPtr file_context_menu; + NonnullRefPtrVector current_file_handlers; + RefPtr 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 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 current_file_handlers; - RefPtr 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);