summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2017-06-17 20:47:59 +0200
committerCarlos Garnacho <carlosg@gnome.org>2017-06-29 20:49:05 +0200
commit7e3f1f3214f68664c4196dbf11826052ac10ec1e (patch)
treee6693be70f8c0bec46e5992d9cd3f31fdcd7ff60 /examples
parente15c330afb35c4396a79c14988719d5d65e47825 (diff)
downloadtracker-7e3f1f3214f68664c4196dbf11826052ac10ec1e.tar.gz
libtracker-miner: Change API of ::process-file[-attributes]
There's a few changes here: - The 2 vmethods are now given a GTask, its cancellable is to be used if the handling goes async. - tracker_miner_fs_file_notify() has changed into a more generic tracker_miner_fs_notify_finish() method, that takes such GTask and completes it. - The vmethods are no longer given a TrackerSparqlBuilder, instead they are expected to create the SPARQL through whatever mean is most fit. The sparql is given in the tracker_miner_fs_notify_finish() func. This opens the door to TrackerMinerFS implementations using TrackerResource. The intent is 1) Pass something to these vmethods that the user can't forge or mess with, as matching on GFile relies that it's the same pointer that it was given in the vmethods. And 2) Make the finish() function more generic to be fit to other methods going async.
Diffstat (limited to 'examples')
-rw-r--r--examples/libtracker-miner/tracker-main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/libtracker-miner/tracker-main.c b/examples/libtracker-miner/tracker-main.c
index e563b8cfc..451967920 100644
--- a/examples/libtracker-miner/tracker-main.c
+++ b/examples/libtracker-miner/tracker-main.c
@@ -59,6 +59,7 @@ miner_start_cb (gpointer user_data)
static gboolean
process_file_cb (TrackerMinerFS *fs,
GFile *file,
+ GTask *task,
gpointer user_data)
{
gchar *path;
@@ -68,7 +69,7 @@ process_file_cb (TrackerMinerFS *fs,
g_free (path);
/* Notify that processing is complete. */
- tracker_miner_fs_file_notify (fs, file, NULL);
+ tracker_miner_fs_notify_finish (fs, task, "", NULL);
/* Return FALSE here if you ignored the file. */
return TRUE;