gthumb r2482 - in trunk: . libgthumb



Author: mjc
Date: Sat Dec 27 11:15:46 2008
New Revision: 2482
URL: http://svn.gnome.org/viewvc/gthumb?rev=2482&view=rev

Log:
2008-12-27  Michael J. Chudobiak  <mjc svn gnome org>

        * libgthumb/file-utils.c: (get_file_mime_type):
        GFileInfo doesn't work for non-existent files, so we have to use
        g_content_type_guess to determine the mime type based on a proposed
        filename.



Modified:
   trunk/ChangeLog
   trunk/libgthumb/file-utils.c

Modified: trunk/libgthumb/file-utils.c
==============================================================================
--- trunk/libgthumb/file-utils.c	(original)
+++ trunk/libgthumb/file-utils.c	Sat Dec 27 11:15:46 2008
@@ -810,6 +810,16 @@
 
 	g_object_unref (file);
 
+	if (result == NULL) {
+		char *value;
+                value = g_content_type_guess (path, NULL, 0, NULL);
+                result = get_static_string (value);
+		g_free (value);
+	}
+
+	if (result == NULL)
+		g_warning ("Could not get content type for %s.\n",path);
+
 	return result;
 }
 



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