gthumb r2184 - in trunk: . libgthumb src



Author: mjc
Date: Fri Jan 11 20:41:35 2008
New Revision: 2184
URL: http://svn.gnome.org/viewvc/gthumb?rev=2184&view=rev

Log:
2008-01-11  Michael J. Chudobiak  <mjc svn gnome org>

        * libgthumb/gth-exif-utils.c: (free_metadata_entry):
        * libgthumb/gth-exif-utils.h:
        * libgthumb/gth-exiv2-utils.cpp:
        * libgthumb/gth-gstreamer-utils.c: (add_metadata):
        * src/gth-exif-data-viewer.c: (gth_exif_data_viewer_construct),
        (add_to_exif_display_list), (add_to_display), (gth_read_exif),
        (update_file_info):
        Add a "writeable_path" field to the metadata struct and tree model,
        to allow metadata editing in the future.



Modified:
   trunk/ChangeLog
   trunk/libgthumb/gth-exif-utils.c
   trunk/libgthumb/gth-exif-utils.h
   trunk/libgthumb/gth-exiv2-utils.cpp
   trunk/libgthumb/gth-gstreamer-utils.c
   trunk/src/gth-exif-data-viewer.c

Modified: trunk/libgthumb/gth-exif-utils.c
==============================================================================
--- trunk/libgthumb/gth-exif-utils.c	(original)
+++ trunk/libgthumb/gth-exif-utils.c	Fri Jan 11 20:41:35 2008
@@ -758,7 +758,7 @@
 void free_metadata_entry (GthMetadata *entry)
 {
 	if (entry != NULL) {
-		g_free (entry->full_name);
+		g_free (entry->writeable_path);
 		g_free (entry->display_name);
 		g_free (entry->value);
 		g_free (entry);

Modified: trunk/libgthumb/gth-exif-utils.h
==============================================================================
--- trunk/libgthumb/gth-exif-utils.h	(original)
+++ trunk/libgthumb/gth-exif-utils.h	Fri Jan 11 20:41:35 2008
@@ -66,7 +66,7 @@
  
 typedef struct {
         GthMetadataCategory category;
-	char *full_name;
+	char *writeable_path;
         char *display_name;
         char *value;
         int   position;

Modified: trunk/libgthumb/gth-exiv2-utils.cpp
==============================================================================
--- trunk/libgthumb/gth-exiv2-utils.cpp	(original)
+++ trunk/libgthumb/gth-exiv2-utils.cpp	Fri Jan 11 20:41:35 2008
@@ -69,7 +69,7 @@
 
 inline static GList *
 add (GList              *metadata,
-     const gchar        *full_name, 
+     const gchar        *writeable_path, 
      const gchar        *display_name,
      const gchar	*value,
      GthMetadataCategory category)
@@ -78,7 +78,7 @@
 
 	new_entry = g_new (GthMetadata, 1);
 	new_entry->category = category;
-	new_entry->full_name = g_strdup (full_name);
+	new_entry->writeable_path = g_strdup (writeable_path);
 	new_entry->display_name = g_strdup (display_name);
 	new_entry->value = g_strdup (value);
 	new_entry->position = 0;

Modified: trunk/libgthumb/gth-gstreamer-utils.c
==============================================================================
--- trunk/libgthumb/gth-gstreamer-utils.c	(original)
+++ trunk/libgthumb/gth-gstreamer-utils.c	Fri Jan 11 20:41:35 2008
@@ -350,7 +350,7 @@
 	if (value != NULL) {
 		new_entry = g_new (GthMetadata, 1);
         	new_entry->category = GTH_METADATA_CATEGORY_GSTREAMER;
-		new_entry->full_name = g_strdup (key);
+		new_entry->writeable_path = NULL;
 		new_entry->display_name = key;
         	new_entry->value = value;
 	       	new_entry->position = 0;

Modified: trunk/src/gth-exif-data-viewer.c
==============================================================================
--- trunk/src/gth-exif-data-viewer.c	(original)
+++ trunk/src/gth-exif-data-viewer.c	Fri Jan 11 20:41:35 2008
@@ -307,6 +307,7 @@
 
 
 enum {
+	WRITEABLE_PATH_COLUMN,
 	NAME_COLUMN,
 	VALUE_COLUMN,
 	POS_COLUMN,
@@ -387,7 +388,8 @@
 	edv->priv->image_exif_view = gtk_tree_view_new ();
 	gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (edv->priv->image_exif_view), FALSE);
 	gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (edv->priv->image_exif_view), TRUE);
-	edv->priv->image_exif_model = gtk_tree_store_new (3,
+	edv->priv->image_exif_model = gtk_tree_store_new (4,
+							  G_TYPE_STRING,
 							  G_TYPE_STRING,
 							  G_TYPE_STRING,
 							  G_TYPE_INT);
@@ -523,6 +525,7 @@
 static void
 add_to_exif_display_list (GthExifDataViewer   *edv,
 			  GthMetadataCategory  category,
+			  const char	      *writeable_path,
 			  const char 	      *utf8_name,
 			  const char	      *utf8_value,
 	 		  int		       position)
@@ -535,6 +538,7 @@
 		GtkTreePath *path;
 		gtk_tree_store_append (edv->priv->image_exif_model, &root_iter, NULL);
 		gtk_tree_store_set (edv->priv->image_exif_model, &root_iter,
+				    WRITEABLE_PATH_COLUMN, NULL,
 				    NAME_COLUMN, _(metadata_category_name[category]),
 				    VALUE_COLUMN, "",
 				    POS_COLUMN, category,
@@ -554,6 +558,7 @@
 
 	gtk_tree_store_append (edv->priv->image_exif_model, &iter, &root_iter);
 	gtk_tree_store_set (edv->priv->image_exif_model, &iter,
+			    WRITEABLE_PATH_COLUMN, writeable_path,
 			    NAME_COLUMN, utf8_name,
 			    VALUE_COLUMN, utf8_value,
 			    POS_COLUMN, position,
@@ -619,6 +624,7 @@
 {
 	add_to_exif_display_list (edv,
 		       		  entry->category,
+				  entry->writeable_path,
 			  	  entry->display_name,
 				  entry->value,
 				  entry->position);
@@ -709,7 +715,7 @@
 
 				new_entry = g_new (GthMetadata, 1);
 				new_entry->category = category;
-				new_entry->full_name = g_strdup (utf8_name);
+				new_entry->writeable_path = NULL;
 				new_entry->display_name = g_strdup (utf8_name);
 				new_entry->value = g_strdup (utf8_value);
 				new_entry->position = position;
@@ -761,7 +767,7 @@
 
 	                                new_entry = g_new (GthMetadata, 1);
                                 	new_entry->category = GTH_METADATA_CATEGORY_MAKERNOTE;
-					new_entry->full_name = g_strdup (utf8_name);
+					new_entry->writeable_path = NULL;
                         	        new_entry->display_name = g_strdup (utf8_name);
                 	                new_entry->value = g_strdup (utf8_value);
         	                        new_entry->position = unique_id_for_unsorted_tags;
@@ -854,15 +860,15 @@
 	
 	/**/
 
-	add_to_exif_display_list (edv, GTH_METADATA_CATEGORY_FILE, _("Name"), utf8_name, -7);
-	add_to_exif_display_list (edv, GTH_METADATA_CATEGORY_FILE, _("Path"), utf8_fullname, -6);
+	add_to_exif_display_list (edv, GTH_METADATA_CATEGORY_FILE, NULL, _("Name"), utf8_name, -7);
+	add_to_exif_display_list (edv, GTH_METADATA_CATEGORY_FILE, NULL, _("Path"), utf8_fullname, -6);
 
 	if (mime_type_is_image (mime_type))
-		add_to_exif_display_list (edv, GTH_METADATA_CATEGORY_FILE, _("Dimensions"), size_txt, -5);
+		add_to_exif_display_list (edv, GTH_METADATA_CATEGORY_FILE, NULL, _("Dimensions"), size_txt, -5);
 
-	add_to_exif_display_list (edv, GTH_METADATA_CATEGORY_FILE, _("Size"), file_size_txt, -4);
-	add_to_exif_display_list (edv, GTH_METADATA_CATEGORY_FILE, _("Modified"), utf8_time_txt, -3);
-	add_to_exif_display_list (edv, GTH_METADATA_CATEGORY_FILE, _("Type"), mime_type, -2);
+	add_to_exif_display_list (edv, GTH_METADATA_CATEGORY_FILE, NULL, _("Size"), file_size_txt, -4);
+	add_to_exif_display_list (edv, GTH_METADATA_CATEGORY_FILE, NULL, _("Modified"), utf8_time_txt, -3);
+	add_to_exif_display_list (edv, GTH_METADATA_CATEGORY_FILE, NULL, _("Type"), mime_type, -2);
 
 	/**/
 



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