[gthumb: 31/57] filter metadata in the registration functions
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb: 31/57] filter metadata in the registration functions
- Date: Sun, 20 Jun 2010 16:24:21 +0000 (UTC)
commit 51211546478c6b632354ee5c718bc9eaf2cb0421
Author: Paolo Bacchilega <paobac src gnome org>
Date: Tue Jun 15 13:23:07 2010 +0200
filter metadata in the registration functions
moved the metadata filter in the metadata registration function to avoid duplicated code.
extensions/exiv2_tools/exiv2-utils.cpp | 6 +-----
gthumb/gth-file-properties.c | 3 ---
gthumb/gth-main.c | 6 +++++-
3 files changed, 6 insertions(+), 9 deletions(-)
---
diff --git a/extensions/exiv2_tools/exiv2-utils.cpp b/extensions/exiv2_tools/exiv2-utils.cpp
index 9510b4f..94e5c21 100644
--- a/extensions/exiv2_tools/exiv2-utils.cpp
+++ b/extensions/exiv2_tools/exiv2-utils.cpp
@@ -226,10 +226,6 @@ set_file_info (GFileInfo *info,
formatted_value_utf8 = g_locale_to_utf8 (formatted_clean, -1, NULL, NULL, NULL);
}
-/*
-g_print ("%s (%s): %s (%s)\n", key, description, formatted_value, raw_value);
-*/
-
metadata_info = gth_main_get_metadata_info (attribute);
if ((metadata_info == NULL) && (category != NULL)) {
GthMetadataInfo info;
@@ -243,7 +239,7 @@ g_print ("%s (%s): %s (%s)\n", key, description, formatted_value, raw_value);
metadata_info = gth_main_register_metadata_info (&info);
}
- if ((metadata_info->display_name == NULL) && (description_utf8 != NULL))
+ if ((metadata_info != NULL) && (metadata_info->display_name == NULL) && (description_utf8 != NULL))
metadata_info->display_name = g_strdup (description_utf8);
metadata = gth_metadata_new ();
diff --git a/gthumb/gth-file-properties.c b/gthumb/gth-file-properties.c
index 32cc021..f6fefef 100644
--- a/gthumb/gth-file-properties.c
+++ b/gthumb/gth-file-properties.c
@@ -119,9 +119,6 @@ gth_file_properties_real_set_file (GthPropertyView *base,
if ((info->flags & GTH_METADATA_ALLOW_IN_PROPERTIES_VIEW) != GTH_METADATA_ALLOW_IN_PROPERTIES_VIEW)
continue;
- if ((info->display_name == NULL) || (strstr (info->display_name, "0x") != NULL))
- continue;
-
value = gth_file_data_get_attribute_as_string (file_data, info->id);
if ((value == NULL) || (*value == '\0'))
continue;
diff --git a/gthumb/gth-main.c b/gthumb/gth-main.c
index d3aadbd..15eb367 100644
--- a/gthumb/gth-main.c
+++ b/gthumb/gth-main.c
@@ -407,6 +407,9 @@ gth_main_register_metadata_info (GthMetadataInfo *metadata_info)
{
GthMetadataInfo *info;
+ if ((metadata_info->display_name == NULL) || (strstr (metadata_info->display_name, "0x") != NULL))
+ return NULL;
+
g_static_mutex_lock (&metadata_info_mutex);
info = gth_metadata_info_dup (metadata_info);
@@ -427,7 +430,8 @@ gth_main_register_metadata_info_v (GthMetadataInfo metadata_info[])
g_static_mutex_lock (&metadata_info_mutex);
for (i = 0; metadata_info[i].id != NULL; i++)
- g_ptr_array_add (Main->priv->metadata_info, &metadata_info[i]);
+ if ((metadata_info[i].display_name != NULL) && (strstr (metadata_info[i].display_name, "0x") == NULL))
+ g_ptr_array_add (Main->priv->metadata_info, &metadata_info[i]);
g_static_mutex_unlock (&metadata_info_mutex);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]