[tracker/writeback-refactor-0.10: 37/64] miners/fs: Fix enabling/disabling writeback
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/writeback-refactor-0.10: 37/64] miners/fs: Fix enabling/disabling writeback
- Date: Thu, 28 Jul 2011 15:38:33 +0000 (UTC)
commit d56b130a9ce7834080f951e33adb533ea24cb85a
Author: Philip Van Hoof <philip codeminded be>
Date: Fri Jul 22 16:45:40 2011 +0200
miners/fs: Fix enabling/disabling writeback
src/miners/fs/tracker-writeback.c | 28 +++++++++++++++++-----------
1 files changed, 17 insertions(+), 11 deletions(-)
---
diff --git a/src/miners/fs/tracker-writeback.c b/src/miners/fs/tracker-writeback.c
index be59579..84a5987 100644
--- a/src/miners/fs/tracker-writeback.c
+++ b/src/miners/fs/tracker-writeback.c
@@ -62,12 +62,27 @@ initialize_all (TrackerMinerFiles *miner_files,
}
static void
+shutdown_writeback (void)
+{
+ if (listener) {
+ g_object_unref (listener);
+ listener = NULL;
+ }
+
+ if (dispatcher) {
+ g_object_unref (dispatcher);
+ dispatcher = NULL;
+ }
+ enabled = FALSE;
+}
+
+static void
enable_writeback_cb (GObject *object,
GParamSpec *pspec,
gpointer user_data)
{
if (enabled && !tracker_config_get_enable_monitors (gconfig)) {
- tracker_writeback_shutdown ();
+ shutdown_writeback ();
}
if (!enabled && tracker_config_get_enable_monitors (gconfig)) {
@@ -107,15 +122,7 @@ tracker_writeback_init (TrackerMinerFiles *miner_files,
void
tracker_writeback_shutdown (void)
{
- if (listener) {
- g_object_unref (listener);
- listener = NULL;
- }
-
- if (dispatcher) {
- g_object_unref (dispatcher);
- dispatcher = NULL;
- }
+ shutdown_writeback ();
if (gconfig) {
if (gsig) {
@@ -127,5 +134,4 @@ tracker_writeback_shutdown (void)
if (gminer_files) {
g_object_unref (gminer_files);
}
- enabled = FALSE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]