[tracker/no-mtime-checks-on-start] libtracker-miner: New tracker_miner_is_paused() method
- From: Aleksander Morgado <aleksm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/no-mtime-checks-on-start] libtracker-miner: New tracker_miner_is_paused() method
- Date: Thu, 3 Feb 2011 10:48:58 +0000 (UTC)
commit 8fbc420501b8c11831ce5dbceae3d4fec31def43
Author: Aleksander Morgado <aleksander lanedo com>
Date: Thu Feb 3 11:47:35 2011 +0100
libtracker-miner: New tracker_miner_is_paused() method
.../libtracker-miner/libtracker-miner-sections.txt | 1 +
src/libtracker-miner/tracker-miner-object.c | 18 +++++++++++++++++-
src/libtracker-miner/tracker-miner-object.h | 1 +
3 files changed, 19 insertions(+), 1 deletions(-)
---
diff --git a/docs/reference/libtracker-miner/libtracker-miner-sections.txt b/docs/reference/libtracker-miner/libtracker-miner-sections.txt
index a9987a9..7df3068 100644
--- a/docs/reference/libtracker-miner/libtracker-miner-sections.txt
+++ b/docs/reference/libtracker-miner/libtracker-miner-sections.txt
@@ -42,6 +42,7 @@ tracker_miner_start
tracker_miner_stop
tracker_miner_ignore_next_update
tracker_miner_is_started
+tracker_miner_is_paused
tracker_miner_pause
tracker_miner_resume
tracker_miner_get_connection
diff --git a/src/libtracker-miner/tracker-miner-object.c b/src/libtracker-miner/tracker-miner-object.c
index 4245e34..3d9cac5 100644
--- a/src/libtracker-miner/tracker-miner-object.c
+++ b/src/libtracker-miner/tracker-miner-object.c
@@ -375,7 +375,7 @@ miner_set_property (GObject *object,
* we set it last.
*
* Only notify 1% changes
- */
+ */
if (new_progress == miner->private->progress) {
/* Same, do nothing */
break;
@@ -543,6 +543,22 @@ tracker_miner_is_started (TrackerMiner *miner)
return miner->private->started;
}
+/**
+ * tracker_miner_is_paused:
+ * @miner: a #TrackerMiner
+ *
+ * Returns #TRUE if the miner is paused.
+ *
+ * Returns: #TRUE if the miner is paused.
+ **/
+gboolean
+tracker_miner_is_paused (TrackerMiner *miner)
+{
+ g_return_val_if_fail (TRACKER_IS_MINER (miner), TRUE);
+
+ return g_hash_table_size (miner->private->pauses) > 0 ? TRUE : FALSE;
+}
+
static gint
tracker_miner_pause_internal (TrackerMiner *miner,
const gchar *application,
diff --git a/src/libtracker-miner/tracker-miner-object.h b/src/libtracker-miner/tracker-miner-object.h
index 08cc57f..3362d89 100644
--- a/src/libtracker-miner/tracker-miner-object.h
+++ b/src/libtracker-miner/tracker-miner-object.h
@@ -92,6 +92,7 @@ void tracker_miner_stop (TrackerMiner
void tracker_miner_ignore_next_update (TrackerMiner *miner,
const GStrv urls);
gboolean tracker_miner_is_started (TrackerMiner *miner);
+gboolean tracker_miner_is_paused (TrackerMiner *miner);
gint tracker_miner_pause (TrackerMiner *miner,
const gchar *reason,
GError **error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]