diff --git a/thunar/thunar-enum-types.c b/thunar/thunar-enum-types.c index 35654a96843cda4e5884a2028494567bcaad9d88..92dcf0977d5beb6f9fb7e945d8c097bc75b17993 100644 --- a/thunar/thunar-enum-types.c +++ b/thunar/thunar-enum-types.c @@ -191,6 +191,29 @@ thunar_zoom_level_get_type (void) +GType +thunar_thumbnail_mode_get_type (void) +{ + static GType type = G_TYPE_INVALID; + + if (G_UNLIKELY (type == G_TYPE_INVALID)) + { + static const GEnumValue values[] = + { + { THUNAR_THUMBNAIL_MODE_NEVER, "THUNAR_THUMBNAIL_MODE_NEVER", "never", }, + { THUNAR_THUMBNAIL_MODE_ONLY_LOCAL, "THUNAR_THUMBNAIL_MODE_ONLY_LOCAL", "only-local", }, + { THUNAR_THUMBNAIL_MODE_ALWAYS, "THUNAR_THUMBNAIL_MODE_ALWAYS", "always", }, + { 0, NULL, NULL, }, + }; + + type = g_enum_register_static (I_("ThunarThumbnailMode"), values); + } + + return type; +} + + + /** * thunar_zoom_level_to_icon_size: * @zoom_level : a #ThunarZoomLevel. diff --git a/thunar/thunar-enum-types.h b/thunar/thunar-enum-types.h index b9500522762073d263867ea92b94ab5764b8ff6b..c372436dcfd269a73aa1c70a06fd7b1fbadefd94 100644 --- a/thunar/thunar-enum-types.h +++ b/thunar/thunar-enum-types.h @@ -142,6 +142,24 @@ typedef enum GType thunar_icon_size_get_type (void) G_GNUC_CONST; +#define THUNAR_TYPE_THUMBNAIL_MODE (thunar_thumbnail_mode_get_type ()) + +/** + * ThunarThumbnailsShow: + * @THUNAR_THUMBNAIL_MODE_NEVER : never show thumbnails. + * @THUNAR_THUMBNAIL_MODE_ONLY_LOCAL : only show thumbnails on local filesystems. + * @THUNAR_THUMBNAIL_MODE_ALWAYS : always show thumbnails (everywhere). + **/ +typedef enum +{ + THUNAR_THUMBNAIL_MODE_NEVER, + THUNAR_THUMBNAIL_MODE_ONLY_LOCAL, + THUNAR_THUMBNAIL_MODE_ALWAYS +} ThunarThumbnailMode; + +GType thunar_thumbnail_mode_get_type (void) G_GNUC_CONST; + + #define THUNAR_TYPE_RECURSIVE_PERMISSIONS (thunar_recursive_permissions_get_type ()) /** diff --git a/thunar/thunar-file.c b/thunar/thunar-file.c index 07a983d5250025dd069a5aa28773111014281994..f267cb9caecdad13672b7f16761db16150122650 100644 --- a/thunar/thunar-file.c +++ b/thunar/thunar-file.c @@ -2604,6 +2604,7 @@ thunar_file_is_parent (const ThunarFile *file, } + /** * thunar_file_is_ancestor: * @file : a #ThunarFile instance. @@ -3426,6 +3427,32 @@ thunar_file_get_preview_icon (const ThunarFile *file) +GFilesystemPreviewType +thunar_file_get_preview_type (const ThunarFile *file) +{ + GFilesystemPreviewType preview; + GFileInfo *info; + + _thunar_return_val_if_fail (THUNAR_IS_FILE (file), G_FILESYSTEM_PREVIEW_TYPE_NEVER); + _thunar_return_val_if_fail (G_IS_FILE (file->gfile), G_FILESYSTEM_PREVIEW_TYPE_NEVER); + + info = g_file_query_filesystem_info (file->gfile, G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW, NULL, NULL); + if (G_LIKELY (info != NULL)) + { + preview = g_file_info_get_attribute_uint32 (info, G_FILE_ATTRIBUTE_FILESYSTEM_USE_PREVIEW); + g_object_unref (G_OBJECT (info)); + } + else + { + /* assume we don't know */ + preview = G_FILESYSTEM_PREVIEW_TYPE_NEVER; + } + + return preview; +} + + + static const gchar * thunar_file_get_icon_name_for_state (const gchar *icon_name, ThunarFileIconState icon_state) diff --git a/thunar/thunar-file.h b/thunar/thunar-file.h index d0a20842b92800b34abcf1bba55131c87a560cd2..74ed6f8d2c4aa144dcf49f69a57e140bcdb7afe4 100644 --- a/thunar/thunar-file.h +++ b/thunar/thunar-file.h @@ -228,7 +228,8 @@ ThunarFileThumbState thunar_file_get_thumb_state (const ThunarFile *fil void thunar_file_set_thumb_state (ThunarFile *file, ThunarFileThumbState state); GIcon *thunar_file_get_preview_icon (const ThunarFile *file); -const gchar *thunar_file_get_icon_name (ThunarFile *file, +GFilesystemPreviewType thunar_file_get_preview_type (const ThunarFile *file); +const gchar *thunar_file_get_icon_name (ThunarFile *file, ThunarFileIconState icon_state, GtkIconTheme *icon_theme); @@ -251,7 +252,7 @@ gchar *thunar_file_cached_display_name (const GFile *file GList *thunar_file_list_get_applications (GList *file_list); GList *thunar_file_list_to_thunar_g_file_list (GList *file_list); -gboolean thunar_file_is_desktop (const ThunarFile *file); +gboolean thunar_file_is_desktop (const ThunarFile *file); /** * thunar_file_is_root: diff --git a/thunar/thunar-gio-extensions.c b/thunar/thunar-gio-extensions.c index c7d37fca006732b10c0ea4508b7d015b692fbec6..d77f72a633ea723f4ec4125df53cf39ffd14f373 100644 --- a/thunar/thunar-gio-extensions.c +++ b/thunar/thunar-gio-extensions.c @@ -406,6 +406,7 @@ thunar_g_file_get_free_space (GFile *file, } + gchar * thunar_g_file_get_free_space_string (GFile *file) { diff --git a/thunar/thunar-icon-factory.c b/thunar/thunar-icon-factory.c index d0544d1bd3ddf6c08fbcb3c4f0dd2e2404bc6669..96d783df9127adb8cfd87af6a5f4705b380ebf3c 100644 --- a/thunar/thunar-icon-factory.c +++ b/thunar/thunar-icon-factory.c @@ -48,7 +48,7 @@ enum { PROP_0, PROP_ICON_THEME, - PROP_SHOW_THUMBNAILS, + PROP_THUMBNAIL_MODE, }; @@ -98,20 +98,20 @@ struct _ThunarIconFactory { GObject __parent__; - ThunarPreferences *preferences; + ThunarPreferences *preferences; - GHashTable *icon_cache; + GHashTable *icon_cache; - GtkIconTheme *icon_theme; + GtkIconTheme *icon_theme; - guint show_thumbnails : 1; + ThunarThumbnailMode thumbnail_mode; - guint sweep_timer_id; + guint sweep_timer_id; - gulong changed_hook_id; + gulong changed_hook_id; /* stamp that gets bumped when the theme changes */ - guint theme_stamp; + guint theme_stamp; }; struct _ThunarIconKey @@ -169,18 +169,19 @@ thunar_icon_factory_class_init (ThunarIconFactoryClass *klass) EXO_PARAM_READABLE)); /** - * ThunarIconFactory:show-thumbnails: + * ThunarIconFactory:thumbnail-mode: * * Whether this #ThunarIconFactory will try to generate and load thumbnails * when loading icons for #ThunarFile<!---->s. **/ g_object_class_install_property (gobject_class, - PROP_SHOW_THUMBNAILS, - g_param_spec_boolean ("show-thumbnails", - "show-thumbnails", - "show-thumbnails", - FALSE, - EXO_PARAM_READWRITE)); + PROP_THUMBNAIL_MODE, + g_param_spec_enum ("thumbnail-mode", + "thumbnail-mode", + "thumbnail-mode", + THUNAR_TYPE_THUMBNAIL_MODE, + THUNAR_THUMBNAIL_MODE_ONLY_LOCAL, + EXO_PARAM_READWRITE)); } @@ -188,6 +189,8 @@ thunar_icon_factory_class_init (ThunarIconFactoryClass *klass) static void thunar_icon_factory_init (ThunarIconFactory *factory) { + factory->thumbnail_mode = THUNAR_THUMBNAIL_MODE_ONLY_LOCAL; + /* connect emission hook for the "changed" signal on the GtkIconTheme class. We use the emission * hook way here, because that way we can make sure that the icon cache is definetly cleared * before any other part of the application gets notified about the icon theme change. @@ -259,8 +262,8 @@ thunar_icon_factory_get_property (GObject *object, g_value_set_object (value, factory->icon_theme); break; - case PROP_SHOW_THUMBNAILS: - g_value_set_boolean (value, factory->show_thumbnails); + case PROP_THUMBNAIL_MODE: + g_value_set_enum (value, factory->thumbnail_mode); break; default: @@ -281,8 +284,8 @@ thunar_icon_factory_set_property (GObject *object, switch (prop_id) { - case PROP_SHOW_THUMBNAILS: - factory->show_thumbnails = g_value_get_boolean (value); + case PROP_THUMBNAIL_MODE: + factory->thumbnail_mode = g_value_get_enum (value); break; default: @@ -667,8 +670,8 @@ thunar_icon_factory_get_for_icon_theme (GtkIconTheme *icon_theme) /* connect the "show-thumbnails" property to the global preference */ factory->preferences = thunar_preferences_get (); - exo_binding_new (G_OBJECT (factory->preferences), "misc-show-thumbnails", - G_OBJECT (factory), "show-thumbnails"); + exo_binding_new (G_OBJECT (factory->preferences), "misc-thumbnail-mode", + G_OBJECT (factory), "thumbnail-mode"); } else { @@ -680,6 +683,46 @@ thunar_icon_factory_get_for_icon_theme (GtkIconTheme *icon_theme) +/** + * thunar_icon_factory_get_thumbnail_mode: + * @factory : a #ThunarIconFactory instance. + * @file : a #ThunarFile. + * + * Return value: if a Thumbnail show be shown for @file. + **/ +gboolean +thunar_icon_factory_get_show_thumbnail (const ThunarIconFactory *factory, + const ThunarFile *file) +{ + GFilesystemPreviewType preview; + + _thunar_return_val_if_fail (THUNAR_IS_ICON_FACTORY (factory), THUNAR_THUMBNAIL_MODE_NEVER); + _thunar_return_val_if_fail (file == NULL || THUNAR_IS_FILE (file), THUNAR_THUMBNAIL_MODE_NEVER); + + if (file == NULL + || factory->thumbnail_mode == THUNAR_THUMBNAIL_MODE_NEVER) + return FALSE; + + /* always create thumbs for local files */ + if (thunar_file_is_local (file)) + return TRUE; + + preview = thunar_file_get_preview_type (file); + + /* file system says to never thumbnail anything */ + if (preview == G_FILESYSTEM_PREVIEW_TYPE_NEVER) + return FALSE; + + /* only if the setting is local and the fs reports to be local */ + if (factory->thumbnail_mode == THUNAR_THUMBNAIL_MODE_ONLY_LOCAL) + return preview == G_FILESYSTEM_PREVIEW_TYPE_IF_LOCAL; + + /* THUNAR_THUMBNAIL_MODE_ALWAYS */ + return TRUE; +} + + + /** * thunar_icon_factory_load_icon: * @factory : a #ThunarIconFactory instance. @@ -778,7 +821,8 @@ thunar_icon_factory_load_file_icon (ThunarIconFactory *factory, } /* check if thumbnails are enabled and we can display a thumbnail for the item */ - if (G_LIKELY (factory->show_thumbnails && thunar_file_is_regular (file))) + if (thunar_icon_factory_get_show_thumbnail (factory, file) + && thunar_file_is_regular (file)) { /* determine the preview icon first */ gicon = thunar_file_get_preview_icon (file); diff --git a/thunar/thunar-icon-factory.h b/thunar/thunar-icon-factory.h index 3ceefc686b2450b9fb609affe5f556ca5740b144..0a284948a8a027adba05d5000035f5835fd336bb 100644 --- a/thunar/thunar-icon-factory.h +++ b/thunar/thunar-icon-factory.h @@ -48,6 +48,9 @@ GType thunar_icon_factory_get_type (void) G_GNUC_CONS ThunarIconFactory *thunar_icon_factory_get_default (void); ThunarIconFactory *thunar_icon_factory_get_for_icon_theme (GtkIconTheme *icon_theme); +gboolean thunar_icon_factory_get_show_thumbnail (const ThunarIconFactory *factory, + const ThunarFile *file); + GdkPixbuf *thunar_icon_factory_load_icon (ThunarIconFactory *factory, const gchar *name, gint size, diff --git a/thunar/thunar-preferences-dialog.c b/thunar/thunar-preferences-dialog.c index a6efc4dd5aa84116240352b07f66a3ccbabaaff5..162b90294771c891d77705d3517d770f4a1505cf 100644 --- a/thunar/thunar-preferences-dialog.c +++ b/thunar/thunar-preferences-dialog.c @@ -147,6 +147,41 @@ transform_view_index_to_string (const GValue *src_value, +static gboolean +transform_thumbnail_mode_to_index (const GValue *src_value, + GValue *dst_value, + gpointer user_data) +{ + GEnumClass *klass; + guint n; + + klass = g_type_class_ref (THUNAR_TYPE_THUMBNAIL_MODE); + for (n = 0; n < klass->n_values; ++n) + if (klass->values[n].value == g_value_get_enum (src_value)) + g_value_set_int (dst_value, n); + g_type_class_unref (klass); + + return TRUE; +} + + + +static gboolean +transform_thumbnail_index_to_mode (const GValue *src_value, + GValue *dst_value, + gpointer user_data) +{ + GEnumClass *klass; + + klass = g_type_class_ref (THUNAR_TYPE_THUMBNAIL_MODE); + g_value_set_enum (dst_value, klass->values[g_value_get_int (src_value)].value); + g_type_class_unref (klass); + + return TRUE; +} + + + static void thunar_preferences_dialog_class_init (ThunarPreferencesDialogClass *klass) { @@ -227,6 +262,7 @@ thunar_preferences_dialog_init (ThunarPreferencesDialog *dialog) gtk_widget_show (table); label = gtk_label_new_with_mnemonic (_("View _new folders using:")); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, GTK_FILL, GTK_FILL, 0, 0); gtk_widget_show (label); @@ -242,16 +278,25 @@ thunar_preferences_dialog_init (ThunarPreferencesDialog *dialog) gtk_label_set_mnemonic_widget (GTK_LABEL (label), combo); gtk_widget_show (combo); + label = gtk_label_new_with_mnemonic (_("Show thumbnails:")); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, GTK_FILL, GTK_FILL, 0, 0); + gtk_widget_show (label); + + combo = gtk_combo_box_text_new (); + gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _("Never")); + gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _("Local Files Only")); + gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), _("Always")); + exo_mutual_binding_new_full (G_OBJECT (dialog->preferences), "misc-thumbnail-mode", G_OBJECT (combo), "active", + transform_thumbnail_mode_to_index, transform_thumbnail_index_to_mode, NULL, NULL); + gtk_table_attach (GTK_TABLE (table), combo, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0); + thunar_gtk_label_set_a11y_relation (GTK_LABEL (label), combo); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), combo); + gtk_widget_show (combo); + button = gtk_check_button_new_with_mnemonic (_("Sort _folders before files")); exo_mutual_binding_new (G_OBJECT (dialog->preferences), "misc-folders-first", G_OBJECT (button), "active"); gtk_widget_set_tooltip_text (button, _("Select this option to list folders before files when you sort a folder.")); - gtk_table_attach (GTK_TABLE (table), button, 0, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0); - gtk_widget_show (button); - - button = gtk_check_button_new_with_mnemonic (_("_Show thumbnails")); - exo_mutual_binding_new (G_OBJECT (dialog->preferences), "misc-show-thumbnails", G_OBJECT (button), "active"); - gtk_widget_set_tooltip_text (button, _("Select this option to display previewable files within a " - "folder as automatically generated thumbnail icons.")); gtk_table_attach (GTK_TABLE (table), button, 0, 2, 2, 3, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0); gtk_widget_show (button); diff --git a/thunar/thunar-preferences.c b/thunar/thunar-preferences.c index c789fb4089dd90e57869579e0d098b42a76622e4..e5d9fb95b6e02d0ef3c9cc7b13ca0fc2b3914e4c 100644 --- a/thunar/thunar-preferences.c +++ b/thunar/thunar-preferences.c @@ -82,12 +82,12 @@ enum PROP_MISC_RECURSIVE_PERMISSIONS, PROP_MISC_REMEMBER_GEOMETRY, PROP_MISC_SHOW_ABOUT_TEMPLATES, - PROP_MISC_SHOW_THUMBNAILS, PROP_MISC_SINGLE_CLICK, PROP_MISC_SINGLE_CLICK_TIMEOUT, PROP_MISC_SMALL_TOOLBAR_ICONS, PROP_MISC_TAB_CLOSE_MIDDLE_CLICK, PROP_MISC_TEXT_BESIDE_ICONS, + PROP_MISC_THUMBNAIL_MODE, PROP_SHORTCUTS_ICON_EMBLEMS, PROP_SHORTCUTS_ICON_SIZE, PROP_TREE_ICON_EMBLEMS, @@ -99,17 +99,17 @@ enum static void thunar_preferences_finalize (GObject *object); static void thunar_preferences_get_property (GObject *object, - guint prop_id, - GValue *value, - GParamSpec *pspec); + guint prop_id, + GValue *value, + GParamSpec *pspec); static void thunar_preferences_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec); + guint prop_id, + const GValue *value, + GParamSpec *pspec); static void thunar_preferences_prop_changed (XfconfChannel *channel, - const gchar *prop_name, - const GValue *value, - ThunarPreferences *preferences); + const gchar *prop_name, + const GValue *value, + ThunarPreferences *preferences); static void thunar_preferences_load_rc_file (ThunarPreferences *preferences); @@ -582,18 +582,6 @@ thunar_preferences_class_init (ThunarPreferencesClass *klass) TRUE, EXO_PARAM_READWRITE); - /** - * ThunarPreferences:misc-show-thumbnails: - * - * Whether to generate and display thumbnails for previewable files. - **/ - preferences_props[PROP_MISC_SHOW_THUMBNAILS] = - g_param_spec_boolean ("misc-show-thumbnails", - "MiscShowThumbnails", - NULL, - TRUE, - EXO_PARAM_READWRITE); - /** * ThunarPreferences:misc-single-click: * @@ -659,6 +647,19 @@ thunar_preferences_class_init (ThunarPreferencesClass *klass) FALSE, EXO_PARAM_READWRITE); + /** + * ThunarPreferences:misc-thumbnail-mode: + * + * Whether to generate and display thumbnails for previewable files. + **/ + preferences_props[PROP_MISC_THUMBNAIL_MODE] = + g_param_spec_enum ("misc-thumbnail-mode", + NULL, + NULL, + THUNAR_TYPE_THUMBNAIL_MODE, + THUNAR_THUMBNAIL_MODE_ONLY_LOCAL, + EXO_PARAM_READWRITE); + /** * ThunarPreferences:shortcuts-icon-emblems: * @@ -942,6 +943,14 @@ thunar_preferences_load_rc_file (ThunarPreferences *preferences) g_value_unset (&src); } + /* manually migrate the thumbnails property */ + if (!xfce_rc_read_bool_entry (rc, "MiscShowThumbnails", TRUE)) + { + xfconf_channel_set_string (preferences->channel, + "/misc-thumbnail-mode", + "THUNAR_THUMBNAIL_MODE_NEVER"); + } + g_free (pspecs); xfce_rc_close (rc); diff --git a/thunar/thunar-standard-view.c b/thunar/thunar-standard-view.c index 665ee6f04ade73a8608311cb7dc7d6068ffbd577..e80729685468911e9d2110f1220734189d2913c6 100644 --- a/thunar/thunar-standard-view.c +++ b/thunar/thunar-standard-view.c @@ -280,7 +280,7 @@ static void thunar_standard_view_schedule_thumbnail_timeout (Thu static void thunar_standard_view_schedule_thumbnail_idle (ThunarStandardView *standard_view); static gboolean thunar_standard_view_request_thumbnails (gpointer data); static gboolean thunar_standard_view_request_thumbnails_lazy (gpointer data); -static void thunar_standard_view_show_thumbnails_toggled (ThunarStandardView *standard_view, +static void thunar_standard_view_thumbnail_mode_toggled (ThunarStandardView *standard_view, GParamSpec *pspec, ThunarIconFactory *icon_factory); static void thunar_standard_view_scrolled (GtkAdjustment *adjustment, @@ -1023,10 +1023,10 @@ thunar_standard_view_realize (GtkWidget *widget) icon_theme = gtk_icon_theme_get_for_screen (gtk_widget_get_screen (widget)); standard_view->icon_factory = thunar_icon_factory_get_for_icon_theme (icon_theme); - /* we need to redraw whenever the "show-thumbnails" property is toggled */ + /* we need to redraw whenever the "thumbnail_mode" property is toggled */ g_signal_connect_swapped (standard_view->icon_factory, - "notify::show-thumbnails", - G_CALLBACK (thunar_standard_view_show_thumbnails_toggled), + "notify::thumbnail_mode", + G_CALLBACK (thunar_standard_view_thumbnail_mode_toggled), standard_view); } @@ -3576,7 +3576,6 @@ thunar_standard_view_row_changed (ThunarListModel *model, ThunarStandardView *standard_view) { ThunarFile *file; - gboolean show_thumbnails; _thunar_return_if_fail (THUNAR_IS_LIST_MODEL (model)); _thunar_return_if_fail (path != NULL); @@ -3586,8 +3585,9 @@ thunar_standard_view_row_changed (ThunarListModel *model, if (standard_view->priv->thumbnail_request != 0) return; - g_object_get (standard_view->icon_factory, "show-thumbnails", &show_thumbnails, NULL); - if (!show_thumbnails) + /* leave if this view is not suitable for generating thumbnails */ + if (!thunar_icon_factory_get_show_thumbnail (standard_view->icon_factory, + standard_view->priv->current_directory)) return; /* queue a thumbnail request */ @@ -3867,18 +3867,15 @@ thunar_standard_view_request_thumbnails_real (ThunarStandardView *standard_view, GtkTreePath *path; GtkTreeIter iter; ThunarFile *file; - gboolean show_thumbnails; gboolean valid_iter; GList *visible_files = NULL; _thunar_return_val_if_fail (THUNAR_IS_STANDARD_VIEW (standard_view), FALSE); _thunar_return_val_if_fail (THUNAR_IS_ICON_FACTORY (standard_view->icon_factory), FALSE); - /* determine whether the user wants us to create thumbnails */ - g_object_get (standard_view->icon_factory, "show-thumbnails", &show_thumbnails, NULL); - /* do nothing if we are not supposed to show thumbnails at all */ - if (!show_thumbnails) + if (!thunar_icon_factory_get_show_thumbnail (standard_view->icon_factory, + standard_view->priv->current_directory)) return FALSE; /* reschedule the source if we're still loading the folder */ @@ -3956,23 +3953,22 @@ thunar_standard_view_request_thumbnails_lazy (gpointer data) static void -thunar_standard_view_show_thumbnails_toggled (ThunarStandardView *standard_view, - GParamSpec *pspec, - ThunarIconFactory *icon_factory) +thunar_standard_view_thumbnail_mode_toggled (ThunarStandardView *standard_view, + GParamSpec *pspec, + ThunarIconFactory *icon_factory) { GtkAdjustment *vadjustment; - gboolean show_thumbnails; _thunar_return_if_fail (THUNAR_IS_STANDARD_VIEW (standard_view)); _thunar_return_if_fail (THUNAR_IS_ICON_FACTORY (icon_factory)); + _thunar_return_if_fail (standard_view->icon_factory == icon_factory); /* check whether the user wants us to generate thumbnails */ - g_object_get (icon_factory, "show-thumbnails", &show_thumbnails, NULL); - if (show_thumbnails) + if (thunar_icon_factory_get_show_thumbnail (icon_factory, + standard_view->priv->current_directory)) { /* get the vertical adjustment of the view */ - vadjustment = - gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (standard_view)); + vadjustment = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (standard_view)); /* fake a scroll event to generate thumbnail requests */ thunar_standard_view_scrolled (vadjustment, standard_view);