tracker r2175 - in branches/indexer-split: . src/libtracker-common
- From: ifrade svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r2175 - in branches/indexer-split: . src/libtracker-common
- Date: Wed, 27 Aug 2008 17:38:25 +0000 (UTC)
Author: ifrade
Date: Wed Aug 27 17:38:25 2008
New Revision: 2175
URL: http://svn.gnome.org/viewvc/tracker?rev=2175&view=rev
Log:
Handling correctly categories with empty parent name in tracker-ontology
Modified:
branches/indexer-split/ChangeLog
branches/indexer-split/src/libtracker-common/tracker-ontology.c
Modified: branches/indexer-split/src/libtracker-common/tracker-ontology.c
==============================================================================
--- branches/indexer-split/src/libtracker-common/tracker-ontology.c (original)
+++ branches/indexer-split/src/libtracker-common/tracker-ontology.c Wed Aug 27 17:38:25 2008
@@ -526,17 +526,16 @@
/* Prefix for properties of the parent */
parent_name = tracker_ontology_get_parent_service (service_type);
- if (parent_name) {
+ if (parent_name && (g_strcmp0 (parent_name, " ") != 0)) {
parent = tracker_ontology_get_service_type_by_name (parent_name);
- if (!parent) {
- g_critical ("Category %s (set as %s parent) is not in the ontology",
- parent_name, service_type);
- }
- parent_prefix = tracker_service_get_property_prefix (parent);
+ if (parent) {
+
+ parent_prefix = tracker_service_get_property_prefix (parent);
- if (!parent_prefix || g_strcmp0 (parent_prefix, " ") == 0) {
- parent_prefix = parent_name;
+ if (!parent_prefix || g_strcmp0 (parent_prefix, " ") == 0) {
+ parent_prefix = parent_name;
+ }
}
}
}
@@ -550,8 +549,8 @@
const gchar *name = tracker_field_get_name (field);
if (service_type == NULL
- || g_str_has_prefix (name, prefix)
- || g_str_has_prefix (name, parent_prefix)) {
+ || (prefix && g_str_has_prefix (name, prefix))
+ || (parent_prefix && g_str_has_prefix (name, parent_prefix))) {
names = g_slist_prepend (names, g_strdup (name));
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]