Revision: 1314
http://geeqie.svn.sourceforge.net/geeqie/?rev=1314&view=rev
Author: nadvornik
Date: 2008-12-23 20:53:44 +0000 (Tue, 23 Dec 2008)
Log Message:
-----------
added change notification to bar_info.c
Modified Paths:
--------------
trunk/src/bar_info.c
trunk/src/metadata.c
Modified: trunk/src/bar_info.c
===================================================================
--- trunk/src/bar_info.c 2008-12-23 19:15:12 UTC (rev 1313)
+++ trunk/src/bar_info.c 2008-12-23 20:53:44 UTC (rev 1314)
@@ -680,11 +680,19 @@
bar_info_set_selection(bd, FALSE, TRUE, FALSE);
}
+static void bar_info_notify_cb(FileData *fd, NotifyType type, gpointer data)
+{
+ BarInfoData *bd = data;
+ if (fd == bd->fd) bar_info_update(bd);
+}
+
static void bar_info_changed(GtkTextBuffer *buffer, gpointer data)
{
BarInfoData *bd = data;
+ file_data_unregister_notify_func(bar_info_notify_cb, bd);
bar_info_write(bd);
+ file_data_register_notify_func(bar_info_notify_cb, bd,
NOTIFY_PRIORITY_LOW);
}
void bar_info_close(GtkWidget *bar)
@@ -701,6 +709,7 @@
{
BarInfoData *bd = data;
+ file_data_unregister_notify_func(bar_info_notify_cb, bd);
bar_list = g_list_remove(bar_list, bd);
file_data_unref(bd->fd);
@@ -897,6 +906,8 @@
bar_list = g_list_append(bar_list, bd);
+ file_data_register_notify_func(bar_info_notify_cb, bd,
NOTIFY_PRIORITY_LOW);
+
return bd->vbox;
}
Modified: trunk/src/metadata.c
===================================================================
--- trunk/src/metadata.c 2008-12-23 19:15:12 UTC (rev 1313)
+++ trunk/src/metadata.c 2008-12-23 20:53:44 UTC (rev 1314)
@@ -546,30 +546,37 @@
* and the only way to get all keywords is to iterate through
* the item list.
*/
- for (item = exif_get_first_item(exif);
- item;
- item = exif_get_next_item(exif))
+ /* Read IPTC keywords only if there are no XMP keywords
+ * IPTC does not have standard charset, thus the encoding may
differ
+ * from XMP and keyword merging is not reliable.
+ */
+ if (!*keywords)
{
- guint tag;
-
- tag = exif_item_get_tag_id(item);
- if (tag == 0x0019)
+ for (item = exif_get_first_item(exif);
+ item;
+ item = exif_get_next_item(exif))
{
- gchar *tag_name = exif_item_get_tag_name(item);
-
- if (strcmp(tag_name,
"Iptc.Application2.Keywords") == 0)
+ guint tag;
+
+ tag = exif_item_get_tag_id(item);
+ if (tag == 0x0019)
{
- gchar *kw;
- gchar *utf8_kw;
-
- kw = exif_item_get_data_as_text(item);
- if (!kw) continue;
-
- utf8_kw = utf8_validate_or_convert(kw);
- *keywords = g_list_append(*keywords,
(gpointer) utf8_kw);
- g_free(kw);
+ gchar *tag_name =
exif_item_get_tag_name(item);
+
+ if (strcmp(tag_name,
"Iptc.Application2.Keywords") == 0)
+ {
+ gchar *kw;
+ gchar *utf8_kw;
+
+ kw =
exif_item_get_data_as_text(item);
+ if (!kw) continue;
+
+ utf8_kw =
utf8_validate_or_convert(kw);
+ *keywords =
g_list_append(*keywords, (gpointer) utf8_kw);
+ g_free(kw);
+ }
+ g_free(tag_name);
}
- g_free(tag_name);
}
}
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
_______________________________________________
Geeqie-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geeqie-svn