diff options
author | Ernestas Kulik <ernestask@gnome.org> | 2018-01-05 13:57:08 +0200 |
---|---|---|
committer | Ernestas Kulik <ernestask@gnome.org> | 2018-01-05 15:08:06 +0200 |
commit | 74b0a69b6e917e6109e8cf41be4949238a8cd880 (patch) | |
tree | 194db465e55cc9992ef6e311d0a4146c3a2ce3bb /src | |
parent | c7a608b1dc324d1d05e8cd7038b840d6da4e4b7d (diff) | |
download | nautilus-74b0a69b6e917e6109e8cf41be4949238a8cd880.tar.gz |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/nautilus-directory-async.c | 4 | ||||
-rw-r--r-- | src/nautilus-file.c | 25 | ||||
-rw-r--r-- | src/nautilus-global-preferences.h | 3 |
3 files changed, 3 insertions, 29 deletions
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; } @@ -9302,19 +9299,6 @@ thumbnail_limit_changed_callback (gpointer user_data) } 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) { show_file_thumbs = g_settings_get_enum (nautilus_preferences, NAUTILUS_PREFERENCES_SHOW_FILE_THUMBNAILS); @@ -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" |