nautilus r14117 - in trunk: . src



Author: cosimoc
Date: Wed Apr 30 09:28:35 2008
New Revision: 14117
URL: http://svn.gnome.org/viewvc/nautilus?rev=14117&view=rev

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


Modified:
   trunk/ChangeLog
   trunk/src/nautilus-property-browser.c

Modified: trunk/src/nautilus-property-browser.c
==============================================================================
--- trunk/src/nautilus-property-browser.c	(original)
+++ trunk/src/nautilus-property-browser.c	Wed Apr 30 09:28:35 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]