[tracker] tracker-extract: Handle NULL modules
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] tracker-extract: Handle NULL modules
- Date: Tue, 4 Aug 2015 17:39:31 +0000 (UTC)
commit 82656fec6b118731b0d49ea763c836e56c9af58a
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue Aug 4 18:49:57 2015 +0200
tracker-extract: Handle NULL modules
This will be necessary when we have an internal dummy function.
src/tracker-extract/tracker-extract.c | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/src/tracker-extract/tracker-extract.c b/src/tracker-extract/tracker-extract.c
index 6a2fec9..4e6a7eb 100644
--- a/src/tracker-extract/tracker-extract.c
+++ b/src/tracker-extract/tracker-extract.c
@@ -323,7 +323,10 @@ get_file_metadata (TrackerExtractTask *task,
if (task->cur_func) {
TrackerSparqlBuilder *statements;
- g_debug ("Using %s...", g_module_name (task->cur_module));
+ g_debug ("Using %s...",
+ task->cur_module ?
+ g_module_name (task->cur_module) :
+ "Dummy extraction");
success = (task->cur_func) (info);
@@ -466,6 +469,10 @@ filter_module (TrackerExtract *extract,
gchar *module_basename, *filter_name;
gboolean filter;
+ if (!module) {
+ return FALSE;
+ }
+
priv = TRACKER_EXTRACT_GET_PRIVATE (extract);
if (!priv->force_module) {
@@ -620,7 +627,7 @@ dispatch_task_cb (TrackerExtractTask *task)
task->cur_module = module = tracker_mimetype_info_get_module (task->mimetype_handlers,
&task->cur_func, &thread_awareness);
- if (!module || !task->cur_func) {
+ if (!task->cur_func) {
g_warning ("Discarding task, no module able to handle '%s'", task->file);
priv->unhandled_count++;
extract_task_free (task);
@@ -797,7 +804,7 @@ tracker_extract_get_metadata_by_cmdline (TrackerExtract *object,
task->mimetype_handlers = tracker_extract_module_manager_get_mimetype_handlers (task->mimetype);
task->cur_module = tracker_mimetype_info_get_module (task->mimetype_handlers, &task->cur_func, NULL);
- while (task->cur_module && task->cur_func) {
+ while (task->cur_func) {
if (!filter_module (object, task->cur_module) &&
get_file_metadata (task, &info)) {
const gchar *preupdate_str, *postupdate_str, *statements_str, *where;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]