[nautilus/wip/antoniof/make-window-slot-final: 3/3] files-view: Make override method private




commit c00b71c6ccc96cca068ff8a75d2e190042df4e9f
Author: António Fernandes <antoniof gnome org>
Date:   Fri Jan 15 00:46:49 2021 +0000

    files-view: Make override method private
    
    Always call the parent polimorphic method instead.

 src/nautilus-files-view.c  |  2 +-
 src/nautilus-files-view.h  |  2 --
 src/nautilus-window-slot.c | 10 +++++-----
 3 files changed, 6 insertions(+), 8 deletions(-)
---
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index 1e5d0fd2d..35c0e3155 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -991,7 +991,7 @@ nautilus_files_view_is_searching (NautilusView *view)
     return NAUTILUS_IS_SEARCH_DIRECTORY (priv->model);
 }
 
-guint
+static guint
 nautilus_files_view_get_view_id (NautilusView *view)
 {
     return NAUTILUS_FILES_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->get_view_id (NAUTILUS_FILES_VIEW (view));
diff --git a/src/nautilus-files-view.h b/src/nautilus-files-view.h
index 152f25aa0..5ab47c324 100644
--- a/src/nautilus-files-view.h
+++ b/src/nautilus-files-view.h
@@ -293,8 +293,6 @@ void                nautilus_files_view_remove_subdirectory             (Nautilu
 gboolean            nautilus_files_view_is_editable              (NautilusFilesView      *view);
 NautilusWindow *    nautilus_files_view_get_window               (NautilusFilesView      *view);
 
-guint               nautilus_files_view_get_view_id                (NautilusView      *view);
-
 /* file operations */
 char *            nautilus_files_view_get_backing_uri            (NautilusFilesView      *view);
 void              nautilus_files_view_move_copy_items            (NautilusFilesView      *view,
diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c
index 4673134f6..1b0bffa70 100644
--- a/src/nautilus-window-slot.c
+++ b/src/nautilus-window-slot.c
@@ -262,7 +262,7 @@ nautilus_window_slot_get_view_for_location (NautilusWindowSlot *self,
         /* Save the current view, so we can go back after places view */
         if (NAUTILUS_IS_FILES_VIEW (self->content_view))
         {
-            self->view_mode_before_places = nautilus_files_view_get_view_id (self->content_view);
+            self->view_mode_before_places = nautilus_view_get_view_id (self->content_view);
         }
 
         return view;
@@ -277,7 +277,7 @@ nautilus_window_slot_get_view_for_location (NautilusWindowSlot *self,
         if (self->view_mode_before_search == NAUTILUS_VIEW_INVALID_ID &&
             NAUTILUS_IS_FILES_VIEW (self->content_view))
         {
-            self->view_mode_before_search = nautilus_files_view_get_view_id (self->content_view);
+            self->view_mode_before_search = nautilus_view_get_view_id (self->content_view);
         }
         view_id = g_settings_get_enum (nautilus_preferences, NAUTILUS_PREFERENCES_SEARCH_VIEW);
     }
@@ -298,7 +298,7 @@ nautilus_window_slot_get_view_for_location (NautilusWindowSlot *self,
         }
         else
         {
-            view_id = nautilus_files_view_get_view_id (self->content_view);
+            view_id = nautilus_view_get_view_id (self->content_view);
         }
     }
 
@@ -404,7 +404,7 @@ nautilus_window_slot_sync_actions (NautilusWindowSlot *self)
     g_simple_action_set_enabled (G_SIMPLE_ACTION (action), NAUTILUS_IS_FILES_VIEW (view));
     if (g_action_get_enabled (action))
     {
-        variant = g_variant_new_uint32 (nautilus_files_view_get_view_id (view));
+        variant = g_variant_new_uint32 (nautilus_view_get_view_id (view));
         g_action_change_state (action, variant);
     }
     action = g_action_map_lookup_action (G_ACTION_MAP (self->slot_action_group), "files-view-mode-toggle");
@@ -1005,7 +1005,7 @@ action_files_view_mode_toggle (GSimpleAction *action,
         return;
     }
 
-    current_view_id = nautilus_files_view_get_view_id (self->content_view);
+    current_view_id = nautilus_view_get_view_id (self->content_view);
     if (current_view_id == NAUTILUS_VIEW_LIST_ID)
     {
         change_files_view_mode (self, NAUTILUS_VIEW_GRID_ID);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]