summaryrefslogtreecommitdiff
path: root/src/libtracker-data/tracker-class.c
diff options
context:
space:
mode:
authorPhilip Van Hoof <philip@codeminded.be>2010-06-29 14:22:32 +0200
committerPhilip Van Hoof <philip@codeminded.be>2010-07-16 10:44:44 +0200
commit4dbcef0d5281cb190837a9d39ace9c1807b47537 (patch)
treeec4548e2fb2ce8b2329f3073c1f0bd5516dd893b /src/libtracker-data/tracker-class.c
parent36a4ca4b678152ceb267df17a7d30b8ece0b24f7 (diff)
downloadtracker-4dbcef0d5281cb190837a9d39ace9c1807b47537.tar.gz
libtracker-data: Added tracker:domainIndex property
In this commit the tracker:domainIndex property has no function yet. It'll be implemented to represent a setting that will make the storage redundantly store a property in the table of its domain, in order to allow placing an index on the column for that table. For example nmm:MusicPiece has a domain-index on nie:title. This will make it store a redundent copy of nie:title in nmm:MusicPiece's SQL table, while also having a copy in nie:InformationElement's table. The advantage is a less complex query and the possibility to set an index on the redundant column in nmm:MusicPiece's table.
Diffstat (limited to 'src/libtracker-data/tracker-class.c')
-rw-r--r--src/libtracker-data/tracker-class.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/src/libtracker-data/tracker-class.c b/src/libtracker-data/tracker-class.c
index 112186ec5..49a8e6dfa 100644
--- a/src/libtracker-data/tracker-class.c
+++ b/src/libtracker-data/tracker-class.c
@@ -42,6 +42,7 @@ struct _TrackerClassPrivate {
gboolean notify;
GArray *super_classes;
+ GArray *domain_indexes;
};
static void class_finalize (GObject *object);
@@ -67,6 +68,7 @@ tracker_class_init (TrackerClass *service)
priv->id = 0;
priv->super_classes = g_array_new (TRUE, TRUE, sizeof (TrackerClass *));
+ priv->domain_indexes = g_array_new (TRUE, TRUE, sizeof (TrackerProperty *));
/* Make GET_PRIV working */
service->priv = priv;
@@ -83,6 +85,7 @@ class_finalize (GObject *object)
g_free (priv->name);
g_array_free (priv->super_classes, TRUE);
+ g_array_free (priv->domain_indexes, TRUE);
(G_OBJECT_CLASS (tracker_class_parent_class)->finalize) (object);
}
@@ -157,6 +160,18 @@ tracker_class_get_super_classes (TrackerClass *service)
return (TrackerClass **) priv->super_classes->data;
}
+TrackerProperty **
+tracker_class_get_domain_indexes (TrackerClass *service)
+{
+ TrackerClassPrivate *priv;
+
+ g_return_val_if_fail (TRACKER_IS_CLASS (service), NULL);
+
+ priv = GET_PRIV (service);
+
+ return (TrackerProperty **) priv->domain_indexes->data;
+}
+
gboolean
tracker_class_get_is_new (TrackerClass *service)
{
@@ -261,7 +276,6 @@ tracker_class_set_id (TrackerClass *service,
priv->id = value;
}
-
void
tracker_class_add_super_class (TrackerClass *service,
TrackerClass *value)
@@ -277,6 +291,20 @@ tracker_class_add_super_class (TrackerClass *service,
}
void
+tracker_class_add_domain_index (TrackerClass *service,
+ TrackerProperty *value)
+{
+ TrackerClassPrivate *priv;
+
+ g_return_if_fail (TRACKER_IS_CLASS (service));
+ g_return_if_fail (TRACKER_IS_PROPERTY (value));
+
+ priv = GET_PRIV (service);
+
+ g_array_append_val (priv->domain_indexes, value);
+}
+
+void
tracker_class_set_is_new (TrackerClass *service,
gboolean value)
{
@@ -289,6 +317,7 @@ tracker_class_set_is_new (TrackerClass *service,
priv->is_new = value;
}
+
void
tracker_class_set_notify (TrackerClass *service,
gboolean value)