nautilus r14136 - in branches/gnome-2-22: . src



Author: cosimoc
Date: Mon May  5 13:23:43 2008
New Revision: 14136
URL: http://svn.gnome.org/viewvc/nautilus?rev=14136&view=rev

Log:
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).


Modified:
   branches/gnome-2-22/ChangeLog
   branches/gnome-2-22/src/nautilus-property-browser.c

Modified: branches/gnome-2-22/src/nautilus-property-browser.c
==============================================================================
--- branches/gnome-2-22/src/nautilus-property-browser.c	(original)
+++ branches/gnome-2-22/src/nautilus-property-browser.c	Mon May  5 13:23:43 2008
@@ -717,6 +717,7 @@
 {
 	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 @@
 		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 */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]