[tracker] Fixed trailing empty INSERT {\n} for file resources
- From: Philip Van Hoof <pvanhoof src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [tracker] Fixed trailing empty INSERT {\n} for file resources
- Date: Wed, 9 Sep 2009 08:51:58 +0000 (UTC)
commit bebb73b35ee1028219ceae344a42306608f62933
Author: Philip Van Hoof <philip codeminded be>
Date: Wed Sep 9 10:50:04 2009 +0200
Fixed trailing empty INSERT {\n} for file resources
src/libtracker-miner/tracker-miner-fs.c | 2 --
src/tracker-extract/tracker-extract.c | 6 +++++-
src/tracker-miner-fs/tracker-miner-applications.c | 2 ++
src/tracker-miner-fs/tracker-miner-files.c | 1 -
4 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
index 0d4b49a..e9295c6 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -504,8 +504,6 @@ item_add_or_update_cb (TrackerMinerFS *fs,
g_debug ("Adding item '%s'", uri);
- tracker_sparql_builder_insert_close (sparql);
-
full_sparql = g_strdup_printf ("DROP GRAPH <%s> %s",
uri, tracker_sparql_builder_get_result (sparql));
diff --git a/src/tracker-extract/tracker-extract.c b/src/tracker-extract/tracker-extract.c
index 22aba44..9a5ba84 100644
--- a/src/tracker-extract/tracker-extract.c
+++ b/src/tracker-extract/tracker-extract.c
@@ -458,7 +458,11 @@ tracker_extract_get_metadata (TrackerExtract *object,
sparql = get_file_metadata (object, request_id, uri, mime);
if (sparql) {
- dbus_g_method_return (context, tracker_sparql_builder_get_result (sparql));
+ if (tracker_sparql_builder_get_length (sparql) > 0) {
+ dbus_g_method_return (context, tracker_sparql_builder_get_result (sparql));
+ } else {
+ dbus_g_method_return (context, "");
+ }
g_object_unref (sparql);
tracker_dbus_request_success (request_id);
} else {
diff --git a/src/tracker-miner-fs/tracker-miner-applications.c b/src/tracker-miner-fs/tracker-miner-applications.c
index 52af8b6..da77fa7 100644
--- a/src/tracker-miner-fs/tracker-miner-applications.c
+++ b/src/tracker-miner-fs/tracker-miner-applications.c
@@ -414,6 +414,8 @@ miner_applications_process_file_cb (gpointer user_data)
g_object_unref (file_info);
}
+ tracker_sparql_builder_insert_close (sparql);
+
/* Notify about success */
data->callback (data->miner, data->file, sparql, NULL, data->callback_data);
diff --git a/src/tracker-miner-fs/tracker-miner-files.c b/src/tracker-miner-fs/tracker-miner-files.c
index 36527ec..7197e46 100644
--- a/src/tracker-miner-fs/tracker-miner-files.c
+++ b/src/tracker-miner-fs/tracker-miner-files.c
@@ -848,7 +848,6 @@ get_embedded_metadata_cb (DBusGProxy *proxy,
if (sparql) {
tracker_sparql_builder_insert_close (data->sparql);
tracker_sparql_builder_append (data->sparql, sparql);
- tracker_sparql_builder_insert_open (data->sparql);
g_free (sparql);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]