[tracker/libtracker-miner] Add vmethods for checking/processing a file.
- From: Carlos Garnacho <carlosg src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [tracker/libtracker-miner] Add vmethods for checking/processing a file.
- Date: Fri, 31 Jul 2009 13:58:16 +0000 (UTC)
commit 7366ca6d01ca8c2e13975d0c259340cb353d2217
Author: Carlos Garnacho <carlos lanedo com>
Date: Fri Jul 31 15:52:35 2009 +0200
Add vmethods for checking/processing a file.
* "check-file" will tell TrakerMinerCrawler whether some file should be
processed.
* "process-file" will do the processing.
src/libtracker-miner/tracker-marshal.list | 1 +
src/libtracker-miner/tracker-miner-crawler.c | 27 ++++++++++++++++++++++++++
src/libtracker-miner/tracker-miner-crawler.h | 6 +++++
3 files changed, 34 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-marshal.list b/src/libtracker-miner/tracker-marshal.list
index 5bba08b..2be75a7 100644
--- a/src/libtracker-miner/tracker-marshal.list
+++ b/src/libtracker-miner/tracker-marshal.list
@@ -6,3 +6,4 @@ VOID:STRING,BOOL
VOID:STRING,OBJECT
VOID:STRING,UINT,UINT,UINT,UINT
VOID:POINTER,STRING,STRING,STRING,STRING
+BOOL:OBJECT
diff --git a/src/libtracker-miner/tracker-miner-crawler.c b/src/libtracker-miner/tracker-miner-crawler.c
index 65edcd4..16c5b2b 100644
--- a/src/libtracker-miner/tracker-miner-crawler.c
+++ b/src/libtracker-miner/tracker-miner-crawler.c
@@ -25,6 +25,7 @@
#include "tracker-miner-crawler.h"
#include "tracker-config.h"
#include "tracker-processor.h"
+#include "tracker-marshal.h"
#define TRACKER_MINER_CRAWLER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), TRACKER_TYPE_MINER_CRAWLER, TrackerMinerCrawlerPrivate))
@@ -45,6 +46,15 @@ struct TrackerMinerCrawlerPrivate {
GArray *dirs;
};
+enum {
+ CHECK_FILE,
+ PROCESS_FILE,
+ LAST_SIGNAL
+};
+
+static guint signals[LAST_SIGNAL] = { 0 };
+
+
static void tracker_miner_crawler_finalize (GObject *object);
static void tracker_miner_crawler_started (TrackerMiner *miner);
@@ -68,6 +78,23 @@ tracker_miner_crawler_class_init (TrackerMinerCrawlerClass *klass)
miner_class->resumed = tracker_miner_crawler_resumed;
*/
+ signals[CHECK_FILE] =
+ g_signal_new ("check-file",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (TrackerMinerCrawlerClass, check_file),
+ NULL, NULL,
+ tracker_marshal_BOOLEAN__OBJECT,
+ G_TYPE_BOOLEAN, 1, G_TYPE_FILE);
+ signals[PROCESS_FILE] =
+ g_signal_new ("process-file",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (TrackerMinerCrawlerClass, process_file),
+ NULL, NULL,
+ tracker_marshal_BOOLEAN__OBJECT,
+ G_TYPE_BOOLEAN, 1, G_TYPE_FILE);
+
g_type_class_add_private (object_class, sizeof (TrackerMinerCrawlerPrivate));
}
diff --git a/src/libtracker-miner/tracker-miner-crawler.h b/src/libtracker-miner/tracker-miner-crawler.h
index 6d76cf5..c157a60 100644
--- a/src/libtracker-miner/tracker-miner-crawler.h
+++ b/src/libtracker-miner/tracker-miner-crawler.h
@@ -25,6 +25,7 @@
#include "config.h"
#include "tracker-miner.h"
+#include <gio/gio.h>
G_BEGIN_DECLS
@@ -45,6 +46,11 @@ struct TrackerMinerCrawler {
struct TrackerMinerCrawlerClass {
TrackerMinerClass parent_class;
+
+ gboolean (* check_file) (TrackerMinerCrawler *miner,
+ GFile *file);
+ gboolean (* process_file) (TrackerMinerCrawler *miner,
+ GFile *file);
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]