[gthumb] fixed unnecessary reloading when setting a filter



commit 3ce9a166f8a6681db2ffb3549f3d3815d356d86f
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Fri Aug 13 13:22:12 2010 +0200

    fixed unnecessary reloading when setting a filter
    
    [bug #625937]

 .../exiv2_tools/gth-metadata-provider-exiv2.c      |    2 +-
 .../gth-metadata-provider-gstreamer.c              |    3 ++-
 .../image_viewer/gth-metadata-provider-image.c     |    2 +-
 gthumb/gth-main.c                                  |   11 ++++++++---
 4 files changed, 12 insertions(+), 6 deletions(-)
---
diff --git a/extensions/exiv2_tools/gth-metadata-provider-exiv2.c b/extensions/exiv2_tools/gth-metadata-provider-exiv2.c
index 62966cf..d8b048e 100644
--- a/extensions/exiv2_tools/gth-metadata-provider-exiv2.c
+++ b/extensions/exiv2_tools/gth-metadata-provider-exiv2.c
@@ -36,7 +36,7 @@ gth_metadata_provider_exiv2_can_read (GthMetadataProvider  *self,
 				      const char           *mime_type,
 				      char                **attribute_v)
 {
-	if (! _g_content_type_is_a (mime_type, "image/*"))
+	if (! g_str_equal (mime_type, "*") && ! _g_content_type_is_a (mime_type, "image/*"))
 		return FALSE;
 
 	return _g_file_attributes_matches_any_v ("Exif::*,"
diff --git a/extensions/gstreamer_tools/gth-metadata-provider-gstreamer.c b/extensions/gstreamer_tools/gth-metadata-provider-gstreamer.c
index 1da8dc7..f6401a5 100644
--- a/extensions/gstreamer_tools/gth-metadata-provider-gstreamer.c
+++ b/extensions/gstreamer_tools/gth-metadata-provider-gstreamer.c
@@ -34,7 +34,8 @@ gth_metadata_provider_gstreamer_can_read (GthMetadataProvider  *self,
 				          const char           *mime_type,
 				          char                **attribute_v)
 {
-	if (! _g_content_type_is_a (mime_type, "audio/*")
+	if (! g_str_equal (mime_type, "*")
+	    && ! _g_content_type_is_a (mime_type, "audio/*")
 	    && ! _g_content_type_is_a (mime_type, "video/*"))
 	{
 		return FALSE;
diff --git a/extensions/image_viewer/gth-metadata-provider-image.c b/extensions/image_viewer/gth-metadata-provider-image.c
index a56af25..a940d5a 100644
--- a/extensions/image_viewer/gth-metadata-provider-image.c
+++ b/extensions/image_viewer/gth-metadata-provider-image.c
@@ -34,7 +34,7 @@ gth_metadata_provider_image_can_read (GthMetadataProvider  *self,
 				      const char           *mime_type,
 				      char                **attribute_v)
 {
-	if (! _g_mime_type_is_image (mime_type))
+	if (! g_str_equal (mime_type, "*") && ! _g_mime_type_is_image (mime_type))
 		return FALSE;
 
 	return _g_file_attributes_matches_any_v ("general::format,"
diff --git a/gthumb/gth-main.c b/gthumb/gth-main.c
index 9e9d816..c48a7c9 100644
--- a/gthumb/gth-main.c
+++ b/gthumb/gth-main.c
@@ -1324,8 +1324,11 @@ attribute_list_reload_required (const char *old_attributes,
 		g_object_ref (provider);
 	}
 
-	/*g_print ("attributes to load: %s\n", new_attributes);
-	g_print ("attributes not available: \n");*/
+	/*
+	g_print ("old attributes: %s\n", old_attributes);
+	g_print ("new attributes: %s\n", new_attributes);
+	g_print ("attributes not available: \n");
+	*/
 
 	reload_required = FALSE;
 	for (i = 0; ! reload_required && (i < new_attributes_len); i++)
@@ -1334,9 +1337,11 @@ attribute_list_reload_required (const char *old_attributes,
 		    && (strcmp (new_attributes_v[i], "none") != 0))
 		{
 			reload_required = TRUE;
-			/*g_print ("\t%s\n", new_attributes_v[i]);*/
+			/* g_print ("\t%s\n", new_attributes_v[i]); */
 		}
 
+	/* g_print ("reload required: %d\n", reload_required); */
+
 	g_strfreev (new_attributes_v);
 	g_strfreev (old_attributes_v);
 



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