[tracker/writeback: 14/16] TrackerWritebackDispatcher: add sanity check on returned metadata.
- From: Philip Van Hoof <pvanhoof src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [tracker/writeback: 14/16] TrackerWritebackDispatcher: add sanity check on returned metadata.
- Date: Sun, 22 Nov 2009 12:53:34 +0000 (UTC)
commit 825a38364b9d98c1488bd1934744d9a28e4146b2
Author: Carlos Garnacho <carlos lanedo com>
Date: Wed Nov 18 11:56:50 2009 +0100
TrackerWritebackDispatcher: add sanity check on returned metadata.
.../tracker-writeback-dispatcher.c | 27 +++++++++++---------
1 files changed, 15 insertions(+), 12 deletions(-)
---
diff --git a/src/tracker-writeback/tracker-writeback-dispatcher.c b/src/tracker-writeback/tracker-writeback-dispatcher.c
index a107c0b..f0d62c2 100644
--- a/src/tracker-writeback/tracker-writeback-dispatcher.c
+++ b/src/tracker-writeback/tracker-writeback-dispatcher.c
@@ -286,24 +286,27 @@ on_sparql_result_received (GPtrArray *result,
gchar **rdf_types;
data = user_data;
- rdf_types = data->rdf_types;
- priv = TRACKER_WRITEBACK_DISPATCHER_GET_PRIVATE (data->dispatcher);
- g_hash_table_iter_init (&iter, priv->modules);
+ if (result && result->len > 0) {
+ rdf_types = data->rdf_types;
+ priv = TRACKER_WRITEBACK_DISPATCHER_GET_PRIVATE (data->dispatcher);
- while (g_hash_table_iter_next (&iter, &key, &value)) {
- module = value;
+ g_hash_table_iter_init (&iter, priv->modules);
- module_types = tracker_writeback_module_get_rdftypes (module);
+ while (g_hash_table_iter_next (&iter, &key, &value)) {
+ module = value;
- if (types_match (module_types, rdf_types)) {
- TrackerWriteback *writeback;
+ module_types = tracker_writeback_module_get_rdftypes (module);
- writeback = tracker_writeback_module_create (module);
- tracker_writeback_update_metadata (writeback, result);
- g_object_unref (writeback);
- }
+ if (types_match (module_types, rdf_types)) {
+ TrackerWriteback *writeback;
+ writeback = tracker_writeback_module_create (module);
+ tracker_writeback_update_metadata (writeback, result);
+ g_object_unref (writeback);
+ }
+
+ }
}
g_strfreev (data->rdf_types);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]