summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2008-04-30 09:28:35 +0000
committerCosimo Cecchi <cosimoc@src.gnome.org>2008-04-30 09:28:35 +0000
commit568b6d298a0d34e881d9c13e19c592a76c8b8fc5 (patch)
tree7324d7a6e727a0cb278fec68cba7e5402d15dd6d /src
parentf5c16e3dff7b73683182fa3eb17dc4d5bfd7963e (diff)
downloadnautilus-568b6d298a0d34e881d9c13e19c592a76c8b8fc5.tar.gz
Do not unref the file info before checking the mime type, otherwise the
2008-04-30 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). svn path=/trunk/; revision=14117
Diffstat (limited to 'src')
-rw-r--r--src/nautilus-property-browser.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/nautilus-property-browser.c b/src/nautilus-property-browser.c
index 153dbda0c..056465970 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 */