[nautilus/wip/antoniof/hidpi-and-icons-cleanup: 7/11] file: Drop "spacial file manager" leftovers




commit 22a66fbdae795f762f25c7c49e8351b4363572e7
Author: António Fernandes <antoniof gnome org>
Date:   Mon Aug 8 00:28:28 2022 +0100

    file: Drop "spacial file manager" leftovers
    
    These flags were relevant when each folder opened in its own window,
    such that the open folders would have a different icon. Also, we would
    ignore that icon in properties.
    
    Spacial nautilus has been gone for maybe 15 years now.

 src/nautilus-file.c              | 64 +---------------------------------------
 src/nautilus-file.h              |  4 +--
 src/nautilus-properties-window.c |  6 ++--
 3 files changed, 4 insertions(+), 70 deletions(-)
---
diff --git a/src/nautilus-file.c b/src/nautilus-file.c
index 3f0f489d8..6b4b2319a 100644
--- a/src/nautilus-file.c
+++ b/src/nautilus-file.c
@@ -5038,23 +5038,11 @@ nautilus_file_get_emblem_icons (NautilusFile *file)
     return icons;
 }
 
-static void
-prepend_icon_name (const char  *name,
-                   GThemedIcon *icon)
-{
-    g_themed_icon_prepend_name (icon, name);
-}
-
 GIcon *
 nautilus_file_get_gicon (NautilusFile          *file,
                          NautilusFileIconFlags  flags)
 {
-    const char * const *names;
-    const char *name;
-    GPtrArray *prepend_array;
     GIcon *icon;
-    int i;
-    gboolean is_folder = FALSE, is_inode_directory = FALSE;
 
     if (file == NULL)
     {
@@ -5079,57 +5067,7 @@ nautilus_file_get_gicon (NautilusFile          *file,
 
     if (file->details->icon)
     {
-        icon = NULL;
-
-        if (((flags & NAUTILUS_FILE_ICON_FLAGS_FOR_OPEN_FOLDER) ||
-             (flags & NAUTILUS_FILE_ICON_FLAGS_USE_MOUNT_ICON)) &&
-            G_IS_THEMED_ICON (file->details->icon))
-        {
-            names = g_themed_icon_get_names (G_THEMED_ICON (file->details->icon));
-            prepend_array = g_ptr_array_new ();
-
-            for (i = 0; names[i] != NULL; i++)
-            {
-                name = names[i];
-
-                if (strcmp (name, "folder") == 0)
-                {
-                    is_folder = TRUE;
-                }
-                if (strcmp (name, "inode-directory") == 0)
-                {
-                    is_inode_directory = TRUE;
-                }
-            }
-
-            /* Here, we add icons in reverse order of precedence,
-             * because they are later prepended */
-
-            /* "folder" should override "inode-directory", not the other way around */
-            if (is_inode_directory)
-            {
-                g_ptr_array_add (prepend_array, "folder");
-            }
-            if (is_folder && (flags & NAUTILUS_FILE_ICON_FLAGS_FOR_OPEN_FOLDER))
-            {
-                g_ptr_array_add (prepend_array, "folder-open");
-            }
-
-            if (prepend_array->len)
-            {
-                /* When constructing GThemed Icon, pointers from the array
-                 * are reused, but not the array itself, so the cast is safe */
-                icon = g_themed_icon_new_from_names ((char **) names, -1);
-                g_ptr_array_foreach (prepend_array, (GFunc) prepend_icon_name, icon);
-            }
-
-            g_ptr_array_free (prepend_array, TRUE);
-        }
-
-        if (icon == NULL)
-        {
-            icon = g_object_ref (file->details->icon);
-        }
+        icon = g_object_ref (file->details->icon);
     }
 
 out:
diff --git a/src/nautilus-file.h b/src/nautilus-file.h
index 68c7ff931..0ad5b75f5 100644
--- a/src/nautilus-file.h
+++ b/src/nautilus-file.h
@@ -80,10 +80,8 @@ typedef enum {
 typedef enum {
        NAUTILUS_FILE_ICON_FLAGS_NONE = 0,
        NAUTILUS_FILE_ICON_FLAGS_USE_THUMBNAILS = (1<<0),
-       NAUTILUS_FILE_ICON_FLAGS_IGNORE_VISITING = (1<<1),
-       NAUTILUS_FILE_ICON_FLAGS_FOR_OPEN_FOLDER = (1<<2),
        /* uses the icon of the mount if present */
-       NAUTILUS_FILE_ICON_FLAGS_USE_MOUNT_ICON = (1<<3),
+       NAUTILUS_FILE_ICON_FLAGS_USE_MOUNT_ICON = (1<<1),
 } NautilusFileIconFlags;       
 
 #define NAUTILUS_THUMBNAIL_MINIMUM_ICON_SIZE 32
diff --git a/src/nautilus-properties-window.c b/src/nautilus-properties-window.c
index 228ac5802..1d823edd7 100644
--- a/src/nautilus-properties-window.c
+++ b/src/nautilus-properties-window.c
@@ -576,15 +576,13 @@ get_image_for_properties_window (NautilusPropertiesWindow  *self,
         {
             icon = nautilus_file_get_icon (file, NAUTILUS_GRID_ICON_SIZE_MEDIUM, icon_scale,
                                            NAUTILUS_FILE_ICON_FLAGS_USE_THUMBNAILS |
-                                           NAUTILUS_FILE_ICON_FLAGS_USE_MOUNT_ICON |
-                                           NAUTILUS_FILE_ICON_FLAGS_IGNORE_VISITING);
+                                           NAUTILUS_FILE_ICON_FLAGS_USE_MOUNT_ICON);
         }
         else
         {
             new_icon = nautilus_file_get_icon (file, NAUTILUS_GRID_ICON_SIZE_MEDIUM, icon_scale,
                                                NAUTILUS_FILE_ICON_FLAGS_USE_THUMBNAILS |
-                                               NAUTILUS_FILE_ICON_FLAGS_USE_MOUNT_ICON |
-                                               NAUTILUS_FILE_ICON_FLAGS_IGNORE_VISITING);
+                                               NAUTILUS_FILE_ICON_FLAGS_USE_MOUNT_ICON);
             if (!new_icon || new_icon != icon)
             {
                 g_object_unref (icon);


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