[tracker] libtracker-miner: Avoid storing mtime on when querying the iri ad-hoc



commit 4bf562b345ce224590d154d9a6620295b3a27530
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue May 3 00:29:22 2016 +0200

    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 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-file-notifier.c b/src/libtracker-miner/tracker-file-notifier.c
index 69d32b6..d391be0 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;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]