From 4bf562b345ce224590d154d9a6620295b3a27530 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Tue, 3 May 2016 00:29:22 +0200 Subject: [PATCH] libtracker-miner: Avoid storing mtime on when querying the iri ad-hoc Retrieve only the iri from the query, and store it in the TrackerFileSystem, the mtime is unrequested, and even misleading in future operations. --- src/libtracker-miner/tracker-file-notifier.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/libtracker-miner/tracker-file-notifier.c b/src/libtracker-miner/tracker-file-notifier.c index 69d32b6b4..d391be0b0 100644 --- a/src/libtracker-miner/tracker-file-notifier.c +++ b/src/libtracker-miner/tracker-file-notifier.c @@ -1867,6 +1867,7 @@ tracker_file_notifier_get_file_iri (TrackerFileNotifier *notifier, if (!iri && force) { TrackerSparqlCursor *cursor; + const gchar *str; gchar *sparql; /* Fetch data for this file synchronously */ @@ -1875,14 +1876,19 @@ tracker_file_notifier_get_file_iri (TrackerFileNotifier *notifier, sparql, NULL, NULL); g_free (sparql); - if (cursor) { - sparql_files_query_populate (notifier, cursor, FALSE); + if (!cursor) + return NULL; + + if (!tracker_sparql_cursor_next (cursor, NULL, NULL)) { g_object_unref (cursor); + return NULL; } - iri = tracker_file_system_get_property (priv->file_system, - canonical, - quark_property_iri); + str = tracker_sparql_cursor_get_string (cursor, 1, NULL); + iri = g_strdup (str); + tracker_file_system_set_property (priv->file_system, canonical, + quark_property_iri, iri); + g_object_unref (cursor); } return iri; -- GitLab