diff options
author | rbuj <[email protected]> | 2020-10-17 13:10:48 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2020-10-31 21:38:47 +0100 |
commit | 69cf7ff68d735a2a119d15c7a7b581136d345489 (patch) | |
tree | 5dea4e770e400166b12ca80a4e46a51af1d6d4c1 /capplets/appearance | |
parent | f379fb10f386999de807bff6c8031f0fe20bbaa1 (diff) | |
download | mate-control-center-69cf7ff68d735a2a119d15c7a7b581136d345489.tar.bz2 mate-control-center-69cf7ff68d735a2a119d15c7a7b581136d345489.tar.xz |
appearance: Fix preview in Add Wallpaper dialog
Diffstat (limited to 'capplets/appearance')
-rw-r--r-- | capplets/appearance/appearance-desktop.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/capplets/appearance/appearance-desktop.c b/capplets/appearance/appearance-desktop.c index b8b16e7c..397527bf 100644 --- a/capplets/appearance/appearance-desktop.c +++ b/capplets/appearance/appearance-desktop.c @@ -816,7 +816,7 @@ wp_update_preview (GtkFileChooser *chooser, if (uri) { GdkPixbuf *pixbuf = NULL; - const gchar *mime_type = NULL; + gchar *mime_type = NULL; GFile *file; GFileInfo *file_info; @@ -829,15 +829,19 @@ wp_update_preview (GtkFileChooser *chooser, if (file_info != NULL) { - mime_type = g_file_info_get_content_type (file_info); + const gchar *content_type; + + if ((content_type = g_file_info_get_content_type (file_info)) != NULL) + mime_type = g_content_type_get_mime_type (content_type); g_object_unref (file_info); } if (mime_type) { pixbuf = mate_desktop_thumbnail_factory_generate_thumbnail (data->thumb_factory, - uri, - mime_type); + uri, + mime_type); + g_free (mime_type); } if (pixbuf != NULL) |