[tracker/miner-fs-refactor: 61/93] libtracker-miner: Remove miner_fs->priv->directories
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/miner-fs-refactor: 61/93] libtracker-miner: Remove miner_fs->priv->directories
- Date: Fri, 7 Oct 2011 11:22:27 +0000 (UTC)
commit 582c4601dd5d34921e3be4140c340782dd008a19
Author: Carlos Garnacho <carlos lanedo com>
Date: Mon Oct 3 13:57:40 2011 +0200
libtracker-miner: Remove miner_fs->priv->directories
All its uses have been replaced by TrackerFileNotifier
src/libtracker-miner/tracker-miner-fs.c | 66 +------------------------------
1 files changed, 1 insertions(+), 65 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
index 2694efe..7aefb69 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -187,9 +187,6 @@ struct _TrackerMinerFSPrivate {
GList *config_directories;
- TrackerPriorityQueue *directories;
- DirectoryData *current_directory;
-
GTimer *timer;
guint item_queues_handler_id;
@@ -336,7 +333,6 @@ static void item_update_children_uri (TrackerMinerFS
RecursiveMoveData *data,
const gchar *source_uri,
const gchar *uri);
-static void crawled_directory_data_free (CrawledDirectoryData *data);
static gboolean should_recurse_for_directory (TrackerMinerFS *fs,
GFile *file);
@@ -710,8 +706,6 @@ tracker_miner_fs_init (TrackerMinerFS *object)
priv->items_moved = tracker_priority_queue_new ();
priv->items_writeback = tracker_priority_queue_new ();
- priv->directories = tracker_priority_queue_new ();
-
#ifdef EVENT_QUEUE_ENABLE_TRACE
priv->queue_status_timeout_id = g_timeout_add_seconds (EVENT_QUEUE_STATUS_TIMEOUT_SECS,
miner_fs_queues_status_trace_timeout_cb,
@@ -812,11 +806,6 @@ fs_finalize (GObject *object)
tracker_file_notifier_stop (priv->file_notifier);
g_object_unref (priv->file_notifier);
- tracker_priority_queue_foreach (priv->directories,
- (GFunc) directory_data_unref,
- NULL);
- tracker_priority_queue_unref (priv->directories);
-
if (priv->config_directories) {
g_list_foreach (priv->config_directories, (GFunc) directory_data_unref, NULL);
g_list_free (priv->config_directories);
@@ -2358,13 +2347,6 @@ item_queue_get_next_file (TrackerMinerFS *fs,
return QUEUE_NONE;
}
-static void
-get_tree_progress_foreach (CrawledDirectoryData *data,
- gint *items_to_process)
-{
- *items_to_process += data->n_items - data->n_items_processed;
-}
-
static gdouble
item_queue_get_progress (TrackerMinerFS *fs,
guint *n_items_processed,
@@ -3083,30 +3065,6 @@ print_file_tree (GNode *node,
#endif /* CRAWLED_TREE_ENABLE_TRACE */
-static gboolean
-crawled_directory_data_free_foreach (GNode *node,
- gpointer user_data)
-{
- g_object_unref (node->data);
- return FALSE;
-}
-
-static void
-crawled_directory_data_free (CrawledDirectoryData *data)
-{
- g_node_traverse (data->tree,
- G_POST_ORDER,
- G_TRAVERSE_ALL,
- -1,
- crawled_directory_data_free_foreach,
- NULL);
- g_node_destroy (data->tree);
-
- g_queue_free (data->nodes);
-
- g_slice_free (CrawledDirectoryData, data);
-}
-
/* Returns TRUE if file equals to
* other_file, or is a child of it
*/
@@ -3123,13 +3081,6 @@ file_equal_or_descendant (GFile *file,
}
static gboolean
-crawled_directory_contains_file (CrawledDirectoryData *data,
- GFile *file)
-{
- return file_equal_or_descendant (file, data->tree->data);
-}
-
-static gboolean
should_recurse_for_directory (TrackerMinerFS *fs,
GFile *file)
{
@@ -3326,21 +3277,6 @@ tracker_miner_fs_directory_remove (TrackerMinerFS *fs,
g_debug (" Cancelled writeback pool tasks at %f\n",
g_timer_elapsed (timer, NULL));
- if (fs->priv->current_directory) {
- GFile *current_file;
-
- current_file = fs->priv->current_directory->file;
-
- if (g_file_equal (file, current_file) ||
- g_file_has_prefix (file, current_file)) {
- return_val = TRUE;
- }
- }
-
- tracker_priority_queue_foreach_remove (fs->priv->directories,
- (GEqualFunc) directory_contains_file,
- file,
- (GDestroyNotify) directory_data_unref);
dirs = fs->priv->config_directories;
while (dirs) {
@@ -3955,6 +3891,7 @@ tracker_miner_fs_get_parent_urn (TrackerMinerFS *fs,
void
tracker_miner_fs_force_recheck (TrackerMinerFS *fs)
{
+#if 0
GList *directories;
g_return_if_fail (TRACKER_IS_MINER_FS (fs));
@@ -3970,7 +3907,6 @@ tracker_miner_fs_force_recheck (TrackerMinerFS *fs)
directories = directories->next;
}
-#if 0
crawl_directories_start (fs);
#endif
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]