From 0f522761795fbbc3e01321b51ff99f3e71b59d31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ant=C3=B3nio=20Fernandes?= Date: Sun, 28 Apr 2024 00:12:03 +0100 Subject: [PATCH] window: Drop nautilus_window_reset_menus() This is used by NautilusFilesView, which is a layer violation. But it's also useless, because the only thing it does is sync the start/reload actions, and that's already done by the slot calling nautilus_window_sync_allow_stop() anyway in the same situations (i.e. when view starts or ends loading). Drop it, to prepare the view to be reusable in FileChooser dialogs. Part of: https://gitlab.gnome.org/GNOME/nautilus/-/work_items/3402 --- src/nautilus-files-view.c | 7 +------ src/nautilus-window.c | 6 ------ src/nautilus-window.h | 2 -- 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c index ac6999862..2085b613d 100644 --- a/src/nautilus-files-view.c +++ b/src/nautilus-files-view.c @@ -8471,12 +8471,9 @@ nautilus_files_view_reset_view_menu (NautilusFilesView *view) void nautilus_files_view_update_toolbar_menus (NautilusFilesView *view) { - NautilusWindow *window; - NautilusFilesViewPrivate *priv; - g_assert (NAUTILUS_IS_FILES_VIEW (view)); - priv = nautilus_files_view_get_instance_private (view); + NautilusFilesViewPrivate *priv = nautilus_files_view_get_instance_private (view); /* Don't update after destroy (#349551), * or if we are not active. @@ -8486,8 +8483,6 @@ nautilus_files_view_update_toolbar_menus (NautilusFilesView *view) { return; } - window = nautilus_files_view_get_window (view); - nautilus_window_reset_menus (window); nautilus_files_view_update_actions_state (view); nautilus_files_view_reset_view_menu (view); diff --git a/src/nautilus-window.c b/src/nautilus-window.c index b3444c283..8636841ee 100644 --- a/src/nautilus-window.c +++ b/src/nautilus-window.c @@ -860,12 +860,6 @@ update_cursor (NautilusWindow *window) } } -void -nautilus_window_reset_menus (NautilusWindow *window) -{ - nautilus_window_sync_allow_stop (window, nautilus_window_get_active_slot (window)); -} - void nautilus_window_sync_allow_stop (NautilusWindow *window, NautilusWindowSlot *slot) diff --git a/src/nautilus-window.h b/src/nautilus-window.h index 8f6e61f41..cd7e0e166 100644 --- a/src/nautilus-window.h +++ b/src/nautilus-window.h @@ -81,8 +81,6 @@ GList * nautilus_window_get_slots (NautilusWindow *wind void nautilus_window_slot_close (NautilusWindow *window, NautilusWindowSlot *slot); -void nautilus_window_reset_menus (NautilusWindow *window); - void nautilus_window_show_about_dialog (NautilusWindow *window); /* sync window GUI with current slot. Used when changing slots,