[tracker] libtracker-control: Let miner_manager_index_file accept a GCancellable
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] libtracker-control: Let miner_manager_index_file accept a GCancellable
- Date: Mon, 4 Sep 2017 17:59:51 +0000 (UTC)
commit 9a17961b4ad733b54c93149a2ee6cdc0562c411d
Author: Debarshi Ray <debarshir gnome org>
Date: Mon Sep 4 13:32:17 2017 +0200
libtracker-control: Let miner_manager_index_file accept a GCancellable
The Since tag was bumped because the method's signature has changed.
It is not backwards compatible with the one that was added in 0.10.
https://bugzilla.gnome.org/show_bug.cgi?id=787246
src/libtracker-control/tracker-miner-manager.c | 7 +++++--
src/libtracker-control/tracker-miner-manager.h | 1 +
src/tracker/tracker-index.c | 2 +-
src/tracker/tracker-reset.c | 2 +-
4 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/src/libtracker-control/tracker-miner-manager.c b/src/libtracker-control/tracker-miner-manager.c
index d588985..9a6756b 100644
--- a/src/libtracker-control/tracker-miner-manager.c
+++ b/src/libtracker-control/tracker-miner-manager.c
@@ -1539,6 +1539,7 @@ miner_manager_index_file_thread (GTask *task,
* tracker_miner_manager_index_file:
* @manager: a #TrackerMinerManager
* @file: a URL valid in GIO of a file to give to the miner for processing
+ * @cancellable: (allow-none): a #GCancellable, or %NULL
* @error: (out callee-allocates) (transfer full) (allow-none): return location for errors
*
* Tells the filesystem miner to start indexing the @file.
@@ -1547,18 +1548,20 @@ miner_manager_index_file_thread (GTask *task,
*
* Returns: %TRUE on success, otherwise %FALSE.
*
- * Since: 0.10
+ * Since: 2.0
**/
gboolean
tracker_miner_manager_index_file (TrackerMinerManager *manager,
GFile *file,
+ GCancellable *cancellable,
GError **error)
{
g_return_val_if_fail (TRACKER_IS_MINER_MANAGER (manager), FALSE);
g_return_val_if_fail (G_IS_FILE (file), FALSE);
+ g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
return miner_manager_index_file_sync (manager, METHOD_INDEX_FILE,
- file, NULL, error);
+ file, cancellable, error);
}
/**
diff --git a/src/libtracker-control/tracker-miner-manager.h b/src/libtracker-control/tracker-miner-manager.h
index 38729a9..d0927d2 100644
--- a/src/libtracker-control/tracker-miner-manager.h
+++ b/src/libtracker-control/tracker-miner-manager.h
@@ -133,6 +133,7 @@ gboolean tracker_miner_manager_reindex_by_mimetype (TrackerMinerMana
GError **error);
gboolean tracker_miner_manager_index_file (TrackerMinerManager *manager,
GFile *file,
+ GCancellable *cancellable,
GError **error);
void tracker_miner_manager_index_file_async (TrackerMinerManager *manager,
GFile *file,
diff --git a/src/tracker/tracker-index.c b/src/tracker/tracker-index.c
index 9658652..a759c40 100644
--- a/src/tracker/tracker-index.c
+++ b/src/tracker/tracker-index.c
@@ -162,7 +162,7 @@ index_or_reindex_file (void)
GFile *file;
file = g_file_new_for_commandline_arg (*p);
- tracker_miner_manager_index_file (manager, file, &error);
+ tracker_miner_manager_index_file (manager, file, NULL, &error);
if (error) {
g_printerr ("%s: %s\n",
diff --git a/src/tracker/tracker-reset.c b/src/tracker/tracker-reset.c
index fa7a2ee..2f4ee25 100644
--- a/src/tracker/tracker-reset.c
+++ b/src/tracker/tracker-reset.c
@@ -190,7 +190,7 @@ delete_info_recursively (GFile *file)
/* Request reindexing of this data, it was previously in the store. */
miner_manager = tracker_miner_manager_new_full (FALSE, NULL);
- tracker_miner_manager_index_file (miner_manager, file, &error);
+ tracker_miner_manager_index_file (miner_manager, file, NULL, &error);
g_object_unref (miner_manager);
if (error)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]