[tracker] tracker-extract, msoffice-xml: don't use a static var to check if nie:generator was already set
- From: Aleksander Morgado <aleksm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] tracker-extract, msoffice-xml: don't use a static var to check if nie:generator was already set
- Date: Fri, 22 Oct 2010 10:05:12 +0000 (UTC)
commit a306e216a6e9e5c2ae22d408ac698fe0ddec4b5f
Author: Aleksander Morgado <aleksander lanedo com>
Date: Fri Oct 22 12:04:31 2010 +0200
tracker-extract, msoffice-xml: don't use a static var to check if nie:generator was already set
src/tracker-extract/tracker-extract-msoffice.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/src/tracker-extract/tracker-extract-msoffice.c b/src/tracker-extract/tracker-extract-msoffice.c
index db729a9..4416fd9 100644
--- a/src/tracker-extract/tracker-extract-msoffice.c
+++ b/src/tracker-extract/tracker-extract-msoffice.c
@@ -165,6 +165,7 @@ typedef struct {
const gchar *uri;
GString *content;
gboolean title_already_set;
+ gboolean generator_already_set;
} MsOfficeXMLParserInfo;
typedef struct {
@@ -1900,7 +1901,6 @@ xml_text_handler_document_data (GMarkupParseContext *context,
GError **error)
{
MsOfficeXMLParserInfo *info = user_data;
- static gboolean added = FALSE;
switch (info->tag_type) {
case MS_OFFICE_XML_TAG_WORD_TEXT:
@@ -1964,10 +1964,13 @@ xml_text_handler_document_data (GMarkupParseContext *context,
}
case MS_OFFICE_XML_TAG_GENERATOR:
- if (!added) {
+ if (info->generator_already_set) {
+ g_warning ("Avoiding additional generator (%s) in MsOffice XML document '%s'",
+ text, info->uri);
+ } else {
+ info->generator_already_set = TRUE;
tracker_sparql_builder_predicate (info->metadata, "nie:generator");
tracker_sparql_builder_object_unvalidated (info->metadata, text);
- added = TRUE;
}
break;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]