[tracker/miner-fs-refactor: 79/120] libtracker-miner: Remove unused vmethods from TrackerMinerFS



commit b98e099a07cb925a78c8219356e0d52305109876
Author: Carlos Garnacho <carlos lanedo com>
Date:   Tue Oct 4 18:35:04 2011 +0200

    libtracker-miner: Remove unused vmethods from TrackerMinerFS
    
    This touches public API, but these signals aren't emitted anymore as
    TrackerIndexingTree provides all necessary information.

 src/libtracker-miner/tracker-miner-fs.c    |  121 ----------------------------
 src/libtracker-miner/tracker-miner-fs.h    |    9 --
 src/miners/fs/tracker-miner-applications.c |   45 ----------
 src/miners/fs/tracker-miner-files.c        |   86 --------------------
 4 files changed, 0 insertions(+), 261 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
index c6f36f3..15ae447 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -219,10 +219,6 @@ typedef enum {
 } QueueState;
 
 enum {
-	CHECK_FILE,
-	CHECK_DIRECTORY,
-	CHECK_DIRECTORY_CONTENTS,
-	MONITOR_DIRECTORY,
 	PROCESS_FILE,
 	PROCESS_FILE_ATTRIBUTES,
 	IGNORE_NEXT_UPDATE_FILE,
@@ -251,11 +247,6 @@ static void           fs_get_property                     (GObject
                                                            guint                 prop_id,
                                                            GValue               *value,
                                                            GParamSpec           *pspec);
-static gboolean       fs_defaults                         (TrackerMinerFS       *fs,
-                                                           GFile                *file);
-static gboolean       fs_contents_defaults                (TrackerMinerFS       *fs,
-                                                           GFile                *parent,
-                                                           GList                *children);
 static void           miner_started                       (TrackerMiner         *miner);
 static void           miner_stopped                       (TrackerMiner         *miner);
 static void           miner_paused                        (TrackerMiner         *miner);
@@ -314,7 +305,6 @@ static void
 tracker_miner_fs_class_init (TrackerMinerFSClass *klass)
 {
 	GObjectClass *object_class = G_OBJECT_CLASS (klass);
-	TrackerMinerFSClass *fs_class = TRACKER_MINER_FS_CLASS (klass);
 	TrackerMinerClass *miner_class = TRACKER_MINER_CLASS (klass);
 
 	object_class->finalize = fs_finalize;
@@ -327,11 +317,6 @@ tracker_miner_fs_class_init (TrackerMinerFSClass *klass)
 	miner_class->resumed = miner_resumed;
 	miner_class->ignore_next_update = miner_ignore_next_update;
 
-	fs_class->check_file        = fs_defaults;
-	fs_class->check_directory   = fs_defaults;
-	fs_class->monitor_directory = fs_defaults;
-	fs_class->check_directory_contents = fs_contents_defaults;
-
 	g_object_class_install_property (object_class,
 	                                 PROP_THROTTLE,
 	                                 g_param_spec_double ("throttle",
@@ -371,97 +356,6 @@ tracker_miner_fs_class_init (TrackerMinerFSClass *klass)
 	                                                       G_PARAM_READWRITE));
 
 	/**
-	 * TrackerMinerFS::check-file:
-	 * @miner_fs: the #TrackerMinerFS
-	 * @file: a #GFile
-	 *
-	 * The ::check-file signal is emitted either on the filesystem crawling
-	 * phase or whenever a new file appears in a monitored directory
-	 * in order to check whether @file must be inspected my @miner_fs.
-	 *
-	 * Returns: %TRUE if @file must be inspected.
-	 *
-	 * Since: 0.8
-	 **/
-	signals[CHECK_FILE] =
-		g_signal_new ("check-file",
-		              G_OBJECT_CLASS_TYPE (object_class),
-		              G_SIGNAL_RUN_LAST,
-		              G_STRUCT_OFFSET (TrackerMinerFSClass, check_file),
-		              tracker_accumulator_check_file,
-		              NULL,
-		              tracker_marshal_BOOLEAN__OBJECT,
-		              G_TYPE_BOOLEAN, 1, G_TYPE_FILE);
-	/**
-	 * TrackerMinerFS::check-directory:
-	 * @miner_fs: the #TrackerMinerFS
-	 * @directory: a #GFile
-	 *
-	 * The ::check-directory signal is emitted either on the filesystem crawling
-	 * phase or whenever a new directory appears in a monitored directory
-	 * in order to check whether @directory must be inspected my @miner_fs.
-	 *
-	 * Returns: %TRUE if @directory must be inspected.
-	 *
-	 * Since: 0.8
-	 **/
-	signals[CHECK_DIRECTORY] =
-		g_signal_new ("check-directory",
-		              G_OBJECT_CLASS_TYPE (object_class),
-		              G_SIGNAL_RUN_LAST,
-		              G_STRUCT_OFFSET (TrackerMinerFSClass, check_directory),
-		              tracker_accumulator_check_file,
-		              NULL,
-		              tracker_marshal_BOOLEAN__OBJECT,
-		              G_TYPE_BOOLEAN, 1, G_TYPE_FILE);
-	/**
-	 * TrackerMinerFS::check-directory-contents:
-	 * @miner_fs: the #TrackerMinerFS
-	 * @directory: a #GFile
-	 * @children: #GList of #GFile<!-- -->s
-	 *
-	 * The ::check-directory-contents signal is emitted either on the filesystem
-	 * crawling phase or whenever a new directory appears in a monitored directory
-	 * in order to check whether @directory must be inspected my @miner_fs based on
-	 * the directory contents, for some implementations this signal may be useful
-	 * to discard backup directories for example.
-	 *
-	 * Returns: %TRUE if @directory must be inspected.
-	 *
-	 * Since: 0.8
-	 **/
-	signals[CHECK_DIRECTORY_CONTENTS] =
-		g_signal_new ("check-directory-contents",
-		              G_OBJECT_CLASS_TYPE (object_class),
-		              G_SIGNAL_RUN_LAST,
-		              G_STRUCT_OFFSET (TrackerMinerFSClass, check_directory_contents),
-		              tracker_accumulator_check_file,
-		              NULL,
-		              tracker_marshal_BOOLEAN__OBJECT_POINTER,
-		              G_TYPE_BOOLEAN, 2, G_TYPE_FILE, G_TYPE_POINTER);
-	/**
-	 * TrackerMinerFS::monitor-directory:
-	 * @miner_fs: the #TrackerMinerFS
-	 * @directory: a #GFile
-	 *
-	 * The ::monitor-directory is emitted either on the filesystem crawling phase
-	 * or whenever a new directory appears in a monitored directory in order to
-	 * check whether @directory must be monitored for filesystem changes or not.
-	 *
-	 * Returns: %TRUE if the directory must be monitored for changes.
-	 *
-	 * Since: 0.8
-	 **/
-	signals[MONITOR_DIRECTORY] =
-		g_signal_new ("monitor-directory",
-		              G_OBJECT_CLASS_TYPE (object_class),
-		              G_SIGNAL_RUN_LAST,
-		              G_STRUCT_OFFSET (TrackerMinerFSClass, monitor_directory),
-		              tracker_accumulator_check_file,
-		              NULL,
-		              tracker_marshal_BOOLEAN__OBJECT,
-		              G_TYPE_BOOLEAN, 1, G_TYPE_FILE);
-	/**
 	 * TrackerMinerFS::process-file:
 	 * @miner_fs: the #TrackerMinerFS
 	 * @file: a #GFile
@@ -869,21 +763,6 @@ task_pool_limit_reached_notify_cb (GObject    *object,
 	}
 }
 
-static gboolean
-fs_defaults (TrackerMinerFS *fs,
-             GFile          *file)
-{
-	return TRUE;
-}
-
-static gboolean
-fs_contents_defaults (TrackerMinerFS *fs,
-                      GFile          *parent,
-                      GList          *children)
-{
-	return TRUE;
-}
-
 static void
 miner_started (TrackerMiner *miner)
 {
diff --git a/src/libtracker-miner/tracker-miner-fs.h b/src/libtracker-miner/tracker-miner-fs.h
index 700c6d3..40ee876 100644
--- a/src/libtracker-miner/tracker-miner-fs.h
+++ b/src/libtracker-miner/tracker-miner-fs.h
@@ -84,13 +84,6 @@ struct _TrackerMinerFS {
 typedef struct {
 	TrackerMinerClass parent;
 
-	gboolean (* check_file)               (TrackerMinerFS       *fs,
-	                                       GFile                *file);
-	gboolean (* check_directory)          (TrackerMinerFS       *fs,
-	                                       GFile                *file);
-	gboolean (* check_directory_contents) (TrackerMinerFS       *fs,
-	                                       GFile                *parent,
-	                                       GList                *children);
 	gboolean (* process_file)             (TrackerMinerFS       *fs,
 	                                       GFile                *file,
 	                                       TrackerSparqlBuilder *builder,
@@ -99,8 +92,6 @@ typedef struct {
 	                                       GFile                *file,
 	                                       TrackerSparqlBuilder *builder,
 	                                       GCancellable         *cancellable);
-	gboolean (* monitor_directory)        (TrackerMinerFS       *fs,
-	                                       GFile                *file);
 	void     (* finished)                 (TrackerMinerFS       *fs);
 	gboolean (* process_file_attributes)  (TrackerMinerFS       *fs,
 	                                       GFile                *file,
diff --git a/src/miners/fs/tracker-miner-applications.c b/src/miners/fs/tracker-miner-applications.c
index f438564..eb8c43e 100644
--- a/src/miners/fs/tracker-miner-applications.c
+++ b/src/miners/fs/tracker-miner-applications.c
@@ -41,10 +41,6 @@ static void     miner_applications_initable_iface_init     (GInitableIface
 static gboolean miner_applications_initable_init           (GInitable            *initable,
                                                             GCancellable         *cancellable,
                                                             GError              **error);
-static gboolean miner_applications_check_file              (TrackerMinerFS       *fs,
-                                                            GFile                *file);
-static gboolean miner_applications_check_directory         (TrackerMinerFS       *fs,
-                                                            GFile                *file);
 static gboolean miner_applications_process_file            (TrackerMinerFS       *fs,
                                                             GFile                *file,
                                                             TrackerSparqlBuilder *sparql,
@@ -53,8 +49,6 @@ static gboolean miner_applications_process_file_attributes (TrackerMinerFS
                                                             GFile                *file,
                                                             TrackerSparqlBuilder *sparql,
                                                             GCancellable         *cancellable);
-static gboolean miner_applications_monitor_directory       (TrackerMinerFS       *fs,
-                                                            GFile                *file);
 static void     miner_applications_finalize                (GObject              *object);
 
 
@@ -85,9 +79,6 @@ tracker_miner_applications_class_init (TrackerMinerApplicationsClass *klass)
 
 	object_class->finalize = miner_applications_finalize;
 
-	miner_fs_class->check_file = miner_applications_check_file;
-	miner_fs_class->check_directory = miner_applications_check_directory;
-	miner_fs_class->monitor_directory = miner_applications_monitor_directory;
 	miner_fs_class->process_file = miner_applications_process_file;
 	miner_fs_class->process_file_attributes = miner_applications_process_file_attributes;
 
@@ -315,42 +306,6 @@ insert_data_from_desktop_file (TrackerSparqlBuilder *sparql,
 	}
 }
 
-static gboolean
-miner_applications_check_file (TrackerMinerFS *fs,
-                               GFile          *file)
-{
-	gboolean retval = FALSE;
-	gchar *basename;
-
-	basename = g_file_get_basename (file);
-
-	/* Check we're dealing with a desktop file */
-	if (g_str_has_suffix (basename, ".desktop") ||
-	    g_str_has_suffix (basename, ".directory")) {
-		retval = TRUE;
-	}
-
-	g_free (basename);
-
-	return retval;
-}
-
-static gboolean
-miner_applications_check_directory (TrackerMinerFS *fs,
-                                    GFile          *file)
-{
-	/* We want to inspect all the passed dirs and their children */
-	return TRUE;
-}
-
-static gboolean
-miner_applications_monitor_directory (TrackerMinerFS *fs,
-                                      GFile          *file)
-{
-	/* We want to monitor all the passed dirs and their children */
-	return TRUE;
-}
-
 static GKeyFile *
 get_desktop_key_file (GFile   *file,
                       gchar  **type,
diff --git a/src/miners/fs/tracker-miner-files.c b/src/miners/fs/tracker-miner-files.c
index 624a4b3..5c0346a 100644
--- a/src/miners/fs/tracker-miner-files.c
+++ b/src/miners/fs/tracker-miner-files.c
@@ -175,13 +175,6 @@ static void        trigger_recheck_cb                   (GObject              *g
 static void        index_volumes_changed_cb             (GObject              *gobject,
                                                          GParamSpec           *arg1,
                                                          gpointer              user_data);
-static gboolean    miner_files_check_file               (TrackerMinerFS       *fs,
-                                                         GFile                *file);
-static gboolean    miner_files_check_directory          (TrackerMinerFS       *fs,
-                                                         GFile                *file);
-static gboolean    miner_files_check_directory_contents (TrackerMinerFS       *fs,
-                                                         GFile                *parent,
-                                                         GList                *children);
 static gboolean    miner_files_process_file             (TrackerMinerFS       *fs,
                                                          GFile                *file,
                                                          TrackerSparqlBuilder *sparql,
@@ -190,8 +183,6 @@ static gboolean    miner_files_process_file_attributes  (TrackerMinerFS       *f
                                                          GFile                *file,
                                                          TrackerSparqlBuilder *sparql,
                                                          GCancellable         *cancellable);
-static gboolean    miner_files_monitor_directory        (TrackerMinerFS       *fs,
-                                                         GFile                *file);
 static gboolean    miner_files_ignore_next_update_file  (TrackerMinerFS       *fs,
                                                          GFile                *file,
                                                          TrackerSparqlBuilder *sparql,
@@ -236,10 +227,6 @@ tracker_miner_files_class_init (TrackerMinerFilesClass *klass)
 	object_class->get_property = miner_files_get_property;
 	object_class->set_property = miner_files_set_property;
 
-	miner_fs_class->check_file = miner_files_check_file;
-	miner_fs_class->check_directory = miner_files_check_directory;
-	miner_fs_class->check_directory_contents = miner_files_check_directory_contents;
-	miner_fs_class->monitor_directory = miner_files_monitor_directory;
 	miner_fs_class->process_file = miner_files_process_file;
 	miner_fs_class->process_file_attributes = miner_files_process_file_attributes;
 	miner_fs_class->ignore_next_update_file = miner_files_ignore_next_update_file;
@@ -1874,79 +1861,6 @@ index_volumes_changed_cb (GObject    *gobject,
 	}
 }
 
-static gboolean
-miner_files_check_file (TrackerMinerFS *fs,
-                        GFile          *file)
-{
-	TrackerMinerFiles *mf;
-
-	/* Check module file ignore patterns */
-	mf = TRACKER_MINER_FILES (fs);
-
-	if (G_UNLIKELY (!mf->private->config)) {
-		return TRUE;
-	}
-
-	return tracker_miner_files_check_file (file,
-	                                       tracker_config_get_ignored_file_paths (mf->private->config),
-	                                       tracker_config_get_ignored_file_patterns (mf->private->config));
-}
-
-static gboolean
-miner_files_check_directory (TrackerMinerFS *fs,
-                             GFile          *file)
-{
-	TrackerMinerFiles *mf;
-
-	/* Check module file ignore patterns */
-	mf = TRACKER_MINER_FILES (fs);
-
-	if (G_UNLIKELY (!mf->private->config)) {
-		return TRUE;
-	}
-
-	return tracker_miner_files_check_directory (file,
-	                                            tracker_config_get_index_recursive_directories (mf->private->config),
-	                                            tracker_config_get_index_single_directories (mf->private->config),
-	                                            tracker_config_get_ignored_directory_paths (mf->private->config),
-	                                            tracker_config_get_ignored_directory_patterns (mf->private->config));
-}
-
-static gboolean
-miner_files_check_directory_contents (TrackerMinerFS *fs,
-                                      GFile          *parent,
-                                      GList          *children)
-{
-	TrackerMinerFiles *mf;
-
-	mf = TRACKER_MINER_FILES (fs);
-
-	if (G_UNLIKELY (!mf->private->config)) {
-		return TRUE;
-	}
-
-	return tracker_miner_files_check_directory_contents (parent,
-	                                                     children,
-	                                                     tracker_config_get_ignored_directories_with_content (mf->private->config));
-}
-
-static gboolean
-miner_files_monitor_directory (TrackerMinerFS *fs,
-                               GFile          *file)
-{
-	TrackerMinerFiles *mf;
-
-	mf = TRACKER_MINER_FILES (fs);
-
-	if (G_UNLIKELY (!mf->private->config)) {
-		return TRUE;
-	}
-
-	return tracker_miner_files_monitor_directory (file,
-	                                              tracker_config_get_enable_monitors (mf->private->config),
-	                                              mf->private->index_single_directories);
-}
-
 static const gchar *
 miner_files_get_file_urn (TrackerMinerFiles *miner,
                           GFile             *file,



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