diff options
author | Cosimo Cecchi <cosimoc@gnome.org> | 2008-05-05 13:23:43 +0000 |
---|---|---|
committer | Cosimo Cecchi <cosimoc@src.gnome.org> | 2008-05-05 13:23:43 +0000 |
commit | 508a1e821059b0ca521170bb9d37b512438f51c3 (patch) | |
tree | 79a51da062b93377dbaa34e0d7e81674340368a4 | |
parent | 5f1b106468d9ae2101feb026e30e2d0f709706a6 (diff) | |
download | nautilus-508a1e821059b0ca521170bb9d37b512438f51c3.tar.gz |
Do not unref the file info before checking the mime type, otherwise the
2008-05-05 Cosimo Cecchi <cosimoc@gnome.org>
* src/nautilus-property-browser.c: (ensure_file_is_image):
Do not unref the file info before checking the mime type,
otherwise the mime_type string will be invalidated. (#530549).
(Backporting patch from trunk).
svn path=/branches/gnome-2-22/; revision=14136
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | src/nautilus-property-browser.c | 11 |
2 files changed, 14 insertions, 4 deletions
@@ -1,5 +1,12 @@ 2008-05-05 Cosimo Cecchi <cosimoc@gnome.org> + * src/nautilus-property-browser.c: (ensure_file_is_image): + Do not unref the file info before checking the mime type, + otherwise the mime_type string will be invalidated. (#530549). + (Backporting patch from trunk). + +2008-05-05 Cosimo Cecchi <cosimoc@gnome.org> + * src/nautilus-window.c: (nautilus_window_key_press_event): Revert the patch for bug #314431 as it seems to break cut and paste. diff --git a/src/nautilus-property-browser.c b/src/nautilus-property-browser.c index e15fe3ee2..43ebff11e 100644 --- a/src/nautilus-property-browser.c +++ b/src/nautilus-property-browser.c @@ -717,6 +717,7 @@ ensure_file_is_image (GFile *file) { GFileInfo *info; const char *mime_type; + gboolean ret; info = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE, 0, NULL, NULL); if (info == NULL) { @@ -728,11 +729,13 @@ ensure_file_is_image (GFile *file) return FALSE; } + ret = (g_content_type_is_a (mime_type, "image/*") && + !g_content_type_equals (mime_type, "image/svg") && + !g_content_type_equals (mime_type, "image/svg+xml")); + g_object_unref (info); - - return g_content_type_is_a (mime_type, "image/*") && - !g_content_type_equals (mime_type, "image/svg") && - !g_content_type_equals (mime_type, "image/svg+xml"); + + return ret; } /* create the appropriate pixbuf for the passed in file */ |