[nautilus/wip/oholy/gnome-42: 28/41] Revert "file: Drop useless parameter from get_icon_pixbuf()"




commit 536ba0f3842be4d0cf9d44d340c06bc6aa6f149d
Author: Ondrej Holy <oholy redhat com>
Date:   Fri Feb 11 14:34:20 2022 +0100

    Revert "file: Drop useless parameter from get_icon_pixbuf()"
    
    This reverts commit d68203161188a73776f87fe61b87f4f76c487e71.

 src/nautilus-file.c                  | 15 +++++++++++++--
 src/nautilus-file.h                  |  1 +
 src/nautilus-list-model.c            |  2 +-
 src/nautilus-operations-ui-manager.c |  2 ++
 src/nautilus-shell-search-provider.c |  2 +-
 src/nautilus-view-icon-item-ui.c     |  3 ++-
 6 files changed, 20 insertions(+), 5 deletions(-)
---
diff --git a/src/nautilus-file.c b/src/nautilus-file.c
index 2f10da27f..ca5a5cc1b 100644
--- a/src/nautilus-file.c
+++ b/src/nautilus-file.c
@@ -5375,14 +5375,25 @@ out:
 GdkPixbuf *
 nautilus_file_get_icon_pixbuf (NautilusFile          *file,
                                int                    size,
+                               gboolean               force_size,
                                int                    scale,
                                NautilusFileIconFlags  flags)
 {
-    g_autoptr (NautilusIconInfo) info = NULL;
+    NautilusIconInfo *info;
+    GdkPixbuf *pixbuf;
 
     info = nautilus_file_get_icon (file, size, scale, flags);
+    if (force_size)
+    {
+        pixbuf = nautilus_icon_info_get_pixbuf_at_size (info, size);
+    }
+    else
+    {
+        pixbuf = nautilus_icon_info_get_pixbuf (info);
+    }
+    g_object_unref (info);
 
-    return nautilus_icon_info_get_pixbuf_at_size (info, size);
+    return pixbuf;
 }
 
 gboolean
diff --git a/src/nautilus-file.h b/src/nautilus-file.h
index a50d27df0..3d1c7f587 100644
--- a/src/nautilus-file.h
+++ b/src/nautilus-file.h
@@ -475,6 +475,7 @@ NautilusIconInfo *      nautilus_file_get_icon                          (Nautilu
                                                                         NautilusFileIconFlags           
flags);
 GdkPixbuf *             nautilus_file_get_icon_pixbuf                   (NautilusFile                   
*file,
                                                                         int                             size,
+                                                                        gboolean                        
force_size,
                                                                         int                             
scale,
                                                                         NautilusFileIconFlags           
flags);
 
diff --git a/src/nautilus-list-model.c b/src/nautilus-list-model.c
index 30aac1e21..7e2aeeeee 100644
--- a/src/nautilus-list-model.c
+++ b/src/nautilus-list-model.c
@@ -417,7 +417,7 @@ nautilus_list_model_get_value (GtkTreeModel *tree_model,
                     }
                 }
 
-                icon = nautilus_file_get_icon_pixbuf (file, icon_size, icon_scale, flags);
+                icon = nautilus_file_get_icon_pixbuf (file, icon_size, TRUE, icon_scale, flags);
 
                 if (priv->highlight_files != NULL &&
                     g_list_find_custom (priv->highlight_files,
diff --git a/src/nautilus-operations-ui-manager.c b/src/nautilus-operations-ui-manager.c
index 7d4225785..4641a49f1 100644
--- a/src/nautilus-operations-ui-manager.c
+++ b/src/nautilus-operations-ui-manager.c
@@ -228,11 +228,13 @@ set_images (FileConflictDialogData *data)
 
     destination_pixbuf = nautilus_file_get_icon_pixbuf (data->destination,
                                                         NAUTILUS_GRID_ICON_SIZE_SMALL,
+                                                        TRUE,
                                                         1,
                                                         NAUTILUS_FILE_ICON_FLAGS_USE_THUMBNAILS);
 
     source_pixbuf = nautilus_file_get_icon_pixbuf (data->source,
                                                    NAUTILUS_GRID_ICON_SIZE_SMALL,
+                                                   TRUE,
                                                    1,
                                                    NAUTILUS_FILE_ICON_FLAGS_USE_THUMBNAILS);
 
diff --git a/src/nautilus-shell-search-provider.c b/src/nautilus-shell-search-provider.c
index 82850dafc..657736d6a 100644
--- a/src/nautilus-shell-search-provider.c
+++ b/src/nautilus-shell-search-provider.c
@@ -658,7 +658,7 @@ result_list_attributes_ready_cb (GList    *file_list,
 
         if (gicon == NULL)
         {
-            gicon = G_ICON (nautilus_file_get_icon_pixbuf (file, 128,
+            gicon = G_ICON (nautilus_file_get_icon_pixbuf (file, 128, TRUE,
                                                            icon_scale,
                                                            NAUTILUS_FILE_ICON_FLAGS_USE_THUMBNAILS));
         }
diff --git a/src/nautilus-view-icon-item-ui.c b/src/nautilus-view-icon-item-ui.c
index 29a4a1bd2..dc2a2b90b 100644
--- a/src/nautilus-view-icon-item-ui.c
+++ b/src/nautilus-view-icon-item-ui.c
@@ -46,7 +46,8 @@ update_icon (NautilusViewIconItemUi *self)
             NAUTILUS_FILE_ICON_FLAGS_USE_EMBLEMS |
             NAUTILUS_FILE_ICON_FLAGS_USE_ONE_EMBLEM;
 
-    icon_pixbuf = nautilus_file_get_icon_pixbuf (file, icon_size, 1, flags);
+    icon_pixbuf = nautilus_file_get_icon_pixbuf (file, icon_size,
+                                                 TRUE, 1, flags);
     gtk_image_set_from_pixbuf (GTK_IMAGE (self->icon), icon_pixbuf);
 
     gtk_widget_set_size_request (self->fixed_height_box, icon_size, icon_size);


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