[tracker/external-crawler: 35/42] libtracker-miner: Create TrackerFileSystem in constructed() not init()



commit 36fab01e8e42ee6b29826968c725b6a57acda052
Author: Martyn Russell <martyn lanedo com>
Date:   Tue Jul 1 10:30:13 2014 +0100

    libtracker-miner: Create TrackerFileSystem in constructed() not init()
    
    We do this because the GFile which is the root for the TrackerFileSystem is a
    property which is set on object construction. If we try to do this in init()
    the root is unset at that point. So we wait until constructed where properties
    are guaranteed to be set.
    
    Also Chain parent constructed() in TrackerFileNotifier

 src/libtracker-miner/tracker-file-notifier.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-file-notifier.c b/src/libtracker-miner/tracker-file-notifier.c
index 118d4bb..8263d63 100644
--- a/src/libtracker-miner/tracker-file-notifier.c
+++ b/src/libtracker-miner/tracker-file-notifier.c
@@ -1348,10 +1348,17 @@ static void
 tracker_file_notifier_constructed (GObject *object)
 {
        TrackerFileNotifierPrivate *priv;
+       GFile *root;
+
+       G_OBJECT_CLASS (tracker_file_notifier_parent_class)->constructed (object);
 
        priv = TRACKER_FILE_NOTIFIER (object)->priv;
        g_assert (priv->indexing_tree);
 
+       /* Initialize filesystem and register properties */
+       root = tracker_indexing_tree_get_master_root (priv->indexing_tree);
+       priv->file_system = tracker_file_system_new (root);
+
        g_signal_connect (priv->indexing_tree, "directory-added",
                          G_CALLBACK (indexing_tree_directory_added), object);
        g_signal_connect (priv->indexing_tree, "directory-updated",
@@ -1518,9 +1525,6 @@ tracker_file_notifier_init (TrackerFileNotifier *notifier)
                g_assert_not_reached ();
        }
 
-       /* Initialize filesystem and register properties */
-       priv->file_system = tracker_file_system_new (NULL);
-
        priv->timer = g_timer_new ();
        priv->stopped = TRUE;
 


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