FileManager: Reduce scope of some variables related to context menu
This commit is contained in:
parent
4ef8bf53ba
commit
61dc489778
Notes:
sideshowbarker
2024-07-17 11:12:35 +09:00
Author: https://github.com/krkk Commit: https://github.com/SerenityOS/serenity/commit/61dc489778 Pull-request: https://github.com/SerenityOS/serenity/pull/13948
1 changed files with 2 additions and 2 deletions
|
@ -1159,8 +1159,6 @@ 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()) {
|
||||
|
@ -1171,6 +1169,8 @@ 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);
|
||||
|
|
Loading…
Add table
Reference in a new issue