[tracker/external-crawler: 15/45] libtracker-miner: Removed MinerFS _manually_notify_file() and Queue enum



commit a2913ffb71bf3005e6960c121400ecd0e8915ed4
Author: Martyn Russell <martyn lanedo com>
Date:   Thu Jun 5 12:30:58 2014 +0100

    libtracker-miner: Removed MinerFS _manually_notify_file() and Queue enum

 src/libtracker-miner/tracker-file-notifier.c |   46 +------------------
 src/libtracker-miner/tracker-file-notifier.h |    5 --
 src/libtracker-miner/tracker-miner-fs.c      |   61 --------------------------
 src/libtracker-miner/tracker-miner-fs.h      |   22 ++--------
 4 files changed, 6 insertions(+), 128 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-file-notifier.c b/src/libtracker-miner/tracker-file-notifier.c
index 722f369..c52811a 100644
--- a/src/libtracker-miner/tracker-file-notifier.c
+++ b/src/libtracker-miner/tracker-file-notifier.c
@@ -389,9 +389,8 @@ file_notifier_add_node_foreach (GNode    *node,
        }
 
        if (priv->external_crawler) {
-               file_info = NULL;
-
-               /* FIXME: get time and set property ... */
+               g_signal_emit (data->notifier, signals[QUERY_INFO], 0, file, &file_info);
+               g_warning ("TRACKER_FILE_NOTIFIER --> QUERY INFO, file:%p, info:%p", file, file_info);
        } else {
                file_info = tracker_crawler_get_file_info (priv->crawler, file);
        }
@@ -1672,44 +1671,3 @@ tracker_file_notifier_get_file_iri (TrackerFileNotifier *notifier,
 
        return iri;
 }
-
-gboolean
-tracker_file_notifier_signal_file  (TrackerFileNotifier     *notifier,
-                                    TrackerMinerFSQueue      queue_type,
-                                    GFile                   *file,
-                                    GFileType                file_type)
-{
-       g_return_val_if_fail (TRACKER_IS_FILE_NOTIFIER (notifier), FALSE);
-       g_return_val_if_fail (G_IS_FILE (file), FALSE);
-
-       switch (queue_type) {
-       case TRACKER_MINER_FS_QUEUE_CREATED:
-               monitor_item_created_cb (NULL,
-                                        file,
-                                        file_type == G_FILE_TYPE_DIRECTORY ? TRUE : FALSE,
-                                        notifier);
-               break;
-
-       case TRACKER_MINER_FS_QUEUE_UPDATED:
-               monitor_item_updated_cb (NULL,
-                                        file,
-                                        file_type == G_FILE_TYPE_DIRECTORY ? TRUE : FALSE,
-                                        notifier);
-               break;
-
-       case TRACKER_MINER_FS_QUEUE_DELETED:
-               monitor_item_deleted_cb (NULL,
-                                        file,
-                                        file_type == G_FILE_TYPE_DIRECTORY ? TRUE : FALSE,
-                                        notifier);
-       case TRACKER_MINER_FS_QUEUE_MOVED:
-               g_critical ("Currently MOVE signalling is unsupported");
-               return FALSE;
-
-       default:
-               g_assert_not_reached ();
-               return FALSE;
-       }
-
-       return TRUE;
-}
diff --git a/src/libtracker-miner/tracker-file-notifier.h b/src/libtracker-miner/tracker-file-notifier.h
index 3c0438b..57bafce 100644
--- a/src/libtracker-miner/tracker-file-notifier.h
+++ b/src/libtracker-miner/tracker-file-notifier.h
@@ -89,11 +89,6 @@ const gchar * tracker_file_notifier_get_file_iri (TrackerFileNotifier     *notif
                                                   GFile                   *file,
                                                   gboolean                 force);
 
-gboolean      tracker_file_notifier_signal_file  (TrackerFileNotifier     *notifier,
-                                                  TrackerMinerFSQueue      queue_type,
-                                                  GFile                   *file,
-                                                  GFileType                file_type);
-
 G_END_DECLS
 
 #endif /* __TRACKER_FILE_SYSTEM_H__ */
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
index a8368bc..d14e134 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -3939,67 +3939,6 @@ tracker_miner_fs_get_indexing_tree (TrackerMinerFS *fs)
        return fs->priv->indexing_tree;
 }
 
