[tracker/tracker-store] tracker-indexer: Replace ModuleMetadata by SparqlBuilder
- From: Jürg Billeter <juergbi src gnome org>
- To: svn-commits-list gnome org
- Subject: [tracker/tracker-store] tracker-indexer: Replace ModuleMetadata by SparqlBuilder
- Date: Wed, 24 Jun 2009 08:17:44 +0000 (UTC)
commit 143d1d7f951f5308f331c776a5e8f9b7ac4b07ea
Author: Jürg Billeter <j bitron ch>
Date: Wed Jun 24 10:10:34 2009 +0200
tracker-indexer: Replace ModuleMetadata by SparqlBuilder
.../libtracker-module-sections.txt | 11 --
.../tmpl/tracker-module-metadata.sgml | 71 -----------
src/tracker-indexer/Makefile.am | 7 +-
src/tracker-indexer/modules/applications.c | 129 ++++++++++----------
src/tracker-indexer/modules/dummy.c | 4 +-
src/tracker-indexer/modules/evolution-common.c | 6 +-
src/tracker-indexer/modules/evolution-common.h | 2 +-
src/tracker-indexer/modules/evolution-imap.c | 60 +++++-----
src/tracker-indexer/modules/evolution-pop.c | 64 +++++-----
src/tracker-indexer/modules/files.c | 17 ++--
src/tracker-indexer/modules/gaim-conversations.c | 9 +-
src/tracker-indexer/tracker-indexer.c | 66 +++++-----
src/tracker-indexer/tracker-module-file.c | 9 +-
src/tracker-indexer/tracker-module-file.h | 6 +-
.../tracker-module-metadata-private.h | 36 ------
.../tracker-module-metadata-utils.c | 52 ++++----
.../tracker-module-metadata-utils.h | 5 +-
src/tracker-indexer/tracker-module-metadata.c | 88 -------------
src/tracker-indexer/tracker-module-metadata.h | 59 ---------
src/tracker-indexer/tracker-module.h | 1 -
src/tracker-indexer/tracker-removable-device.c | 4 +-
src/tracker-indexer/tracker-removable-device.h | 3 +-
tests/tracker-indexer/Makefile.am | 2 -
23 files changed, 222 insertions(+), 489 deletions(-)
---
diff --git a/docs/reference/libtracker-module/libtracker-module-sections.txt b/docs/reference/libtracker-module/libtracker-module-sections.txt
index 4e24094..06b3a20 100644
--- a/docs/reference/libtracker-module/libtracker-module-sections.txt
+++ b/docs/reference/libtracker-module/libtracker-module-sections.txt
@@ -19,17 +19,6 @@ tracker_module_iteratable_iter_contents
tracker_module_iteratable_get_count
</SECTION>
-<INCLUDE>libtracker-module/tracker-module-metadata.h</INCLUDE>
-<SECTION>
-<FILE>tracker-module-metadata</FILE>
-<TITLE>Metadata Object</TITLE>
-TrackerModuleMetadata
-tracker_module_metadata_new
-tracker_module_metadata_add_take_string
-tracker_module_metadata_add_string
-tracker_module_metadata_add_date
-</SECTION>
-
<INCLUDE>libtracker-module/tracker-module-metadata-utils.h</INCLUDE>
<SECTION>
<FILE>tracker-module-metadata-utils</FILE>
diff --git a/src/tracker-indexer/Makefile.am b/src/tracker-indexer/Makefile.am
index 54a6c35..8dda9d9 100644
--- a/src/tracker-indexer/Makefile.am
+++ b/src/tracker-indexer/Makefile.am
@@ -31,15 +31,13 @@ libtracker_module_la_SOURCES = \
tracker-dbus.c \
tracker-module-file.c \
tracker-module-iteratable.c \
- tracker-module-metadata-utils.c \
- tracker-module-metadata.c
+ tracker-module-metadata-utils.c
libtracker_moduleinclude_HEADERS = \
tracker-module.h \
tracker-module-file.h \
tracker-module-iteratable.h \
- tracker-module-metadata-utils.h \
- tracker-module-metadata.h
+ tracker-module-metadata-utils.h
libtracker_module_la_LIBADD = $(GCOV_LIBS)
@@ -54,7 +52,6 @@ tracker_indexer_SOURCES = \
tracker-indexer-module.c \
tracker-indexer-module.h \
tracker-main.c \
- tracker-module-metadata-private.h \
tracker-marshal-main.c \
tracker-monitor.c \
tracker-monitor.h \
diff --git a/src/tracker-indexer/modules/applications.c b/src/tracker-indexer/modules/applications.c
index 791172d..ae43707 100644
--- a/src/tracker-indexer/modules/applications.c
+++ b/src/tracker-indexer/modules/applications.c
@@ -72,7 +72,7 @@ struct TrackerApplicationFileClass {
};
static GType tracker_application_file_get_type (void) G_GNUC_CONST;
-static TrackerModuleMetadata * tracker_application_file_get_metadata (TrackerModuleFile *file);
+static TrackerSparqlBuilder * tracker_application_file_get_metadata (TrackerModuleFile *file);
G_DEFINE_DYNAMIC_TYPE (TrackerApplicationFile, tracker_application_file, TRACKER_TYPE_MODULE_FILE);
@@ -97,7 +97,7 @@ tracker_application_file_init (TrackerApplicationFile *file)
}
static void
-insert_data_from_desktop_file (TrackerModuleMetadata *metadata,
+insert_data_from_desktop_file (TrackerSparqlBuilder *sparql,
const gchar *subject,
const gchar *metadata_key,
GKeyFile *desktop_file,
@@ -113,17 +113,17 @@ insert_data_from_desktop_file (TrackerModuleMetadata *metadata,
}
if (str) {
- tracker_sparql_builder_predicate_iri (metadata->sparql, metadata_key);
- tracker_sparql_builder_object_string (metadata->sparql, str);
+ tracker_sparql_builder_predicate_iri (sparql, metadata_key);
+ tracker_sparql_builder_object_string (sparql, str);
g_free (str);
}
}
-static TrackerModuleMetadata *
+static TrackerSparqlBuilder *
tracker_application_file_get_metadata (TrackerModuleFile *file)
{
- TrackerModuleMetadata *metadata = NULL;
+ TrackerSparqlBuilder *sparql = NULL;
GKeyFile *key_file;
GFile *f;
gchar *path, *type, *filename, *name = NULL, *uri = NULL;
@@ -181,92 +181,95 @@ tracker_application_file_get_metadata (TrackerModuleFile *file)
gchar *icon = g_key_file_get_string (key_file, GROUP_DESKTOP_ENTRY, "Icon", NULL);
uri = NULL;
- metadata = tracker_module_metadata_new ();
+ sparql = tracker_sparql_builder_new_update ();
+ tracker_sparql_builder_insert_open (sparql);
if (icon) {
gchar *icon_uri = g_strdup_printf (THEME_ICON_URN_PREFIX "%s", icon);
- tracker_sparql_builder_subject_iri (metadata->sparql, icon_uri);
- tracker_sparql_builder_predicate (metadata->sparql, "a");
- tracker_sparql_builder_object (metadata->sparql, "nfo:Image");
+ tracker_sparql_builder_subject_iri (sparql, icon_uri);
+ tracker_sparql_builder_predicate (sparql, "a");
+ tracker_sparql_builder_object (sparql, "nfo:Image");
- tracker_sparql_builder_subject_iri (metadata->sparql, canonical_uri);
- tracker_sparql_builder_predicate (metadata->sparql, "nfo:softwareCategoryIcon");
- tracker_sparql_builder_object_iri (metadata->sparql, icon_uri);
+ tracker_sparql_builder_subject_iri (sparql, canonical_uri);
+ tracker_sparql_builder_predicate (sparql, "nfo:softwareCategoryIcon");
+ tracker_sparql_builder_object_iri (sparql, icon_uri);
g_free (icon_uri);
g_free (icon);
}
- tracker_sparql_builder_subject_iri (metadata->sparql, canonical_uri);
- tracker_sparql_builder_predicate (metadata->sparql, "a");
- tracker_sparql_builder_object (metadata->sparql, "nfo:SoftwareCategory");
+ tracker_sparql_builder_subject_iri (sparql, canonical_uri);
+ tracker_sparql_builder_predicate (sparql, "a");
+ tracker_sparql_builder_object (sparql, "nfo:SoftwareCategory");
- tracker_sparql_builder_predicate (metadata->sparql, "nie:title");
- tracker_sparql_builder_object_string (metadata->sparql, name);
+ tracker_sparql_builder_predicate (sparql, "nie:title");
+ tracker_sparql_builder_object_string (sparql, name);
g_free (canonical_uri);
} else if (name && g_ascii_strcasecmp (type, "Application") == 0) {
uri = tracker_module_file_get_uri (file);
- metadata = tracker_module_metadata_new ();
+ sparql = tracker_sparql_builder_new_update ();
+ tracker_sparql_builder_insert_open (sparql);
- tracker_sparql_builder_subject_iri (metadata->sparql, APPLICATION_DATASOURCE_URN);
- tracker_sparql_builder_predicate (metadata->sparql, "a");
- tracker_sparql_builder_object (metadata->sparql, "nie:DataSource");
+ tracker_sparql_builder_subject_iri (sparql, APPLICATION_DATASOURCE_URN);
+ tracker_sparql_builder_predicate (sparql, "a");
+ tracker_sparql_builder_object (sparql, "nie:DataSource");
- tracker_sparql_builder_subject_iri (metadata->sparql, uri);
- tracker_sparql_builder_predicate (metadata->sparql, "a");
- tracker_sparql_builder_object (metadata->sparql, "nfo:SoftwareApplication");
+ tracker_sparql_builder_subject_iri (sparql, uri);
+ tracker_sparql_builder_predicate (sparql, "a");
+ tracker_sparql_builder_object (sparql, "nfo:SoftwareApplication");
- tracker_sparql_builder_predicate (metadata->sparql, "nie:dataSource");
- tracker_sparql_builder_object_iri (metadata->sparql, APPLICATION_DATASOURCE_URN);
+ tracker_sparql_builder_predicate (sparql, "nie:dataSource");
+ tracker_sparql_builder_object_iri (sparql, APPLICATION_DATASOURCE_URN);
/* This matches SomeApplet as Type= */
} else if (name && g_str_has_suffix (type, "Applet")) {
uri = tracker_module_file_get_uri (file);
- metadata = tracker_module_metadata_new ();
+ sparql = tracker_sparql_builder_new_update ();
+ tracker_sparql_builder_insert_open (sparql);
- tracker_sparql_builder_subject_iri (metadata->sparql, APPLET_DATASOURCE_URN);
- tracker_sparql_builder_predicate (metadata->sparql, "a");
- tracker_sparql_builder_object (metadata->sparql, "nie:DataSource");
+ tracker_sparql_builder_subject_iri (sparql, APPLET_DATASOURCE_URN);
+ tracker_sparql_builder_predicate (sparql, "a");
+ tracker_sparql_builder_object (sparql, "nie:DataSource");
/* TODO This is atm specific for Maemo */
- tracker_sparql_builder_subject_iri (metadata->sparql, uri);
- tracker_sparql_builder_predicate (metadata->sparql, "a");
- tracker_sparql_builder_object (metadata->sparql, "nfo:SoftwareApplet");
+ tracker_sparql_builder_subject_iri (sparql, uri);
+ tracker_sparql_builder_predicate (sparql, "a");
+ tracker_sparql_builder_object (sparql, "nfo:SoftwareApplet");
- tracker_sparql_builder_predicate (metadata->sparql, "nie:dataSource");
- tracker_sparql_builder_object_iri (metadata->sparql, APPLET_DATASOURCE_URN);
+ tracker_sparql_builder_predicate (sparql, "nie:dataSource");
+ tracker_sparql_builder_object_iri (sparql, APPLET_DATASOURCE_URN);
}
- if (metadata && uri) {
+ if (sparql && uri) {
gchar *icon;
- tracker_sparql_builder_predicate (metadata->sparql, "a");
- tracker_sparql_builder_object (metadata->sparql, "nfo:Executable");
- tracker_sparql_builder_object (metadata->sparql, "nfo:FileDataObject");
+ tracker_sparql_builder_predicate (sparql, "a");
+ tracker_sparql_builder_object (sparql, "nfo:Executable");
+ tracker_sparql_builder_object (sparql, "nfo:FileDataObject");
- tracker_sparql_builder_predicate (metadata->sparql, "nie:title");
- tracker_sparql_builder_object_string (metadata->sparql, name);
+ tracker_sparql_builder_predicate (sparql, "nie:title");
+ tracker_sparql_builder_object_string (sparql, name);
- insert_data_from_desktop_file (metadata, uri, NIE_PREFIX "comment", key_file, "Comment", TRUE);
- insert_data_from_desktop_file (metadata, uri, NFO_PREFIX "softwareCmdLine", key_file, "Exec", TRUE);
+ insert_data_from_desktop_file (sparql, uri, NIE_PREFIX "comment", key_file, "Comment", TRUE);
+ insert_data_from_desktop_file (sparql, uri, NFO_PREFIX "softwareCmdLine", key_file, "Exec", TRUE);
icon = g_key_file_get_string (key_file, GROUP_DESKTOP_ENTRY, "Icon", NULL);
if (icon) {
gchar *icon_uri = g_strdup_printf (THEME_ICON_URN_PREFIX "%s", icon);
- tracker_sparql_builder_subject_iri (metadata->sparql, icon_uri);
- tracker_sparql_builder_predicate (metadata->sparql, "a");
- tracker_sparql_builder_object (metadata->sparql, "nfo:Image");
+ tracker_sparql_builder_subject_iri (sparql, icon_uri);
+ tracker_sparql_builder_predicate (sparql, "a");
+ tracker_sparql_builder_object (sparql, "nfo:Image");
- tracker_sparql_builder_subject_iri (metadata->sparql, uri);
- tracker_sparql_builder_predicate (metadata->sparql, "nfo:softwareIcon");
- tracker_sparql_builder_object_iri (metadata->sparql, icon_uri);
+ tracker_sparql_builder_subject_iri (sparql, uri);
+ tracker_sparql_builder_predicate (sparql, "nfo:softwareIcon");
+ tracker_sparql_builder_object_iri (sparql, icon_uri);
g_free (icon_uri);
g_free (icon);
@@ -283,27 +286,27 @@ tracker_application_file_get_metadata (TrackerModuleFile *file)
* preemptively creating them if we visit a app .desktop
* file that mentions one that we don't yet know about */
- tracker_sparql_builder_subject_iri (metadata->sparql, cat_uri);
- tracker_sparql_builder_predicate (metadata->sparql, "a");
- tracker_sparql_builder_object (metadata->sparql, "nfo:SoftwareCategory");
+ tracker_sparql_builder_subject_iri (sparql, cat_uri);
+ tracker_sparql_builder_predicate (sparql, "a");
+ tracker_sparql_builder_object (sparql, "nfo:SoftwareCategory");
- tracker_sparql_builder_predicate (metadata->sparql, "nie:title");
- tracker_sparql_builder_object_string (metadata->sparql, cats[i]);
+ tracker_sparql_builder_predicate (sparql, "nie:title");
+ tracker_sparql_builder_object_string (sparql, cats[i]);
- tracker_sparql_builder_subject_iri (metadata->sparql, uri);
- tracker_sparql_builder_predicate (metadata->sparql, "nfo:belongsToContainer");
- tracker_sparql_builder_object_iri (metadata->sparql, cat_uri);
+ tracker_sparql_builder_subject_iri (sparql, uri);
+ tracker_sparql_builder_predicate (sparql, "nfo:belongsToContainer");
+ tracker_sparql_builder_object_iri (sparql, cat_uri);
g_free (cat_uri);
}
}
- tracker_sparql_builder_predicate (metadata->sparql, "nie:dataSource");
- tracker_sparql_builder_object_iri (metadata->sparql, APPLICATION_DATASOURCE_URN);
+ tracker_sparql_builder_predicate (sparql, "nie:dataSource");
+ tracker_sparql_builder_object_iri (sparql, APPLICATION_DATASOURCE_URN);
filename = g_filename_display_basename (path);
- tracker_sparql_builder_predicate (metadata->sparql, "nfo:fileName");
- tracker_sparql_builder_object_string (metadata->sparql, filename);
+ tracker_sparql_builder_predicate (sparql, "nfo:fileName");
+ tracker_sparql_builder_object_string (sparql, filename);
g_free (filename);
}
@@ -316,7 +319,7 @@ tracker_application_file_get_metadata (TrackerModuleFile *file)
g_free (path);
g_free (name);
- return metadata;
+ return sparql;
}
diff --git a/src/tracker-indexer/modules/dummy.c b/src/tracker-indexer/modules/dummy.c
index 14c47a8..b3d4397 100644
--- a/src/tracker-indexer/modules/dummy.c
+++ b/src/tracker-indexer/modules/dummy.c
@@ -60,7 +60,7 @@ static void dummy_file_initialize (TrackerModuleFile *file);
static const gchar * dummy_file_get_service_type (TrackerModuleFile *file);
static gchar * dummy_file_get_uri (TrackerModuleFile *file);
static gchar * dummy_file_get_text (TrackerModuleFile *file);
-static TrackerModuleMetadata *
+static TrackerSparqlBuilder *
dummy_file_get_metadata (TrackerModuleFile *file);
static gboolean dummy_file_iter_contents (TrackerModuleIteratable *iteratable);
@@ -156,7 +156,7 @@ dummy_file_get_text (TrackerModuleFile *file)
return NULL;
}
-static TrackerModuleMetadata *
+static TrackerSparqlBuilder *
dummy_file_get_metadata (TrackerModuleFile *file)
{
/* Return a TrackerModuleMetadata filled with metadata for file,
diff --git a/src/tracker-indexer/modules/evolution-common.c b/src/tracker-indexer/modules/evolution-common.c
index 6e6ae24..78ba898 100644
--- a/src/tracker-indexer/modules/evolution-common.c
+++ b/src/tracker-indexer/modules/evolution-common.c
@@ -30,8 +30,6 @@
#include <glib/gstdio.h>
#include <tracker-indexer/tracker-module-metadata-utils.h>
-#include <tracker-indexer/tracker-module-metadata.h>
-#include <tracker-indexer/tracker-module-metadata-private.h>
#include "evolution-common.h"
@@ -60,7 +58,7 @@ evolution_common_get_stream (const gchar *path,
void
evolution_common_get_wrapper_metadata (GMimeDataWrapper *wrapper,
- TrackerModuleMetadata *metadata,
+ TrackerSparqlBuilder *sparql,
const gchar *subject)
{
GMimeStream *stream;
@@ -78,7 +76,7 @@ evolution_common_get_wrapper_metadata (GMimeDataWrapper *wrapper,
file = g_file_new_for_path (path);
g_mime_stream_flush (stream);
- tracker_module_metadata_utils_get_data (file, metadata);
+ tracker_module_metadata_utils_get_data (file, sparql);
g_object_unref (file);
g_unlink (path);
diff --git a/src/tracker-indexer/modules/evolution-common.h b/src/tracker-indexer/modules/evolution-common.h
index f7c62ba..e8f2640 100644
--- a/src/tracker-indexer/modules/evolution-common.h
+++ b/src/tracker-indexer/modules/evolution-common.h
@@ -53,7 +53,7 @@ GMimeStream * evolution_common_get_stream (const gchar
gint flags,
off_t start);
void evolution_common_get_wrapper_metadata (GMimeDataWrapper *wrapper,
- TrackerModuleMetadata *metadata,
+ TrackerSparqlBuilder *metadata,
const gchar *subject);
gchar * evolution_common_get_object_encoding (GMimeObject *object);
diff --git a/src/tracker-indexer/modules/evolution-imap.c b/src/tracker-indexer/modules/evolution-imap.c
index 56c1730..b6e0c58 100644
--- a/src/tracker-indexer/modules/evolution-imap.c
+++ b/src/tracker-indexer/modules/evolution-imap.c
@@ -72,7 +72,7 @@ static void tracker_evolution_imap_file_finalize (GObject *obje
static void tracker_evolution_imap_file_initialize (TrackerModuleFile *file);
static gchar * tracker_evolution_imap_file_get_uri (TrackerModuleFile *file);
static gchar * tracker_evolution_imap_file_get_text (TrackerModuleFile *file);
-static TrackerModuleMetadata *
+static TrackerSparqlBuilder *
tracker_evolution_imap_file_get_metadata (TrackerModuleFile *file);
static TrackerModuleFlags
tracker_evolution_imap_file_get_flags (TrackerModuleFile *file);
@@ -864,11 +864,11 @@ get_recipient_list (const gchar *str)
return g_list_reverse (list);
}
-static TrackerModuleMetadata *
+static TrackerSparqlBuilder *
get_message_metadata (TrackerModuleFile *file)
{
TrackerEvolutionImapFile *self;
- TrackerModuleMetadata *metadata = NULL;
+ TrackerSparqlBuilder *sparql = NULL;
gchar *subject, *from, *to, *cc, *uri;
gint32 i, count, flags;
time_t t;
@@ -911,26 +911,27 @@ get_message_metadata (TrackerModuleFile *file)
if (!deleted && subject && from) {
uri = tracker_module_file_get_uri (file);
- metadata = tracker_module_metadata_new ();
+ sparql = tracker_sparql_builder_new_update ();
+ tracker_sparql_builder_insert_open (sparql);
- tracker_sparql_builder_subject_iri (metadata->sparql, uri);
- tracker_sparql_builder_predicate (metadata->sparql, "a");
- tracker_sparql_builder_object (metadata->sparql, "nmo:Email");
+ tracker_sparql_builder_subject_iri (sparql, uri);
+ tracker_sparql_builder_predicate (sparql, "a");
+ tracker_sparql_builder_object (sparql, "nmo:Email");
- tracker_sparql_builder_predicate (metadata->sparql, "nmo:sentDate");
- tracker_sparql_builder_object_date (metadata->sparql, &t);
+ tracker_sparql_builder_predicate (sparql, "nmo:sentDate");
+ tracker_sparql_builder_object_date (sparql, &t);
- tracker_sparql_builder_predicate (metadata->sparql, "nmo:sender");
- tracker_sparql_builder_object_string (metadata->sparql, from);
+ tracker_sparql_builder_predicate (sparql, "nmo:sender");
+ tracker_sparql_builder_object_string (sparql, from);
- tracker_sparql_builder_predicate (metadata->sparql, "nmo:messageSubject");
- tracker_sparql_builder_object_string (metadata->sparql, subject);
+ tracker_sparql_builder_predicate (sparql, "nmo:messageSubject");
+ tracker_sparql_builder_object_string (sparql, subject);
list = get_recipient_list (to);
for (l = list; l; l = l->next) {
- tracker_sparql_builder_predicate (metadata->sparql, "nmo:to");
- tracker_sparql_builder_object_string (metadata->sparql, l->data);
+ tracker_sparql_builder_predicate (sparql, "nmo:to");
+ tracker_sparql_builder_object_string (sparql, l->data);
g_free (l->data);
}
@@ -939,8 +940,8 @@ get_message_metadata (TrackerModuleFile *file)
list = get_recipient_list (cc);
for (l = list; l; l = l->next) {
- tracker_sparql_builder_predicate (metadata->sparql, "nmo:cc");
- tracker_sparql_builder_object_string (metadata->sparql, l->data);
+ tracker_sparql_builder_predicate (sparql, "nmo:cc");
+ tracker_sparql_builder_object_string (sparql, l->data);
g_free (l->data);
}
@@ -1012,22 +1013,22 @@ get_message_metadata (TrackerModuleFile *file)
skip_content_info (self->summary);
- return metadata;
+ return sparql;
corruption:
/* assume corruption */
- if (metadata) {
- g_object_unref (metadata);
+ if (sparql) {
+ g_object_unref (sparql);
}
return NULL;
}
-static TrackerModuleMetadata *
+static TrackerSparqlBuilder *
get_attachment_metadata (TrackerModuleFile *file,
const gchar *mime_file)
{
- TrackerModuleMetadata *metadata;
+ TrackerSparqlBuilder *sparql;
GMimeStream *stream;
GMimeDataWrapper *wrapper;
GMimePartEncodingType encoding;
@@ -1056,7 +1057,8 @@ get_attachment_metadata (TrackerModuleFile *file,
tmp = tracker_module_file_get_uri (file);
- metadata = tracker_module_metadata_new ();
+ sparql = tracker_sparql_builder_new_update ();
+ tracker_sparql_builder_insert_open (sparql);
/* TODO: we should add 1.1, 1.2, 1.3 as mime-spec per attachment to the
* URI. Else we don't have a valid URI. Also note that Evolution just
@@ -1065,11 +1067,11 @@ get_attachment_metadata (TrackerModuleFile *file,
* Evolution opening the specific attachment anyway */
uri = g_strdup_printf ("%s#%s", tmp, mime_file);
- tracker_sparql_builder_subject_iri (metadata->sparql, uri);
- tracker_sparql_builder_predicate (metadata->sparql, "a");
- tracker_sparql_builder_object (metadata->sparql, "nmo:Attachment");
+ tracker_sparql_builder_subject_iri (sparql, uri);
+ tracker_sparql_builder_predicate (sparql, "a");
+ tracker_sparql_builder_object (sparql, "nmo:Attachment");
- evolution_common_get_wrapper_metadata (wrapper, metadata, uri);
+ evolution_common_get_wrapper_metadata (wrapper, sparql, uri);
g_free (uri);
g_free (tmp);
@@ -1079,10 +1081,10 @@ get_attachment_metadata (TrackerModuleFile *file,
g_free (name);
g_free (path);
- return metadata;
+ return sparql;
}
-static TrackerModuleMetadata *
+static TrackerSparqlBuilder *
tracker_evolution_imap_file_get_metadata (TrackerModuleFile *file)
{
TrackerEvolutionImapFile *self;
diff --git a/src/tracker-indexer/modules/evolution-pop.c b/src/tracker-indexer/modules/evolution-pop.c
index 549cb9c..d13f94b 100644
--- a/src/tracker-indexer/modules/evolution-pop.c
+++ b/src/tracker-indexer/modules/evolution-pop.c
@@ -52,7 +52,7 @@ static void tracker_evolution_pop_file_finalize (GObject *objec
static void tracker_evolution_pop_file_initialize (TrackerModuleFile *file);
static gchar * tracker_evolution_pop_file_get_uri (TrackerModuleFile *file);
static gchar * tracker_evolution_pop_file_get_text (TrackerModuleFile *file);
-static TrackerModuleMetadata *
+static TrackerSparqlBuilder *
tracker_evolution_pop_file_get_metadata (TrackerModuleFile *file);
static TrackerModuleFlags
tracker_evolution_pop_file_get_flags (TrackerModuleFile *file);
@@ -327,37 +327,38 @@ get_message_recipients (GMimeMessage *message,
return g_list_reverse (list);
}
-static TrackerModuleMetadata *
+static TrackerSparqlBuilder *
get_message_metadata (TrackerModuleFile *file, GMimeMessage *message)
{
- TrackerModuleMetadata *metadata;
+ TrackerSparqlBuilder *sparql;
time_t t;
GList *list, *l;
gchar *uri;
uri = tracker_module_file_get_uri (file);
- metadata = tracker_module_metadata_new ();
+ sparql = tracker_sparql_builder_new_update ();
+ tracker_sparql_builder_insert_open (sparql);
- tracker_sparql_builder_subject_iri (metadata->sparql, uri);
- tracker_sparql_builder_predicate (metadata->sparql, "a");
- tracker_sparql_builder_object (metadata->sparql, "nmo:Email");
+ tracker_sparql_builder_subject_iri (sparql, uri);
+ tracker_sparql_builder_predicate (sparql, "a");
+ tracker_sparql_builder_object (sparql, "nmo:Email");
g_mime_message_get_date (message, &t, NULL);
- tracker_sparql_builder_predicate (metadata->sparql, "nmo:sentDate");
- tracker_sparql_builder_object_date (metadata->sparql, &t);
+ tracker_sparql_builder_predicate (sparql, "nmo:sentDate");
+ tracker_sparql_builder_object_date (sparql, &t);
- tracker_sparql_builder_predicate (metadata->sparql, "nmo:sender");
- tracker_sparql_builder_object_string (metadata->sparql, g_mime_message_get_sender (message));
+ tracker_sparql_builder_predicate (sparql, "nmo:sender");
+ tracker_sparql_builder_object_string (sparql, g_mime_message_get_sender (message));
- tracker_sparql_builder_predicate (metadata->sparql, "nmo:messageSubject");
- tracker_sparql_builder_object_string (metadata->sparql, g_mime_message_get_subject (message));
+ tracker_sparql_builder_predicate (sparql, "nmo:messageSubject");
+ tracker_sparql_builder_object_string (sparql, g_mime_message_get_subject (message));
list = get_message_recipients (message, GMIME_RECIPIENT_TYPE_TO);
for (l = list; l; l = l->next) {
- tracker_sparql_builder_predicate (metadata->sparql, "nmo:to");
- tracker_sparql_builder_object_string (metadata->sparql, l->data);
+ tracker_sparql_builder_predicate (sparql, "nmo:to");
+ tracker_sparql_builder_object_string (sparql, l->data);
g_free (l->data);
}
@@ -366,8 +367,8 @@ get_message_metadata (TrackerModuleFile *file, GMimeMessage *message)
list = get_message_recipients (message, GMIME_RECIPIENT_TYPE_CC);
for (l = list; l; l = l->next) {
- tracker_sparql_builder_predicate (metadata->sparql, "nmo:cc");
- tracker_sparql_builder_object_string (metadata->sparql, l->data);
+ tracker_sparql_builder_predicate (sparql, "nmo:cc");
+ tracker_sparql_builder_object_string (sparql, l->data);
g_free (l->data);
}
@@ -375,13 +376,13 @@ get_message_metadata (TrackerModuleFile *file, GMimeMessage *message)
g_free (uri);
- return metadata;
+ return sparql;
}
-static TrackerModuleMetadata *
+static TrackerSparqlBuilder *
get_attachment_metadata (TrackerModuleFile *file, GMimePart *part)
{
- TrackerModuleMetadata *metadata;
+ TrackerSparqlBuilder *sparql;
GMimeDataWrapper *content;
gchar *tmp, *uri;
@@ -391,7 +392,8 @@ get_attachment_metadata (TrackerModuleFile *file, GMimePart *part)
return NULL;
}
- metadata = tracker_module_metadata_new ();
+ sparql = tracker_sparql_builder_new_update ();
+ tracker_sparql_builder_insert_open (sparql);
tmp = tracker_module_file_get_uri (file);
@@ -402,25 +404,25 @@ get_attachment_metadata (TrackerModuleFile *file, GMimePart *part)
* Evolution opening the specific attachment anyway */
uri = g_strdup_printf ("%s#%s", tmp, g_mime_part_get_content_id (part));
- tracker_sparql_builder_subject_iri (metadata->sparql, uri);
- tracker_sparql_builder_predicate (metadata->sparql, "a");
- tracker_sparql_builder_object (metadata->sparql, "nmo:Attachment");
+ tracker_sparql_builder_subject_iri (sparql, uri);
+ tracker_sparql_builder_predicate (sparql, "a");
+ tracker_sparql_builder_object (sparql, "nmo:Attachment");
- evolution_common_get_wrapper_metadata (content, metadata, uri);
+ evolution_common_get_wrapper_metadata (content, sparql, uri);
g_free (uri);
g_free (tmp);
g_object_unref (content);
- return metadata;
+ return sparql;
}
-static TrackerModuleMetadata *
+static TrackerSparqlBuilder *
tracker_evolution_pop_file_get_metadata (TrackerModuleFile *file)
{
TrackerEvolutionPopFile *self;
- TrackerModuleMetadata *metadata;
+ TrackerSparqlBuilder *sparql;
guint flags;
self = TRACKER_EVOLUTION_POP_FILE (file);
@@ -438,12 +440,12 @@ tracker_evolution_pop_file_get_metadata (TrackerModuleFile *file)
if (self->current_mime_part) {
- metadata = get_attachment_metadata (file, self->current_mime_part->data);
+ sparql = get_attachment_metadata (file, self->current_mime_part->data);
} else {
- metadata = get_message_metadata (file, self->message);
+ sparql = get_message_metadata (file, self->message);
}
- return metadata;
+ return sparql;
}
static TrackerModuleFlags
diff --git a/src/tracker-indexer/modules/files.c b/src/tracker-indexer/modules/files.c
index 47d348a..9d1a9a1 100644
--- a/src/tracker-indexer/modules/files.c
+++ b/src/tracker-indexer/modules/files.c
@@ -58,7 +58,7 @@ struct TrackerRegularFileClass {
static GType tracker_regular_file_get_type (void) G_GNUC_CONST;
static gchar * tracker_regular_file_get_text (TrackerModuleFile *file);
-static TrackerModuleMetadata * tracker_regular_file_get_metadata (TrackerModuleFile *file);
+static TrackerSparqlBuilder * tracker_regular_file_get_metadata (TrackerModuleFile *file);
static void tracker_regular_file_cancel (TrackerModuleFile *file);
@@ -156,10 +156,10 @@ check_exclude_file (const gchar *path)
#endif /* ENABLE_FILE_EXCLUDE_CHECKING */
-static TrackerModuleMetadata *
+static TrackerSparqlBuilder *
tracker_regular_file_get_metadata (TrackerModuleFile *file)
{
- TrackerModuleMetadata *metadata;
+ TrackerSparqlBuilder *sparql;
#ifdef ENABLE_FILE_EXCLUDE_CHECKING
if (check_exclude_file (file->path)) {
@@ -167,14 +167,15 @@ tracker_regular_file_get_metadata (TrackerModuleFile *file)
}
#endif
- metadata = tracker_module_metadata_new ();
+ sparql = tracker_sparql_builder_new_update ();
+ tracker_sparql_builder_insert_open (sparql);
- if (!tracker_module_metadata_utils_get_data (tracker_module_file_get_file (file), metadata)) {
- g_object_unref (metadata);
- metadata = NULL;
+ if (!tracker_module_metadata_utils_get_data (tracker_module_file_get_file (file), sparql)) {
+ g_object_unref (sparql);
+ sparql = NULL;
}
- return metadata;
+ return sparql;
}
static gchar *
diff --git a/src/tracker-indexer/modules/gaim-conversations.c b/src/tracker-indexer/modules/gaim-conversations.c
index 613ef89..2f2d697 100644
--- a/src/tracker-indexer/modules/gaim-conversations.c
+++ b/src/tracker-indexer/modules/gaim-conversations.c
@@ -61,7 +61,7 @@ struct GaimFileClass {
static GType gaim_file_get_type (void) G_GNUC_CONST;
static gchar * gaim_file_get_text (TrackerModuleFile *file);
-static TrackerModuleMetadata *
+static TrackerSparqlBuilder *
gaim_file_get_metadata (TrackerModuleFile *file);
@@ -92,10 +92,10 @@ gaim_file_get_text (TrackerModuleFile *file)
return tracker_module_metadata_utils_get_text (tracker_module_file_get_file (file));
}
-static TrackerModuleMetadata *
+static TrackerSparqlBuilder *
gaim_file_get_metadata (TrackerModuleFile *file)
{
- TrackerModuleMetadata *metadata;
+ TrackerSparqlBuilder *sparql;
GFile *f;
gchar *path, *uri;
gchar **path_decomposed;
@@ -119,7 +119,8 @@ gaim_file_get_metadata (TrackerModuleFile *file)
/* Port to SparqlBuilder
- metadata = tracker_module_metadata_new ();
+ sparql = tracker_sparql_builder_new_update ();
+ tracker_sparql_builder_insert_open (sparql);
tracker_module_metadata_add_string (metadata, uri, METADATA_CONVERSATION_USER_ACCOUNT, path_decomposed [len - 3]);
tracker_module_metadata_add_string (metadata, uri, METADATA_CONVERSATION_PEER_ACCOUNT, path_decomposed [len - 2]);
diff --git a/src/tracker-indexer/tracker-indexer.c b/src/tracker-indexer/tracker-indexer.c
index 14a03f9..ff98ad2 100644
--- a/src/tracker-indexer/tracker-indexer.c
+++ b/src/tracker-indexer/tracker-indexer.c
@@ -79,7 +79,6 @@
#include "tracker-indexer.h"
#include "tracker-indexer-module.h"
#include "tracker-marshal.h"
-#include "tracker-module-metadata-private.h"
#include "tracker-processor.h"
#include "tracker-removable-device.h"
@@ -1069,7 +1068,7 @@ static void
item_add_to_datasource (TrackerIndexer *indexer,
const gchar *uri,
TrackerModuleFile *module_file,
- TrackerModuleMetadata *metadata)
+ TrackerSparqlBuilder *sparql)
{
GFile *file;
const gchar *removable_device_udi;
@@ -1089,21 +1088,21 @@ item_add_to_datasource (TrackerIndexer *indexer,
removable_device_urn = g_strdup_printf (TRACKER_DATASOURCE_URN_PREFIX "%s",
removable_device_udi);
- tracker_sparql_builder_subject_iri (metadata->sparql, removable_device_urn);
- tracker_sparql_builder_predicate (metadata->sparql, "a");
- tracker_sparql_builder_object (metadata->sparql, "tracker:Volume");
+ tracker_sparql_builder_subject_iri (sparql, removable_device_urn);
+ tracker_sparql_builder_predicate (sparql, "a");
+ tracker_sparql_builder_object (sparql, "tracker:Volume");
- tracker_sparql_builder_predicate (metadata->sparql, "nie:dataSource");
- tracker_sparql_builder_object_iri (metadata->sparql, removable_device_urn);
+ tracker_sparql_builder_predicate (sparql, "nie:dataSource");
+ tracker_sparql_builder_object_iri (sparql, removable_device_urn);
g_free (removable_device_urn);
} else {
- tracker_sparql_builder_subject_iri (metadata->sparql, TRACKER_NON_REMOVABLE_MEDIA_DATASOURCE_URN);
- tracker_sparql_builder_predicate (metadata->sparql, "a");
- tracker_sparql_builder_object (metadata->sparql, "tracker:Volume");
+ tracker_sparql_builder_subject_iri (sparql, TRACKER_NON_REMOVABLE_MEDIA_DATASOURCE_URN);
+ tracker_sparql_builder_predicate (sparql, "a");
+ tracker_sparql_builder_object (sparql, "tracker:Volume");
- tracker_sparql_builder_predicate (metadata->sparql, "nie:dataSource");
- tracker_sparql_builder_object_iri (metadata->sparql, TRACKER_NON_REMOVABLE_MEDIA_DATASOURCE_URN);
+ tracker_sparql_builder_predicate (sparql, "nie:dataSource");
+ tracker_sparql_builder_object_iri (sparql, TRACKER_NON_REMOVABLE_MEDIA_DATASOURCE_URN);
}
}
@@ -1111,10 +1110,9 @@ static void
item_add_or_update (TrackerIndexer *indexer,
PathInfo *info,
const gchar *uri,
- TrackerModuleMetadata *metadata)
+ TrackerSparqlBuilder *sparql)
{
gchar *mount_point = NULL;
- gchar *sparql;
if (G_UNLIKELY (!indexer->private->in_transaction)) {
start_transaction (indexer);
@@ -1144,10 +1142,10 @@ item_add_or_update (TrackerIndexer *indexer,
* 3) Save the remain new metadata.
*/
- sparql = tracker_module_metadata_get_sparql (metadata);
+ tracker_sparql_builder_insert_close (sparql);
+
full_sparql = g_strdup_printf ("DROP GRAPH <%s> %s",
- uri, sparql);
- g_free (sparql);
+ uri, tracker_sparql_builder_get_result (sparql));
tracker_resources_batch_sparql_update (indexer->private->client, full_sparql, NULL);
g_free (full_sparql);
@@ -1159,11 +1157,13 @@ item_add_or_update (TrackerIndexer *indexer,
/* Service wasn't previously indexed */
- item_add_to_datasource (indexer, uri, info->module_file, metadata);
+ item_add_to_datasource (indexer, uri, info->module_file, sparql);
+
+ tracker_sparql_builder_insert_close (sparql);
- sparql = tracker_module_metadata_get_sparql (metadata);
- tracker_resources_batch_sparql_update (indexer->private->client, sparql, NULL);
- g_free (sparql);
+ tracker_resources_batch_sparql_update (indexer->private->client,
+ tracker_sparql_builder_get_result (sparql),
+ NULL);
schedule_flush (indexer, FALSE);
}
@@ -1179,7 +1179,7 @@ item_add_or_update (TrackerIndexer *indexer,
tracker_removable_device_add_metadata (indexer,
mount_point,
uri,
- metadata);
+ sparql);
}
#endif
g_free (mount_point);
@@ -1383,40 +1383,40 @@ item_process (TrackerIndexer *indexer,
PathInfo *info,
const gchar *uri)
{
- TrackerModuleMetadata *metadata;
+ TrackerSparqlBuilder *sparql;
gchar *text;
- metadata = tracker_module_file_get_metadata (info->module_file);
+ sparql = tracker_module_file_get_metadata (info->module_file);
if (tracker_module_file_is_cancelled (info->module_file)) {
- if (metadata) {
- g_object_unref (metadata);
+ if (sparql) {
+ g_object_unref (sparql);
}
return FALSE;
}
- if (metadata) {
+ if (sparql) {
text = tracker_module_file_get_text (info->module_file);
if (tracker_module_file_is_cancelled (info->module_file)) {
- g_object_unref (metadata);
+ g_object_unref (sparql);
g_free (text);
return FALSE;
}
if (text) {
- tracker_sparql_builder_subject_iri (metadata->sparql, uri);
- tracker_sparql_builder_predicate (metadata->sparql, "nie:plainTextContent");
- tracker_sparql_builder_object_string (metadata->sparql, text);
+ tracker_sparql_builder_subject_iri (sparql, uri);
+ tracker_sparql_builder_predicate (sparql, "nie:plainTextContent");
+ tracker_sparql_builder_object_string (sparql, text);
g_free (text);
}
- item_add_or_update (indexer, info, uri, metadata);
+ item_add_or_update (indexer, info, uri, sparql);
- g_object_unref (metadata);
+ g_object_unref (sparql);
} else {
item_remove (indexer, info, uri);
}
diff --git a/src/tracker-indexer/tracker-module-file.c b/src/tracker-indexer/tracker-module-file.c
index 1f4b833..ee074cf 100644
--- a/src/tracker-indexer/tracker-module-file.c
+++ b/src/tracker-indexer/tracker-module-file.c
@@ -18,7 +18,6 @@
*/
#include <libtracker-common/tracker-file-utils.h>
-#include "tracker-module-metadata-private.h"
#include "tracker-module-file.h"
#define TRACKER_MODULE_FILE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TRACKER_TYPE_MODULE_FILE, TrackerModuleFilePrivate))
@@ -249,16 +248,16 @@ tracker_module_file_get_text (TrackerModuleFile *file)
* Returns: A newly created #TrackerModuleMetadata containing all
* the extracted metadata, or %NULL.
**/
-TrackerModuleMetadata *
+TrackerSparqlBuilder *
tracker_module_file_get_metadata (TrackerModuleFile *file)
{
- TrackerModuleMetadata *metadata = NULL;
+ TrackerSparqlBuilder *sparql = NULL;
if (TRACKER_MODULE_FILE_GET_CLASS (file)->get_metadata != NULL) {
- metadata = TRACKER_MODULE_FILE_GET_CLASS (file)->get_metadata (file);
+ sparql = TRACKER_MODULE_FILE_GET_CLASS (file)->get_metadata (file);
}
- return metadata;
+ return sparql;
}
/**
diff --git a/src/tracker-indexer/tracker-module-file.h b/src/tracker-indexer/tracker-module-file.h
index 8e018ec..4cdd0d3 100644
--- a/src/tracker-indexer/tracker-module-file.h
+++ b/src/tracker-indexer/tracker-module-file.h
@@ -22,7 +22,7 @@
#include <glib-object.h>
#include <gio/gio.h>
-#include "tracker-module-metadata.h"
+#include <libtracker-common/tracker-sparql-builder.h>
G_BEGIN_DECLS
@@ -57,7 +57,7 @@ struct TrackerModuleFileClass {
void (* initialize) (TrackerModuleFile *file);
gchar * (* get_uri) (TrackerModuleFile *file);
gchar * (* get_text) (TrackerModuleFile *file);
- TrackerModuleMetadata * (* get_metadata) (TrackerModuleFile *file);
+ TrackerSparqlBuilder * (* get_metadata) (TrackerModuleFile *file);
TrackerModuleFlags (* get_flags) (TrackerModuleFile *file);
void (* cancel) (TrackerModuleFile *file);
};
@@ -69,7 +69,7 @@ GFile * tracker_module_file_get_file (TrackerModuleFile
G_CONST_RETURN gchar * tracker_module_file_get_service_type (TrackerModuleFile *file);
gchar * tracker_module_file_get_uri (TrackerModuleFile *file);
gchar * tracker_module_file_get_text (TrackerModuleFile *file);
-TrackerModuleMetadata * tracker_module_file_get_metadata (TrackerModuleFile *file);
+TrackerSparqlBuilder * tracker_module_file_get_metadata (TrackerModuleFile *file);
TrackerModuleFlags tracker_module_file_get_flags (TrackerModuleFile *file);
void tracker_module_file_cancel (TrackerModuleFile *file);
diff --git a/src/tracker-indexer/tracker-module-metadata-utils.c b/src/tracker-indexer/tracker-module-metadata-utils.c
index 8c1b33e..7510f5c 100644
--- a/src/tracker-indexer/tracker-module-metadata-utils.c
+++ b/src/tracker-indexer/tracker-module-metadata-utils.c
@@ -76,7 +76,7 @@ typedef struct {
} ProcessContext;
typedef struct {
- TrackerModuleMetadata *metadata;
+ TrackerSparqlBuilder *metadata;
GMainLoop *main_loop;
GPid pid;
} ExtractorContext;
@@ -268,7 +268,7 @@ process_context_create (const gchar **argv,
}
static ExtractorContext *
-extractor_context_create (TrackerModuleMetadata *metadata)
+extractor_context_create (TrackerSparqlBuilder *sparql)
{
ExtractorContext *context;
@@ -279,7 +279,7 @@ extractor_context_create (TrackerModuleMetadata *metadata)
context = g_slice_new0 (ExtractorContext);
context->main_loop = g_main_loop_new (NULL, FALSE);
- context->metadata = g_object_ref (metadata);
+ context->metadata = g_object_ref (sparql);
context->pid = extractor_pid;
return context;
@@ -365,9 +365,9 @@ get_metadata_async_cb (DBusGProxy *proxy,
predicate = g_value_get_string (&statement->values[1]);
object = g_value_get_string (&statement->values[2]);
- tracker_sparql_builder_subject_iri (context->metadata->sparql, subject);
- tracker_sparql_builder_predicate_iri (context->metadata->sparql, predicate);
- tracker_sparql_builder_object_string (context->metadata->sparql, object);
+ tracker_sparql_builder_subject_iri (context->metadata, subject);
+ tracker_sparql_builder_predicate_iri (context->metadata, predicate);
+ tracker_sparql_builder_object_string (context->metadata, object);
g_value_array_free (statement);
}
@@ -381,12 +381,12 @@ get_metadata_async_cb (DBusGProxy *proxy,
static void
metadata_utils_get_embedded (GFile *file,
const char *mime_type,
- TrackerModuleMetadata *metadata)
+ TrackerSparqlBuilder *sparql)
{
ExtractorContext *context;
gchar *uri;
- context = extractor_context_create (metadata);
+ context = extractor_context_create (sparql);
if (!context) {
return;
@@ -778,7 +778,7 @@ tracker_module_metadata_utils_get_text (GFile *file)
**/
gboolean
-tracker_module_metadata_utils_get_data (GFile *file, TrackerModuleMetadata *metadata)
+tracker_module_metadata_utils_get_data (GFile *file, TrackerSparqlBuilder *sparql)
{
gchar *mime_type, *uri;
GFileInfo *file_info;
@@ -795,40 +795,40 @@ tracker_module_metadata_utils_get_data (GFile *file, TrackerModuleMetadata *meta
mime_type = tracker_file_get_mime_type (file);
- tracker_sparql_builder_subject_iri (metadata->sparql, uri);
- tracker_sparql_builder_predicate (metadata->sparql, "a");
- tracker_sparql_builder_object (metadata->sparql, "nfo:FileDataObject");
+ tracker_sparql_builder_subject_iri (sparql, uri);
+ tracker_sparql_builder_predicate (sparql, "a");
+ tracker_sparql_builder_object (sparql, "nfo:FileDataObject");
if (g_file_info_get_file_type (file_info) == G_FILE_TYPE_DIRECTORY) {
- tracker_sparql_builder_object (metadata->sparql, "nfo:Folder");
+ tracker_sparql_builder_object (sparql, "nfo:Folder");
}
parent = g_file_get_parent (file);
if (parent) {
parent_uri = g_file_get_uri (parent);
- tracker_sparql_builder_predicate (metadata->sparql, "nfo:belongsToContainer");
- tracker_sparql_builder_object_iri (metadata->sparql, parent_uri);
+ tracker_sparql_builder_predicate (sparql, "nfo:belongsToContainer");
+ tracker_sparql_builder_object_iri (sparql, parent_uri);
g_free (parent_uri);
g_object_unref (parent);
}
- tracker_sparql_builder_predicate (metadata->sparql, "nfo:fileName");
- tracker_sparql_builder_object_string (metadata->sparql, g_file_info_get_display_name (file_info));
+ tracker_sparql_builder_predicate (sparql, "nfo:fileName");
+ tracker_sparql_builder_object_string (sparql, g_file_info_get_display_name (file_info));
- tracker_sparql_builder_predicate (metadata->sparql, "nie:mimeType");
- tracker_sparql_builder_object_string (metadata->sparql, mime_type);
+ tracker_sparql_builder_predicate (sparql, "nie:mimeType");
+ tracker_sparql_builder_object_string (sparql, mime_type);
- tracker_sparql_builder_predicate (metadata->sparql, "nfo:fileSize");
- tracker_sparql_builder_object_int64 (metadata->sparql, g_file_info_get_size (file_info));
+ tracker_sparql_builder_predicate (sparql, "nfo:fileSize");
+ tracker_sparql_builder_object_int64 (sparql, g_file_info_get_size (file_info));
time_ = g_file_info_get_attribute_uint64 (file_info, G_FILE_ATTRIBUTE_TIME_MODIFIED);
- tracker_sparql_builder_predicate (metadata->sparql, "nfo:fileLastModified");
- tracker_sparql_builder_object_date (metadata->sparql, &time_);
+ tracker_sparql_builder_predicate (sparql, "nfo:fileLastModified");
+ tracker_sparql_builder_object_date (sparql, &time_);
time_ = g_file_info_get_attribute_uint64 (file_info, G_FILE_ATTRIBUTE_TIME_ACCESS);
- tracker_sparql_builder_predicate (metadata->sparql, "nfo:fileLastAccessed");
- tracker_sparql_builder_object_date (metadata->sparql, &time_);
+ tracker_sparql_builder_predicate (sparql, "nfo:fileLastAccessed");
+ tracker_sparql_builder_object_date (sparql, &time_);
- metadata_utils_get_embedded (file, mime_type, metadata);
+ metadata_utils_get_embedded (file, mime_type, sparql);
g_free (mime_type);
g_free (uri);
diff --git a/src/tracker-indexer/tracker-module-metadata-utils.h b/src/tracker-indexer/tracker-module-metadata-utils.h
index 8375948..b6d1e91 100644
--- a/src/tracker-indexer/tracker-module-metadata-utils.h
+++ b/src/tracker-indexer/tracker-module-metadata-utils.h
@@ -22,7 +22,8 @@
#ifndef __TRACKER_METADATA_UTILS_H__
#define __TRACKER_METADATA_UTILS_H__
-#include "tracker-module-metadata.h"
+#include <libtracker-common/tracker-sparql-builder.h>
+
#include "tracker-module-file.h"
G_BEGIN_DECLS
@@ -33,7 +34,7 @@ G_BEGIN_DECLS
gboolean tracker_module_metadata_utils_get_data (GFile *file,
- TrackerModuleMetadata *metadata);
+ TrackerSparqlBuilder *metadata);
gchar * tracker_module_metadata_utils_get_text (GFile *file);
void tracker_module_metadata_utils_cancel (GFile *file);
diff --git a/src/tracker-indexer/tracker-module.h b/src/tracker-indexer/tracker-module.h
index 5ffce6d..9cb8c40 100644
--- a/src/tracker-indexer/tracker-module.h
+++ b/src/tracker-indexer/tracker-module.h
@@ -31,7 +31,6 @@ G_BEGIN_DECLS
#include "tracker-module-file.h"
#include "tracker-module-iteratable.h"
-#include "tracker-module-metadata.h"
#include "tracker-module-metadata-utils.h"
void indexer_module_initialize (GTypeModule *module);
diff --git a/src/tracker-indexer/tracker-removable-device.c b/src/tracker-indexer/tracker-removable-device.c
index bcd4b55..96fa327 100644
--- a/src/tracker-indexer/tracker-removable-device.c
+++ b/src/tracker-indexer/tracker-removable-device.c
@@ -41,8 +41,6 @@
#include "tracker-removable-device.h"
-#include "tracker-module-metadata-private.h"
-
typedef struct {
gchar *last_subject;
gchar *base;
@@ -320,7 +318,7 @@ void
tracker_removable_device_add_metadata (TrackerIndexer *indexer,
const gchar *mount_point,
const gchar *uri,
- TrackerModuleMetadata *metadata)
+ TrackerSparqlBuilder *sparql)
{
g_return_if_fail (TRACKER_IS_INDEXER (indexer));
g_return_if_fail (mount_point != NULL);
diff --git a/src/tracker-indexer/tracker-removable-device.h b/src/tracker-indexer/tracker-removable-device.h
index dc86bd4..2a9f635 100644
--- a/src/tracker-indexer/tracker-removable-device.h
+++ b/src/tracker-indexer/tracker-removable-device.h
@@ -23,7 +23,6 @@
#ifndef __TRACKER_REMOVABLE_DEVICE_H__
#define __TRACKER_REMOVABLE_DEVICE_H__
-#include "tracker-module-metadata.h"
#include "tracker-indexer.h"
G_BEGIN_DECLS
@@ -31,7 +30,7 @@ G_BEGIN_DECLS
void tracker_removable_device_add_metadata (TrackerIndexer *indexer,
const gchar *mount_point,
const gchar *uri,
- TrackerModuleMetadata *metadata);
+ TrackerSparqlBuilder *sparql);
void tracker_removable_device_add_removal (TrackerIndexer *indexer,
const gchar *mount_point,
const gchar *uri);
diff --git a/tests/tracker-indexer/Makefile.am b/tests/tracker-indexer/Makefile.am
index 5525a24..e531a4d 100644
--- a/tests/tracker-indexer/Makefile.am
+++ b/tests/tracker-indexer/Makefile.am
@@ -36,8 +36,6 @@ tracker_metadata_utils_SOURCES = \
$(top_srcdir)/src/tracker-indexer/tracker-indexer.c \
$(top_srcdir)/src/tracker-indexer/tracker-indexer-module.c \
$(top_srcdir)/src/tracker-indexer/tracker-marshal-main.c \
- $(top_srcdir)/src/tracker-indexer/tracker-module-metadata.c \
- $(top_srcdir)/src/tracker-indexer/tracker-module-metadata.h \
$(top_srcdir)/src/tracker-indexer/tracker-module-metadata-utils.c \
$(top_srcdir)/src/tracker-indexer/tracker-module-file.c \
$(top_srcdir)/src/tracker-indexer/tracker-module-iteratable.c \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]