Commit 568b6d29 authored by Cosimo Cecchi's avatar Cosimo Cecchi Committed by Cosimo Cecchi

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
parent f5c16e3d
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).
2008-04-30 A. Walton <awalton@gnome.org>
* configure.in:
......
......@@ -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 */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment