[tracker] libtracker-extract: Add builtin dummy extractor
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] libtracker-extract: Add builtin dummy extractor
- Date: Tue, 4 Aug 2015 17:39:46 +0000 (UTC)
commit 51e2021fa150e4f4d463ed4baf16051fc54e4fda
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue Aug 4 18:57:33 2015 +0200
libtracker-extract: Add builtin dummy extractor
For rules with no ModulePath key (i.e. those we only want to set
rdf:types for) we relied on the lack of generic extractors that
might handle the mimetype.
If there was one such generic extractor, the TrackerMimetypeInfo
iterator would skip the empty rule and directly attempt the generic
extractor.
Because it is conceivable that no-op is desired for some files,
we shouldn't attempt to skip it, nor run further modules after the
dummy rules, so just give this dummy fastpath a presence that
tracker-extract will make sense of.
src/libtracker-extract/tracker-module-manager.c | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/src/libtracker-extract/tracker-module-manager.c b/src/libtracker-extract/tracker-module-manager.c
index a7a8ef9..b28ad56 100644
--- a/src/libtracker-extract/tracker-module-manager.c
+++ b/src/libtracker-extract/tracker-module-manager.c
@@ -42,6 +42,13 @@ typedef struct {
guint initialized : 1;
} ModuleInfo;
+static gboolean dummy_extract_func (TrackerExtractInfo *info);
+
+static ModuleInfo dummy_module = {
+ NULL, TRACKER_MODULE_MAIN_THREAD,
+ dummy_extract_func, NULL, TRUE
+};
+
static GHashTable *modules = NULL;
static GHashTable *mimetype_map = NULL;
static gboolean initialized = FALSE;
@@ -55,6 +62,12 @@ struct _TrackerMimetypeInfo {
};
static gboolean
+dummy_extract_func (TrackerExtractInfo *info)
+{
+ return TRUE;
+}
+
+static gboolean
load_extractor_rule (GKeyFile *key_file,
GError **error)
{
@@ -307,7 +320,7 @@ load_module (RuleInfo *info,
ModuleInfo *module_info = NULL;
if (!info->module_path) {
- return NULL;
+ return &dummy_module;
}
if (modules) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]