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.
This commit is contained in:
Ernestas Kulik 2018-01-05 13:57:08 +02:00
parent c7a608b1dc
commit 74b0a69b6e
4 changed files with 3 additions and 34 deletions

View file

@ -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>

View file

@ -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)

View file

@ -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,

View file

@ -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"