[tracker/wip/carlosg/domain-ontologies: 75/93] libtracker-miner: Remove TrackerMinerFS API to add/remove directories



commit a1a071783240949a22a1b7d5a81fe0122ef1471f
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Jun 18 13:43:39 2017 +0200

    libtracker-miner: Remove TrackerMinerFS API to add/remove directories
    
    The whole set of tracker_miner_fs_add_directory_without_parent(),
    tracker_miner_fs_directory_add(), directory_remove() and
    directory_remove_full() are all covered by TrackerIndexingTree and
    basically unused, except for code in examples/.

 .../libtracker-miner/libtracker-miner-sections.txt |    4 -
 examples/libtracker-miner/tracker-main.c           |    8 +-
 src/libtracker-miner/tracker-miner-fs.c            |  146 --------------------
 src/libtracker-miner/tracker-miner-fs.h            |   16 --
 src/libtracker-miner/tracker-miner.vapi            |    4 -
 5 files changed, 7 insertions(+), 171 deletions(-)
---
diff --git a/docs/reference/libtracker-miner/libtracker-miner-sections.txt 
b/docs/reference/libtracker-miner/libtracker-miner-sections.txt
index cc16d28..d4b5538 100644
--- a/docs/reference/libtracker-miner/libtracker-miner-sections.txt
+++ b/docs/reference/libtracker-miner/libtracker-miner-sections.txt
@@ -186,10 +186,6 @@ tracker_miner_fs_get_indexing_tree
 tracker_miner_fs_get_data_provider
 tracker_miner_fs_get_throttle
 tracker_miner_fs_set_throttle
-tracker_miner_fs_add_directory_without_parent
-tracker_miner_fs_directory_add
-tracker_miner_fs_directory_remove
-tracker_miner_fs_directory_remove_full
 tracker_miner_fs_check_file
 tracker_miner_fs_check_file_with_priority
 tracker_miner_fs_check_directory
diff --git a/examples/libtracker-miner/tracker-main.c b/examples/libtracker-miner/tracker-main.c
index 4519679..4be5af3 100644
--- a/examples/libtracker-miner/tracker-main.c
+++ b/examples/libtracker-miner/tracker-main.c
@@ -80,10 +80,16 @@ add_directory_path (TrackerMinerFS *fs,
                     const gchar    *path,
                     gboolean        recurse)
 {
+       TrackerIndexingTree *tree;
+       TrackerDirectoryFlags flags = 0;
        GFile *file;
 
+       if (recurse)
+               flags |= TRACKER_DIRECTORY_FLAG_RECURSE;
+
        file = g_file_new_for_path (path);
-       tracker_miner_fs_directory_add (fs, file, recurse);
+       tree = tracker_miner_fs_get_indexing_tree (fs);
+       tracker_indexing_tree_add (tree, file, flags);
        g_object_unref (file);
 }
 
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
index c345773..c2b7868 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -2693,39 +2693,6 @@ file_equal_or_descendant (GFile *file,
        return FALSE;
 }
 
-/**
- * tracker_miner_fs_directory_add:
- * @fs: a #TrackerMinerFS
- * @file: #GFile for the directory to inspect
- * @recurse: whether the directory should be inspected recursively
- *
- * Tells the filesystem miner to inspect a directory.
- *
- * Since: 0.8
- **/
-void
-tracker_miner_fs_directory_add (TrackerMinerFS *fs,
-                                GFile          *file,
-                                gboolean        recurse)
-{
-       TrackerDirectoryFlags flags = TRACKER_DIRECTORY_FLAG_NONE;
-
-       g_return_if_fail (TRACKER_IS_MINER_FS (fs));
-       g_return_if_fail (G_IS_FILE (file));
-
-       if (recurse) {
-               flags |= TRACKER_DIRECTORY_FLAG_RECURSE;
-       }
-
-       if (!fs->priv->data_provider) {
-               flags |= TRACKER_DIRECTORY_FLAG_MONITOR;
-       }
-
-       tracker_indexing_tree_add (fs->priv->indexing_tree,
-                                  file,
-                                  flags);
-}
-
 static void
 task_pool_cancel_foreach (gpointer data,
                           gpointer user_data)
@@ -2809,82 +2776,6 @@ indexing_tree_directory_removed (TrackerIndexingTree *indexing_tree,
        g_timer_destroy (timer);
 }
 
