[nautilus: 2/5] global-preferences: remove thumbnail-size setting



commit 74b0a69b6e917e6109e8cf41be4949238a8cd880
Author: Ernestas Kulik <ernestask gnome org>
Date:   Fri Jan 5 13:57:08 2018 +0200

    global-preferences: remove thumbnail-size setting
    
    As the setting can only be changed manually (and the assumption is that
    no one does that), it makes sense to not expose it and always use the
    default.

 data/org.gnome.nautilus.gschema.xml |  5 -----
 src/nautilus-directory-async.c      |  4 +---
 src/nautilus-file.c                 | 25 ++-----------------------
 src/nautilus-global-preferences.h   |  3 ---
 4 files changed, 3 insertions(+), 34 deletions(-)
---
diff --git a/data/org.gnome.nautilus.gschema.xml b/data/org.gnome.nautilus.gschema.xml
index d4ca8f2a3..7ad4df3b6 100644
--- a/data/org.gnome.nautilus.gschema.xml
+++ b/data/org.gnome.nautilus.gschema.xml
@@ -236,11 +236,6 @@
       <default>'large'</default>
       <summary>Default icon view zoom level</summary>
     </key>
-    <key type="i" name="thumbnail-size">
-      <default>64</default>
-      <summary>Default Thumbnail Icon Size</summary>
-      <description>The default size of an icon for a thumbnail in the icon view when using 
NAUTILUS_ICON_SIZE_STANDARD size.</description>
-    </key>
     <key type="as" name="text-ellipsis-limit">
       <default>[ '3' ]</default>
       <summary>Text Ellipsis Limit</summary>
diff --git a/src/nautilus-directory-async.c b/src/nautilus-directory-async.c
index d642e6fad..e44d1a8e0 100644
--- a/src/nautilus-directory-async.c
+++ b/src/nautilus-directory-async.c
@@ -3911,8 +3911,6 @@ thumbnail_state_free (ThumbnailState *state)
     g_free (state);
 }
 
-extern int cached_thumbnail_size;
-
 /* scale very large images down to the max. size we need */
 static void
 thumbnail_loader_size_prepared (GdkPixbufLoader *loader,
@@ -3926,7 +3924,7 @@ thumbnail_loader_size_prepared (GdkPixbufLoader *loader,
     aspect_ratio = ((double) width) / height;
 
     /* cf. nautilus_file_get_icon() */
-    max_thumbnail_size = NAUTILUS_CANVAS_ICON_SIZE_LARGEST * cached_thumbnail_size / 
NAUTILUS_CANVAS_ICON_SIZE_SMALL;
+    max_thumbnail_size = NAUTILUS_CANVAS_ICON_SIZE_LARGEST * NAUTILUS_CANVAS_ICON_SIZE_STANDARD / 
NAUTILUS_CANVAS_ICON_SIZE_SMALL;
     if (MAX (width, height) > max_thumbnail_size)
     {
         if (width > height)
diff --git a/src/nautilus-file.c b/src/nautilus-file.c
index dfc1e8204..6402e87ae 100644
--- a/src/nautilus-file.c
+++ b/src/nautilus-file.c
@@ -124,7 +124,6 @@ static guint signals[LAST_SIGNAL];
 static GHashTable *symbolic_links;
 
 static guint64 cached_thumbnail_limit;
-int cached_thumbnail_size;
 static NautilusSpeedTradeoffValue show_file_thumbs;
 
 static NautilusSpeedTradeoffValue show_directory_item_count;
@@ -5366,9 +5365,7 @@ nautilus_file_get_thumbnail_icon (NautilusFile          *file,
     }
     else
     {
-        modified_size = size * scale * cached_thumbnail_size / NAUTILUS_CANVAS_ICON_SIZE_SMALL;
-        DEBUG ("Modifying icon size to %d, as our cached thumbnail size is %d",
-               modified_size, cached_thumbnail_size);
+        modified_size = size * scale * NAUTILUS_CANVAS_ICON_SIZE_STANDARD / NAUTILUS_CANVAS_ICON_SIZE_SMALL;
     }
 
     if (file->details->thumbnail)
@@ -5378,7 +5375,7 @@ nautilus_file_get_thumbnail_icon (NautilusFile          *file,
 
         s = MAX (w, h);
         /* Don't scale up small thumbnails in the standard view */
-        if (s <= cached_thumbnail_size)
+        if (s <= NAUTILUS_CANVAS_ICON_SIZE_STANDARD)
         {
             thumb_scale = (double) size / NAUTILUS_CANVAS_ICON_SIZE_SMALL;
         }
@@ -9301,19 +9298,6 @@ thumbnail_limit_changed_callback (gpointer user_data)
     emit_change_signals_for_all_files_in_all_directories ();
 }
 
-static void
-thumbnail_size_changed_callback (gpointer user_data)
-{
-    cached_thumbnail_size = g_settings_get_int (nautilus_icon_view_preferences,
-                                                NAUTILUS_PREFERENCES_ICON_VIEW_THUMBNAIL_SIZE);
-
-    /* Tell the world that icons might have changed. We could invent a narrower-scope
-     * signal to mean only "thumbnails might have changed" if this ends up being slow
-     * for some reason.
-     */
-    emit_change_signals_for_all_files_in_all_directories ();
-}
-
 static void
 show_thumbnails_changed_callback (gpointer user_data)
 {
@@ -9532,11 +9516,6 @@ nautilus_file_class_init (NautilusFileClass *class)
                               "changed::" NAUTILUS_PREFERENCES_FILE_THUMBNAIL_LIMIT,
                               G_CALLBACK (thumbnail_limit_changed_callback),
                               NULL);
-    thumbnail_size_changed_callback (NULL);
-    g_signal_connect_swapped (nautilus_preferences,
-                              "changed::" NAUTILUS_PREFERENCES_ICON_VIEW_THUMBNAIL_SIZE,
-                              G_CALLBACK (thumbnail_size_changed_callback),
-                              NULL);
     show_thumbnails_changed_callback (NULL);
     g_signal_connect_swapped (nautilus_preferences,
                               "changed::" NAUTILUS_PREFERENCES_SHOW_FILE_THUMBNAILS,
diff --git a/src/nautilus-global-preferences.h b/src/nautilus-global-preferences.h
index a9bede7f2..ac5d9becf 100644
--- a/src/nautilus-global-preferences.h
+++ b/src/nautilus-global-preferences.h
@@ -96,9 +96,6 @@ typedef enum
 /* Which text attributes appear beneath icon names */
 #define NAUTILUS_PREFERENCES_ICON_VIEW_CAPTIONS                                "captions"
 
-/* The default size for thumbnail icons */
-#define NAUTILUS_PREFERENCES_ICON_VIEW_THUMBNAIL_SIZE                  "thumbnail-size"
-
 /* ellipsization preferences */
 #define NAUTILUS_PREFERENCES_ICON_VIEW_TEXT_ELLIPSIS_LIMIT             "text-ellipsis-limit"
 


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