-/**
- * tracker_miner_fs_manually_notify_file:
- * @fs: a #TrackerMinerFS
- * @queue_type: the type of operation to notify
- * @file: a #GFile
- * @file_type: a #GFileType
- * @error: a #GError
- *
- * This API is only useful where the @fs was created using the
- * #TrackerMinerFS:external-crawler property set to %TRUE. By default
- * this is %FALSE. This allows 3rd party developers to 'push' their
- * data into Tracker to be processed, rather than requiring Tracker to
- * index the content itself by crawling the file system and monitoring
- * changes.
- *
- * This is also very helpful for cases where @file is not based on the
- * local file system (for example a cloud implementation) and you want
- * to tell Tracker about content to index more directly.
- *
- * Returns: %TRUE if successful, otherwise %FALSE and @error will be
- * set if a pointer is supplied.
- *
- * Since: 1.2.
- **/
-gboolean
-tracker_miner_fs_manually_notify_file (TrackerMinerFS       *fs,
-                                       TrackerMinerFSQueue   queue_type,
-                                       GFile                *file,
-                                       GFileType             file_type,
-                                       GError              **error)
-{
-       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 (!priv->external_crawler) {
-               g_set_error (error,
-                            tracker_miner_fs_error_quark (),
-                            TRACKER_MINER_FS_ERROR_HAVE_CRAWLER,
-                            "API can not be used with the internal crawler provided by Tracker");
-               return FALSE;
-       }
-
-       if (!priv->is_paused) {
-               g_set_error (error,
-                            tracker_miner_error_quark (),
-                            TRACKER_MINER_ERROR_PAUSED,
-                            "API can not be used when paused");
-               return FALSE;
-       }
-
-       return tracker_file_notifier_signal_file (fs->priv->file_notifier,
-                                                 queue_type,
-                                                 file,
-                                                 file_type);
-}
-
-
 #ifdef EVENT_QUEUE_ENABLE_TRACE
 
 static void
diff --git a/src/libtracker-miner/tracker-miner-fs.h b/src/libtracker-miner/tracker-miner-fs.h
index 90e0078..709db0b 100644
--- a/src/libtracker-miner/tracker-miner-fs.h
+++ b/src/libtracker-miner/tracker-miner-fs.h
@@ -67,8 +67,10 @@ struct _TrackerMinerFS {
  * @process_file_attributes: Called when the metadata associated with
  * a file's attributes changes, for example, the mtime.
  * @writeback_file: Called when a file must be written back
+ * @query_info: Called when file information is needed, only used with
+ * external crawlers when the file notifier needs information about
+ * the file to know how to cache it or to check on details like mtime.
  * @padding: Reserved for future API improvements.
-
  *
  * Prototype for the abstract class, @process_file must be implemented
  * in the deriving class in order to actually extract data.
@@ -93,6 +95,7 @@ typedef struct {
                                               GFile                *file,
                                               GStrv                 rdf_types,
                                               GPtrArray            *results);
+
        /* <Private> */
        gpointer padding[10];
 } TrackerMinerFSClass;
@@ -118,15 +121,6 @@ typedef enum {
        TRACKER_MINER_FS_ERROR_HAVE_CRAWLER,
 } TrackerMinerFSError;
 
-typedef enum {
-       TRACKER_MINER_FS_QUEUE_NONE,
-       TRACKER_MINER_FS_QUEUE_CREATED,
-       TRACKER_MINER_FS_QUEUE_UPDATED,
-       TRACKER_MINER_FS_QUEUE_DELETED,
-       TRACKER_MINER_FS_QUEUE_MOVED
-} TrackerMinerFSQueue;
-
-
 GType                 tracker_miner_fs_get_type              (void) G_GNUC_CONST;
 GQuark                tracker_miner_fs_error_quark           (void);
 
@@ -202,14 +196,6 @@ gchar                *tracker_miner_fs_query_urn             (TrackerMinerFS  *f
 /* Progress */
 gboolean              tracker_miner_fs_has_items_to_process  (TrackerMinerFS  *fs);
 
-
-/* When using external crawlers, to inject files manually */
-gboolean              tracker_miner_fs_manually_notify_file  (TrackerMinerFS  *fs,
-                                                              TrackerMinerFSQueue queue_type,
-                                                              GFile           *file,
-                                                              GFileType        file_type,
-                                                              GError         **error);
-
 G_END_DECLS
 
 #endif /* __LIBTRACKER_MINER_MINER_FS_H__ */


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