-/**
- * tracker_miner_fs_directory_remove:
- * @fs: a #TrackerMinerFS
- * @file: #GFile for the directory to be removed
- *
- * Removes a directory from being inspected by @fs. Note that only directory
- *  watches are removed.
- *
- * Returns: %TRUE if the directory was successfully removed.
- *
- * Since: 0.8
- **/
-gboolean
-tracker_miner_fs_directory_remove (TrackerMinerFS *fs,
-                                   GFile          *file)
-{
-       TrackerMinerFSPrivate *priv;
-
-       g_return_val_if_fail (TRACKER_IS_MINER_FS (fs), FALSE);
-       g_return_val_if_fail (G_IS_FILE (file), FALSE);
-
-       priv = fs->priv;
-
-       if (!tracker_indexing_tree_file_is_root (priv->indexing_tree, file)) {
-               return FALSE;
-       }
-
-       g_debug ("Removing directory");
-       tracker_indexing_tree_remove (priv->indexing_tree, file);
-
-       return TRUE;
-}
-
-
-/**
- * tracker_miner_fs_directory_remove_full:
- * @fs: a #TrackerMinerFS
- * @file: #GFile for the directory to be removed
- *
- * Removes a directory from being inspected by @fs, and removes all
- * associated metadata of the directory (and its contents) from the
- * store.
- *
- * Returns: %TRUE if the directory was successfully removed.
- *
- * Since: 0.10
- **/
-gboolean
-tracker_miner_fs_directory_remove_full (TrackerMinerFS *fs,
-                                        GFile          *file)
-{
-       TrackerDirectoryFlags flags;
-
-       g_return_val_if_fail (TRACKER_IS_MINER_FS (fs), FALSE);
-       g_return_val_if_fail (G_IS_FILE (file), FALSE);
-
-       tracker_indexing_tree_get_root (fs->priv->indexing_tree, file, &flags);
-
-       if (tracker_miner_fs_directory_remove (fs, file)) {
-               if ((flags & TRACKER_DIRECTORY_FLAG_PRESERVE) != 0) {
-                       /* If the preserve flag is unset, TrackerFileNotifier
-                        * will delete automatically files from this config
-                        * directory, if it's set, we force the delete here
-                        * to preserve remove_full() semantics.
-                        */
-                       trace_eq_push_tail ("DELETED", file, "on remove full");
-                       miner_fs_queue_file (fs, fs->priv->items_deleted, file, FALSE);
-                       item_queue_handlers_set_up (fs);
-               }
-
-               return TRUE;
-       }
-
-       return FALSE;
-}
-
 static gboolean
 check_file_parents (TrackerMinerFS *fs,
                     GFile          *file)
@@ -3395,43 +3286,6 @@ tracker_miner_fs_has_items_to_process (TrackerMinerFS *fs)
        return FALSE;
 }
 
-#ifndef TRACKER_DISABLE_DEPRECATED
-/**
- * tracker_miner_fs_add_directory_without_parent:
- * @fs: a #TrackerMinerFS
- * @file: a #GFile
- *
- * Tells the miner-fs that the given #GFile corresponds to a
- * directory which was created in the store without a specific
- * parent object. In this case, when regenerating internal
- * caches, an extra query will be done so that these elements
- * are taken into account.
- *
- * Since: 0.10
- **/
-void
-tracker_miner_fs_add_directory_without_parent (TrackerMinerFS *fs,
-                                               GFile          *file)
-{
-       TrackerDirectoryFlags flags;
-
-       g_return_if_fail (TRACKER_IS_MINER_FS (fs));
-       g_return_if_fail (G_IS_FILE (file));
-
-       flags = TRACKER_DIRECTORY_FLAG_RECURSE |
-               TRACKER_DIRECTORY_FLAG_PRESERVE |
-               TRACKER_DIRECTORY_FLAG_CHECK_MTIME;
-
-       if (!fs->priv->data_provider) {
-               flags |= TRACKER_DIRECTORY_FLAG_MONITOR;
-       }
-
-       tracker_indexing_tree_add (fs->priv->indexing_tree,
-                                  file,
-                                  flags);
-}
-#endif
-
 /**
  * tracker_miner_fs_get_indexing_tree:
  * @fs: a #TrackerMinerFS
diff --git a/src/libtracker-miner/tracker-miner-fs.h b/src/libtracker-miner/tracker-miner-fs.h
index f87863e..b1f2c86 100644
--- a/src/libtracker-miner/tracker-miner-fs.h
+++ b/src/libtracker-miner/tracker-miner-fs.h
@@ -134,22 +134,6 @@ gdouble               tracker_miner_fs_get_throttle          (TrackerMinerFS  *f
 void                  tracker_miner_fs_set_throttle          (TrackerMinerFS  *fs,
                                                               gdouble          throttle);
 
-#ifndef TRACKER_DISABLE_DEPRECATED
-/* Setting locations to be processed in IndexingTree */
-void                  tracker_miner_fs_add_directory_without_parent
-                                                             (TrackerMinerFS  *fs,
-                                                              GFile           *file)
-                                                             G_GNUC_DEPRECATED;
-#endif
-
-void                  tracker_miner_fs_directory_add         (TrackerMinerFS  *fs,
-                                                              GFile           *file,
-                                                              gboolean         recurse);
-gboolean              tracker_miner_fs_directory_remove      (TrackerMinerFS  *fs,
-                                                              GFile           *file);
-gboolean              tracker_miner_fs_directory_remove_full (TrackerMinerFS  *fs,
-                                                              GFile           *file);
-
 /* Queueing files to be processed AFTER checking rules in IndexingTree */
 void                  tracker_miner_fs_check_file            (TrackerMinerFS  *fs,
                                                               GFile           *file,
diff --git a/src/libtracker-miner/tracker-miner.vapi b/src/libtracker-miner/tracker-miner.vapi
index 3b894bf..861b012 100644
--- a/src/libtracker-miner/tracker-miner.vapi
+++ b/src/libtracker-miner/tracker-miner.vapi
@@ -109,14 +109,10 @@ namespace Tracker {
        public abstract class MinerFS : Tracker.Miner, GLib.Initable {
                [CCode (has_construct_function = false)]
                protected MinerFS ();
-               public void add_directory_without_parent (GLib.File file);
                public void check_directory (GLib.File file, bool check_parents);
                public void check_directory_with_priority (GLib.File file, int priority, bool check_parents);
                public void check_file (GLib.File file, bool check_parents);
                public void check_file_with_priority (GLib.File file, int priority, bool check_parents);
-               public void directory_add (GLib.File file, bool recurse);
-               public bool directory_remove (GLib.File file);
-               public bool directory_remove_full (GLib.File file);
                public static GLib.Quark error_quark ();
                public void notify_finish (GLib.File file, GLib.Task task, string sparql, GLib.Error error);
                public unowned Tracker.DataProvider get_data_provider ();


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