[tracker-miners/wip/carlosg/speed-track: 9/40] tracker-miner-fs: Drop more unused functions




commit 9dad9db704d916e112cf34f8eca730f2e6d6453b
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Oct 4 18:16:44 2020 +0200

    tracker-miner-fs: Drop more unused functions
    
    These functions are unused now.

 src/miners/fs/tracker-miner-files.c | 146 ------------------------------------
 src/miners/fs/tracker-miner-files.h |  13 ----
 2 files changed, 159 deletions(-)
---
diff --git a/src/miners/fs/tracker-miner-files.c b/src/miners/fs/tracker-miner-files.c
index 0ae7e7052..3c7735504 100644
--- a/src/miners/fs/tracker-miner-files.c
+++ b/src/miners/fs/tracker-miner-files.c
@@ -2618,152 +2618,6 @@ tracker_miner_files_new (TrackerSparqlConnection  *connection,
                               NULL);
 }
 
-gboolean
-tracker_miner_files_check_file (GFile  *file,
-                                GSList *ignored_file_paths,
-                                GSList *ignored_file_patterns)
-{
-       GSList *l;
-       gchar *basename;
-       gchar *path;
-       gboolean should_process;
-
-       should_process = FALSE;
-       basename = NULL;
-       path = NULL;
-
-       if (tracker_file_is_hidden (file)) {
-               /* Ignore hidden files */
-               goto done;
-       }
-
-       path = g_file_get_path (file);
-
-       for (l = ignored_file_paths; l; l = l->next) {
-               if (strcmp (l->data, path) == 0) {
-                       goto done;
-               }
-       }
-
-       basename = g_file_get_basename (file);
-
-       for (l = ignored_file_patterns; l; l = l->next) {
-               if (g_pattern_match_string (l->data, basename)) {
-                       goto done;
-               }
-       }
-
-       should_process = TRUE;
-
-done:
-       g_free (basename);
-       g_free (path);
-
-       return should_process;
-}
-
-gboolean
-tracker_miner_files_check_directory (GFile  *file,
-                                     GSList *index_recursive_directories,
-                                     GSList *index_single_directories,
-                                     GSList *ignored_directory_paths,
-                                     GSList *ignored_directory_patterns)
-{
-       GSList *l;
-       gchar *basename;
-       gchar *path;
-       gboolean should_process;
-       gboolean is_hidden;
-
-       should_process = FALSE;
-       basename = NULL;
-
-       path = g_file_get_path (file);
-
-       /* First we check the GIO hidden check. This does a number of
-        * things for us which is good (like checking ".foo" dirs).
-        */
-       is_hidden = tracker_file_is_hidden (file);
-
-#ifdef __linux__
-       /* Second we check if the file is on FAT and if the hidden
-        * attribute is set. GIO does this but ONLY on a Windows OS,
-        * not for Windows files under a Linux OS, so we have to check
-        * anyway.
-        */
-       if (!is_hidden) {
-               int fd;
-
-               fd = g_open (path, O_RDONLY, 0);
-               if (fd != -1) {
-                       __u32 attrs;
-
-                       if (ioctl (fd, FAT_IOCTL_GET_ATTRIBUTES, &attrs) == 0) {
-                               is_hidden = attrs & ATTR_HIDDEN ? TRUE : FALSE;
-                       }
-
-                       close (fd);
-               }
-       }
-#endif /* __linux__ */
-
-       if (is_hidden) {
-               /* FIXME: We need to check if the file is actually a
-                * config specified location before blanket ignoring
-                * all hidden files.
-                */
-               if (tracker_string_in_gslist (path, index_recursive_directories)) {
-                       should_process = TRUE;
-               }
-
-               if (tracker_string_in_gslist (path, index_single_directories)) {
-                       should_process = TRUE;
-               }
-
-               /* Ignore hidden dirs */
-               goto done;
-       }
-
-       for (l = ignored_directory_paths; l; l = l->next) {
-               if (strcmp (l->data, path) == 0) {
-                       goto done;
-               }
-       }
-
-       basename = g_file_get_basename (file);
-
-       for (l = ignored_directory_patterns; l; l = l->next) {
-               if (g_pattern_match_string (l->data, basename)) {
-                       goto done;
-               }
-       }
-
-       /* Check module directory ignore patterns */
-       should_process = TRUE;
-
-done:
-       g_free (basename);
-       g_free (path);
-
-       return should_process;
-}
-
-gboolean
-tracker_miner_files_monitor_directory (GFile    *file,
-                                       gboolean  enable_monitors,
-                                       GSList   *directories_to_check)
-{
-       if (!enable_monitors) {
-               return FALSE;
-       }
-
-       /* We'll only get this signal for the directories where check_directory()
-        * and check_directory_contents() returned TRUE, so by default we want
-        * these directories to be indexed. */
-
-       return TRUE;
-}
-
 static void
 remove_files_in_removable_media_cb (GObject      *object,
                                     GAsyncResult *result,
diff --git a/src/miners/fs/tracker-miner-files.h b/src/miners/fs/tracker-miner-files.h
index 565a50aea..7198147b1 100644
--- a/src/miners/fs/tracker-miner-files.h
+++ b/src/miners/fs/tracker-miner-files.h
@@ -53,19 +53,6 @@ TrackerMiner *tracker_miner_files_new                      (TrackerSparqlConnect
                                                             const gchar              *domain,
                                                             GError                  **error);
 
-/* Convenience functions for --eligible tracker-miner-fs cmdline */
-gboolean      tracker_miner_files_check_file               (GFile             *file,
-                                                            GSList            *ignored_file_paths,
-                                                            GSList            *ignored_file_patterns);
-gboolean      tracker_miner_files_check_directory          (GFile             *file,
-                                                            GSList            *index_recursive_directories,
-                                                            GSList            *index_single_directories,
-                                                            GSList            *ignored_directory_paths,
-                                                            GSList            *ignored_directory_patterns);
-gboolean      tracker_miner_files_monitor_directory        (GFile             *file,
-                                                            gboolean           enable_monitors,
-                                                            GSList            *directories_to_check);
-
 /* Global functions to handle timestamp files */
 gboolean tracker_miner_files_get_first_index_done (TrackerMinerFiles *mf);
 void     tracker_miner_files_set_first_index_done (TrackerMinerFiles *mf,


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