[tracker/rss-enclosures] libtracker-extract: Support multiple XMP keywords
- From: Roberto Guido <rguido src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/rss-enclosures] libtracker-extract: Support multiple XMP keywords
- Date: Mon, 3 May 2010 00:31:13 +0000 (UTC)
commit 32a87081b1d4f77e9b07ba80fc1835eb5866af35
Author: Philip Van Hoof <philip codeminded be>
Date: Mon Apr 12 12:21:41 2010 +0200
libtracker-extract: Support multiple XMP keywords
Fixes NB#163480
src/libtracker-extract/tracker-xmp.c | 30 ++++++++++++++++++++++++------
1 files changed, 24 insertions(+), 6 deletions(-)
---
diff --git a/src/libtracker-extract/tracker-xmp.c b/src/libtracker-extract/tracker-xmp.c
index 94f4fe6..2eb62fd 100644
--- a/src/libtracker-extract/tracker-xmp.c
+++ b/src/libtracker-extract/tracker-xmp.c
@@ -296,8 +296,14 @@ iterate_simple (const gchar *uri,
}
/* PDF*/
} else if (g_ascii_strcasecmp (schema, NS_PDF) == 0) {
- if (!data->pdf_keywords && g_ascii_strcasecmp (name, "keywords") == 0) {
- data->pdf_keywords = g_strdup (value);
+ if (g_ascii_strcasecmp (name, "keywords") == 0) {
+ if (data->pdf_keywords) {
+ gchar *temp = g_strdup_printf ("%s, %s", value, data->pdf_keywords);
+ g_free (data->pdf_keywords);
+ data->pdf_keywords = temp;
+ } else {
+ data->pdf_keywords = g_strdup (value);
+ }
} else
if (!data->pdf_title && g_ascii_strcasecmp (name, "title") == 0) {
data->pdf_title = g_strdup (value);
@@ -314,10 +320,22 @@ iterate_simple (const gchar *uri,
data->description = g_strdup (value);
} else if (!data->date && g_ascii_strcasecmp (name, "date") == 0) {
data->date = tracker_date_guess (value);
- } else if (!data->keywords && g_ascii_strcasecmp (name, "keywords") == 0) {
- data->keywords = g_strdup (value);
- } else if (!data->subject && g_ascii_strcasecmp (name, "subject") == 0) {
- data->subject = g_strdup (value);
+ } else if (g_ascii_strcasecmp (name, "keywords") == 0) {
+ if (data->keywords) {
+ gchar *temp = g_strdup_printf ("%s, %s", value, data->keywords);
+ g_free (data->keywords);
+ data->keywords = temp;
+ } else {
+ data->keywords = g_strdup (value);
+ }
+ } else if (g_ascii_strcasecmp (name, "subject") == 0) {
+ if (data->subject) {
+ gchar *temp = g_strdup_printf ("%s, %s", value, data->subject);
+ g_free (data->subject);
+ data->subject = temp;
+ } else {
+ data->subject = g_strdup (value);
+ }
} else if (!data->publisher && g_ascii_strcasecmp (name, "publisher") == 0) {
data->publisher = g_strdup (value);
} else if (!data->contributor && g_ascii_strcasecmp (name, "contributor") == 0) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]