gthumb r2334 - in trunk: . src



Author: mjc
Date: Sun May 18 17:51:29 2008
New Revision: 2334
URL: http://svn.gnome.org/viewvc/gthumb?rev=2334&view=rev

Log:
2008-05-18  Michael J. Chudobiak  <mjc svn gnome org>

        * src/dlg-image-prop.c: (update_general_info):
        * src/gth-exif-data-viewer.c: (update_file_info):
        gnome_vfs_mime_get_description -> g_content_type_get_description.
        Show both the mime type and the more human-readable descriptive text.
        Modified version of Gabriel FalcÃo's (gabriel nacaolivre org) patch
        from bug #525482.



Modified:
   trunk/ChangeLog
   trunk/src/dlg-image-prop.c
   trunk/src/gth-exif-data-viewer.c

Modified: trunk/src/dlg-image-prop.c
==============================================================================
--- trunk/src/dlg-image-prop.c	(original)
+++ trunk/src/dlg-image-prop.c	Sun May 18 17:51:29 2008
@@ -29,8 +29,6 @@
 #include <glib/gi18n.h>
 #include <gtk/gtk.h>
 #include <gio/gio.h>
-#include <libgnomevfs/gnome-vfs-mime.h>
-#include <libgnomevfs/gnome-vfs-utils.h>
 #include <glade/glade.h>
 
 #include "comments.h"
@@ -377,6 +375,9 @@
 	GthWindow    *window;
 	ImageViewer  *viewer;
 	const char   *image_filename;
+	const char   *mime_type;
+	char         *mime_description;
+	char         *mime_full;
 	GdkPixbuf    *pixbuf;
 	int           width, height;
 	char         *file_size_txt;
@@ -405,9 +406,13 @@
 		g_free (utf8_name);
 		
 		/**/
-		
-		gtk_label_set_text (GTK_LABEL (data->i_type_label),
-				    gnome_vfs_mime_get_description (get_mime_type (image_filename)));
+	
+		mime_type = get_mime_type (image_filename);	
+		mime_description = g_content_type_get_description (mime_type);
+		mime_full = g_strdup_printf ("%s (%s)", mime_description, mime_type);
+		gtk_label_set_text (GTK_LABEL (data->i_type_label), mime_full);
+		g_free (mime_description);
+		g_free (mime_full);
 		
 		/**/
 

Modified: trunk/src/gth-exif-data-viewer.c
==============================================================================
--- trunk/src/gth-exif-data-viewer.c	(original)
+++ trunk/src/gth-exif-data-viewer.c	Sun May 18 17:51:29 2008
@@ -27,9 +27,6 @@
 #include <glib/gi18n.h>
 #include <gtk/gtk.h>
 #include <gio/gio.h>
-#include <libgnomevfs/gnome-vfs-mime.h>
-#include <libgnomevfs/gnome-vfs-file-info.h>
-#include <libgnomevfs/gnome-vfs-utils.h>
 
 #include "file-utils.h"
 #include "glib-utils.h"
@@ -310,7 +307,9 @@
 	struct tm         *tm;
 	char               time_txt[50], *utf8_time_txt;
 	char              *file_size_txt;
-	const char	  *mime_type;
+	const char        *mime_type;
+	char              *mime_description;
+	char              *mime_full;
 
 	if (edv->priv->viewer == NULL)
 		return;
@@ -336,6 +335,8 @@
 	file_size_txt = g_format_size_for_display (edv->priv->file->size);
 
 	mime_type = edv->priv->file->mime_type;
+	mime_description = g_content_type_get_description (mime_type);
+	mime_full = g_strdup_printf ("%s (%s)", mime_description, mime_type); 
 	
 	/**/
 
@@ -347,7 +348,7 @@
 
 	add_to_exif_display_list (edv, GTH_METADATA_CATEGORY_FILE, NULL, _("Size"), file_size_txt, NULL, -4, FALSE);
 	add_to_exif_display_list (edv, GTH_METADATA_CATEGORY_FILE, NULL, _("Modified"), utf8_time_txt, NULL, -3, FALSE);
-	add_to_exif_display_list (edv, GTH_METADATA_CATEGORY_FILE, NULL, _("Type"), mime_type, NULL, -2, FALSE);
+	add_to_exif_display_list (edv, GTH_METADATA_CATEGORY_FILE, NULL, _("Type"), mime_full, NULL, -2, FALSE);
 
 	/**/
 
@@ -356,6 +357,8 @@
 	g_free (utf8_fullname);
 	g_free (size_txt);
 	g_free (file_size_txt);
+	g_free (mime_description);
+	g_free (mime_full);
 }
 
 



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