[tracker/ontologies: 2/2] Move ontology API from libtracker-common to libtracker-data
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/ontologies: 2/2] Move ontology API from libtracker-common to libtracker-data
- Date: Fri, 12 Mar 2010 13:51:15 +0000 (UTC)
commit 77532044a0517f4e336e720110d1aaf551216e99
Author: Jürg Billeter <j bitron ch>
Date: Fri Mar 12 13:19:05 2010 +0100
Move ontology API from libtracker-common to libtracker-data
src/libtracker-common/Makefile.am | 9 ---
src/libtracker-common/libtracker-common.vapi | 46 ---------------
src/libtracker-common/tracker-common.h | 4 -
src/libtracker-common/tracker-ontologies.h | 29 ---------
src/libtracker-data/Makefile.am | 10 +++
src/libtracker-data/libtracker-data.vapi | 46 +++++++++++++++
.../tracker-class.c | 0
.../tracker-class.h | 10 ++--
src/libtracker-data/tracker-data-manager.c | 7 ++
src/libtracker-data/tracker-data-query.c | 2 +
src/libtracker-data/tracker-data-query.h | 4 -
src/libtracker-data/tracker-data-update.c | 3 +
src/libtracker-data/tracker-data.h | 9 ++-
.../tracker-namespace.c | 0
.../tracker-namespace.h | 10 ++--
.../tracker-ontologies.c | 0
src/libtracker-data/tracker-ontologies.h | 61 ++++++++++++++++++++
.../tracker-ontology.c | 0
.../tracker-ontology.h | 10 ++--
.../tracker-property.c | 2 +
.../tracker-property.h | 10 ++--
src/libtracker-fts/tracker-fts.c | 7 ++-
src/libtracker-fts/tracker-fts.h | 3 +
src/tracker-store/tracker-dbus.c | 3 +-
src/tracker-store/tracker-events.c | 2 +-
src/tracker-store/tracker-events.h | 3 +-
src/tracker-store/tracker-statistics.c | 2 +-
src/tracker-store/tracker-writeback.c | 2 +-
28 files changed, 171 insertions(+), 123 deletions(-)
---
diff --git a/src/libtracker-common/Makefile.am b/src/libtracker-common/Makefile.am
index e716cad..8ea263a 100644
--- a/src/libtracker-common/Makefile.am
+++ b/src/libtracker-common/Makefile.am
@@ -49,7 +49,6 @@ libtracker_common_la_SOURCES = \
$(os_sources) \
$(power_sources) \
tracker-config-file.c \
- tracker-class.c \
tracker-date-time.c \
tracker-dbus.c \
tracker-file-utils.c \
@@ -57,10 +56,6 @@ libtracker_common_la_SOURCES = \
tracker-keyfile-object.c \
tracker-language.c \
tracker-log.c \
- tracker-namespace.c \
- tracker-ontology.c \
- tracker-ontologies.c \
- tracker-property.c \
tracker-type-utils.c \
tracker-utils.c \
tracker-crc32.c \
@@ -73,17 +68,13 @@ noinst_HEADERS = \
tracker-ioprio.h \
tracker-log.h \
tracker-os-dependant.h \
- tracker-class.h \
tracker-config-file.h \
tracker-common.h \
tracker-date-time.h \
tracker-file-utils.h \
tracker-keyfile-object.h \
tracker-language.h \
- tracker-namespace.h \
- tracker-ontology.h \
tracker-ontologies.h \
- tracker-property.h \
tracker-turtle-writer.h \
tracker-type-utils.h \
tracker-utils.h \
diff --git a/src/libtracker-common/libtracker-common.vapi b/src/libtracker-common/libtracker-common.vapi
index e437d95..b1d738d 100644
--- a/src/libtracker-common/libtracker-common.vapi
+++ b/src/libtracker-common/libtracker-common.vapi
@@ -18,52 +18,6 @@
*/
namespace Tracker {
- [CCode (cheader_filename = "libtracker-common/tracker-class.h")]
- public class Class : GLib.Object {
- public string name { get; set; }
- public string uri { get; set; }
- [CCode (array_length = false, array_null_terminated = true)]
- public unowned Class[] get_super_classes ();
- }
-
- [CCode (cheader_filename = "libtracker-common/tracker-namespace.h")]
- public class Namespace : GLib.Object {
- public string prefix { get; set; }
- public string uri { get; set; }
- }
-
- [CCode (cheader_filename = "libtracker-common/tracker-property.h")]
- public class Property : GLib.Object {
- public string name { get; set; }
- public string uri { get; set; }
- public PropertyType data_type { get; set; }
- public Class domain { get; set; }
- public Class range { get; set; }
- public bool multiple_values { get; set; }
- public bool is_inverse_functional_property { get; set; }
- }
-
- [CCode (cheader_filename = "libtracker-common/tracker-property.h")]
- public enum PropertyType {
- UNKNOWN,
- STRING,
- BOOLEAN,
- INTEGER,
- DOUBLE,
- DATE,
- DATETIME,
- RESOURCE
- }
-
- [CCode (cheader_filename = "libtracker-common/tracker-ontologies.h")]
- namespace Ontologies {
- public weak Class get_class_by_uri (string class_uri);
- public weak Property get_property_by_uri (string property_uri);
- public weak Namespace[] get_namespaces ();
- public weak Class[] get_classes ();
- public weak Property[] get_properties ();
- }
-
[CCode (cheader_filename = "libtracker-common/tracker-date-time.h")]
public int string_to_date (string date_string, out int offset) throws DateError;
diff --git a/src/libtracker-common/tracker-common.h b/src/libtracker-common/tracker-common.h
index 2892b55..5b3a4d8 100644
--- a/src/libtracker-common/tracker-common.h
+++ b/src/libtracker-common/tracker-common.h
@@ -28,7 +28,6 @@
#define __LIBTRACKER_COMMON_INSIDE__
-#include "tracker-class.h"
#include "tracker-config-file.h"
#include "tracker-date-time.h"
#include "tracker-dbus.h"
@@ -37,12 +36,9 @@
#include "tracker-keyfile-object.h"
#include "tracker-language.h"
#include "tracker-log.h"
-#include "tracker-namespace.h"
-#include "tracker-ontology.h"
#include "tracker-ontologies.h"
#include "tracker-os-dependant.h"
#include "tracker-power.h"
-#include "tracker-property.h"
#include "tracker-type-utils.h"
#include "tracker-utils.h"
diff --git a/src/libtracker-common/tracker-ontologies.h b/src/libtracker-common/tracker-ontologies.h
index ec9e58f..f751d64 100644
--- a/src/libtracker-common/tracker-ontologies.h
+++ b/src/libtracker-common/tracker-ontologies.h
@@ -21,13 +21,6 @@
#ifndef __LIBTRACKER_COMMON_ONTOLOGIES_H__
#define __LIBTRACKER_COMMON_ONTOLOGIES_H__
-#include <glib-object.h>
-
-#include "tracker-class.h"
-#include "tracker-namespace.h"
-#include "tracker-ontology.h"
-#include "tracker-property.h"
-
G_BEGIN_DECLS
#if !defined (__LIBTRACKER_COMMON_INSIDE__) && !defined (TRACKER_COMPILATION)
@@ -60,28 +53,6 @@ G_BEGIN_DECLS
#define TRACKER_NON_REMOVABLE_MEDIA_DATASOURCE_URN \
TRACKER_DATASOURCE_URN_PREFIX "9291a450-1d49-11de-8c30-0800200c9a66"
-void tracker_ontologies_init (void);
-void tracker_ontologies_shutdown (void);
-
-/* Service mechanics */
-void tracker_ontologies_add_class (TrackerClass *service);
-TrackerClass * tracker_ontologies_get_class_by_uri (const gchar *service_uri);
-TrackerNamespace **tracker_ontologies_get_namespaces (guint *length);
-TrackerOntology **tracker_ontologies_get_ontologies (guint *length);
-TrackerClass ** tracker_ontologies_get_classes (guint *length);
-TrackerProperty ** tracker_ontologies_get_properties (guint *length);
-
-/* Field mechanics */
-void tracker_ontologies_add_property (TrackerProperty *field);
-TrackerProperty * tracker_ontologies_get_property_by_uri (const gchar *uri);
-void tracker_ontologies_add_namespace (TrackerNamespace *namespace_);
-void tracker_ontologies_add_ontology (TrackerOntology *ontology);
-TrackerNamespace * tracker_ontologies_get_namespace_by_uri (const gchar *namespace_uri);
-TrackerOntology * tracker_ontologies_get_ontology_by_uri (const gchar *namespace_uri);
-const gchar* tracker_ontologies_get_uri_by_id (gint id);
-void tracker_ontologies_add_id_uri_pair (gint id,
- const gchar *uri);
-
G_END_DECLS
#endif /* __LIBTRACKER_COMMON_ONTOLOGY_H__ */
diff --git a/src/libtracker-data/Makefile.am b/src/libtracker-data/Makefile.am
index 4688d19..f12e8fa 100644
--- a/src/libtracker-data/Makefile.am
+++ b/src/libtracker-data/Makefile.am
@@ -23,19 +23,29 @@ libtracker_data_la_VALASOURCES = \
tracker-turtle-reader.vala
libtracker_data_la_SOURCES = \
+ tracker-class.c \
tracker-data-backup.c \
tracker-data-manager.c \
tracker-data-query.c \
tracker-data-update.c \
+ tracker-namespace.c \
+ tracker-ontology.c \
+ tracker-ontologies.c \
+ tracker-property.c \
libtracker-data.vala.stamp \
$(libtracker_data_la_VALASOURCES:.vala=.c)
noinst_HEADERS = \
+ tracker-class.h \
tracker-data.h \
tracker-data-backup.h \
tracker-data-manager.h \
tracker-data-query.h \
tracker-data-update.h \
+ tracker-namespace.h \
+ tracker-ontology.h \
+ tracker-ontologies.h \
+ tracker-property.h \
tracker-sparql-query.h
vapi_sources = \
diff --git a/src/libtracker-data/libtracker-data.vapi b/src/libtracker-data/libtracker-data.vapi
index 490612c..467c2de 100644
--- a/src/libtracker-data/libtracker-data.vapi
+++ b/src/libtracker-data/libtracker-data.vapi
@@ -18,6 +18,52 @@
*/
namespace Tracker {
+ [CCode (cheader_filename = "libtracker-data/tracker-class.h")]
+ public class Class : GLib.Object {
+ public string name { get; set; }
+ public string uri { get; set; }
+ [CCode (array_length = false, array_null_terminated = true)]
+ public unowned Class[] get_super_classes ();
+ }
+
+ [CCode (cheader_filename = "libtracker-data/tracker-namespace.h")]
+ public class Namespace : GLib.Object {
+ public string prefix { get; set; }
+ public string uri { get; set; }
+ }
+
+ [CCode (cheader_filename = "libtracker-data/tracker-property.h")]
+ public class Property : GLib.Object {
+ public string name { get; set; }
+ public string uri { get; set; }
+ public PropertyType data_type { get; set; }
+ public Class domain { get; set; }
+ public Class range { get; set; }
+ public bool multiple_values { get; set; }
+ public bool is_inverse_functional_property { get; set; }
+ }
+
+ [CCode (cheader_filename = "libtracker-data/tracker-property.h")]
+ public enum PropertyType {
+ UNKNOWN,
+ STRING,
+ BOOLEAN,
+ INTEGER,
+ DOUBLE,
+ DATE,
+ DATETIME,
+ RESOURCE
+ }
+
+ [CCode (cheader_filename = "libtracker-data/tracker-ontologies.h")]
+ namespace Ontologies {
+ public weak Class get_class_by_uri (string class_uri);
+ public weak Property get_property_by_uri (string property_uri);
+ public weak Namespace[] get_namespaces ();
+ public weak Class[] get_classes ();
+ public weak Property[] get_properties ();
+ }
+
[CCode (cheader_filename = "libtracker-data/tracker-data-update.h")]
public errordomain DataError {
UNKNOWN_CLASS,
diff --git a/src/libtracker-common/tracker-class.c b/src/libtracker-data/tracker-class.c
similarity index 100%
rename from src/libtracker-common/tracker-class.c
rename to src/libtracker-data/tracker-class.c
diff --git a/src/libtracker-common/tracker-class.h b/src/libtracker-data/tracker-class.h
similarity index 91%
rename from src/libtracker-common/tracker-class.h
rename to src/libtracker-data/tracker-class.h
index 672d3ce..1d13571 100644
--- a/src/libtracker-common/tracker-class.h
+++ b/src/libtracker-data/tracker-class.h
@@ -18,15 +18,15 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef __LIBTRACKER_COMMON_CLASS_H__
-#define __LIBTRACKER_COMMON_CLASS_H__
+#ifndef __LIBTRACKER_DATA_CLASS_H__
+#define __LIBTRACKER_DATA_CLASS_H__
#include <glib-object.h>
G_BEGIN_DECLS
-#if !defined (__LIBTRACKER_COMMON_INSIDE__) && !defined (TRACKER_COMPILATION)
-#error "only <libtracker-common/tracker-common.h> must be included directly."
+#if !defined (__LIBTRACKER_DATA_INSIDE__) && !defined (TRACKER_COMPILATION)
+#error "only <libtracker-data/tracker-data.h> must be included directly."
#endif
#define TRACKER_TYPE_CLASS (tracker_class_get_type ())
@@ -71,5 +71,5 @@ void tracker_class_set_is_new (TrackerClass *service,
G_END_DECLS
-#endif /* __LIBTRACKER_COMMON_CLASS_H__ */
+#endif /* __LIBTRACKER_DATA_CLASS_H__ */
diff --git a/src/libtracker-data/tracker-data-manager.c b/src/libtracker-data/tracker-data-manager.c
index 13e75c8..3923dc2 100644
--- a/src/libtracker-data/tracker-data-manager.c
+++ b/src/libtracker-data/tracker-data-manager.c
@@ -38,8 +38,13 @@
#include <libtracker-db/tracker-db-manager.h>
#include <libtracker-db/tracker-db-journal.h>
+#include "tracker-class.h"
#include "tracker-data-manager.h"
#include "tracker-data-update.h"
+#include "tracker-namespace.h"
+#include "tracker-ontologies.h"
+#include "tracker-ontology.h"
+#include "tracker-property.h"
#include "tracker-sparql-query.h"
#define RDF_PREFIX TRACKER_RDF_PREFIX
@@ -1581,6 +1586,8 @@ tracker_data_manager_init (TrackerDBManagerFlags flags,
return FALSE;
}
+ tracker_fts_set_map_function (tracker_ontologies_get_uri_by_id);
+
if (first_time != NULL) {
*first_time = is_first_time_index;
}
diff --git a/src/libtracker-data/tracker-data-query.c b/src/libtracker-data/tracker-data-query.c
index 0df31c3..a6cf199 100644
--- a/src/libtracker-data/tracker-data-query.c
+++ b/src/libtracker-data/tracker-data-query.c
@@ -31,8 +31,10 @@
#include <libtracker-db/tracker-db-interface-sqlite.h>
#include <libtracker-db/tracker-db-manager.h>
+#include "tracker-class.h"
#include "tracker-data-manager.h"
#include "tracker-data-query.h"
+#include "tracker-ontologies.h"
#include "tracker-sparql-query.h"
GPtrArray*
diff --git a/src/libtracker-data/tracker-data-query.h b/src/libtracker-data/tracker-data-query.h
index 6932813..0c0a839 100644
--- a/src/libtracker-data/tracker-data-query.h
+++ b/src/libtracker-data/tracker-data-query.h
@@ -25,10 +25,6 @@
#include <glib.h>
-#include <libtracker-common/tracker-language.h>
-#include <libtracker-common/tracker-ontologies.h>
-#include <libtracker-common/tracker-property.h>
-
#include <libtracker-db/tracker-db-interface.h>
G_BEGIN_DECLS
diff --git a/src/libtracker-data/tracker-data-update.c b/src/libtracker-data/tracker-data-update.c
index 51a57fd..77ecbc7 100644
--- a/src/libtracker-data/tracker-data-update.c
+++ b/src/libtracker-data/tracker-data-update.c
@@ -35,9 +35,12 @@
#include <libtracker-db/tracker-db-dbus.h>
#include <libtracker-db/tracker-db-journal.h>
+#include "tracker-class.h"
#include "tracker-data-manager.h"
#include "tracker-data-update.h"
#include "tracker-data-query.h"
+#include "tracker-ontologies.h"
+#include "tracker-property.h"
#include "tracker-sparql-query.h"
#define RDF_PREFIX TRACKER_RDF_PREFIX
diff --git a/src/libtracker-data/tracker-data.h b/src/libtracker-data/tracker-data.h
index 5ba037c..e84f7e6 100644
--- a/src/libtracker-data/tracker-data.h
+++ b/src/libtracker-data/tracker-data.h
@@ -20,22 +20,23 @@
#ifndef __LIBTRACKER_DATA_H__
#define __LIBTRACKER_DATA_H__
-G_BEGIN_DECLS
-
#if !defined (TRACKER_ENABLE_INTERNALS) && !defined (TRACKER_COMPILATION)
#error "TRACKER_ENABLE_INTERNALS not defined, this must be defined to use tracker's internal functions"
#endif
#define __LIBTRACKER_DATA_INSIDE__
+#include "tracker-class.h"
#include "tracker-data-backup.h"
#include "tracker-data-manager.h"
#include "tracker-data-query.h"
#include "tracker-data-update.h"
+#include "tracker-namespace.h"
+#include "tracker-ontology.h"
+#include "tracker-ontologies.h"
+#include "tracker-property.h"
#include "tracker-sparql-query.h"
#undef __LIBTRACKER_DATA_INSIDE__
-G_END_DECLS
-
#endif /* __LIBTRACKER_DATA_H__ */
diff --git a/src/libtracker-common/tracker-namespace.c b/src/libtracker-data/tracker-namespace.c
similarity index 100%
rename from src/libtracker-common/tracker-namespace.c
rename to src/libtracker-data/tracker-namespace.c
diff --git a/src/libtracker-common/tracker-namespace.h b/src/libtracker-data/tracker-namespace.h
similarity index 89%
rename from src/libtracker-common/tracker-namespace.h
rename to src/libtracker-data/tracker-namespace.h
index 9265cae..f3202c3 100644
--- a/src/libtracker-common/tracker-namespace.h
+++ b/src/libtracker-data/tracker-namespace.h
@@ -17,15 +17,15 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef __LIBTRACKER_COMMON_NAMESPACE_H__
-#define __LIBTRACKER_COMMON_NAMESPACE_H__
+#ifndef __LIBTRACKER_DATA_NAMESPACE_H__
+#define __LIBTRACKER_DATA_NAMESPACE_H__
#include <glib-object.h>
G_BEGIN_DECLS
-#if !defined (__LIBTRACKER_COMMON_INSIDE__) && !defined (TRACKER_COMPILATION)
-#error "only <libtracker-common/tracker-common.h> must be included directly."
+#if !defined (__LIBTRACKER_DATA_INSIDE__) && !defined (TRACKER_COMPILATION)
+#error "only <libtracker-data/tracker-data.h> must be included directly."
#endif
#define TRACKER_TYPE_NAMESPACE (tracker_namespace_get_type ())
@@ -61,5 +61,5 @@ void tracker_namespace_set_is_new (TrackerNamespace *namespace_,
G_END_DECLS
-#endif /* __LIBTRACKER_COMMON_NAMESPACE_H__ */
+#endif /* __LIBTRACKER_DATA_NAMESPACE_H__ */
diff --git a/src/libtracker-common/tracker-ontologies.c b/src/libtracker-data/tracker-ontologies.c
similarity index 100%
rename from src/libtracker-common/tracker-ontologies.c
rename to src/libtracker-data/tracker-ontologies.c
diff --git a/src/libtracker-data/tracker-ontologies.h b/src/libtracker-data/tracker-ontologies.h
new file mode 100644
index 0000000..62e1184
--- /dev/null
+++ b/src/libtracker-data/tracker-ontologies.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2006, Mr Jamie McCracken (jamiemcc gnome org)
+ * Copyright (C) 2008, Nokia (urho konttori nokia com)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __LIBTRACKER_DATA_ONTOLOGIES_H__
+#define __LIBTRACKER_DATA_ONTOLOGIES_H__
+
+#include <glib-object.h>
+
+#include "tracker-class.h"
+#include "tracker-namespace.h"
+#include "tracker-ontology.h"
+#include "tracker-property.h"
+
+G_BEGIN_DECLS
+
+#if !defined (__LIBTRACKER_DATA_INSIDE__) && !defined (TRACKER_COMPILATION)
+#error "only <libtracker-data/tracker-data.h> must be included directly."
+#endif
+
+void tracker_ontologies_init (void);
+void tracker_ontologies_shutdown (void);
+
+/* Service mechanics */
+void tracker_ontologies_add_class (TrackerClass *service);
+TrackerClass * tracker_ontologies_get_class_by_uri (const gchar *service_uri);
+TrackerNamespace **tracker_ontologies_get_namespaces (guint *length);
+TrackerOntology **tracker_ontologies_get_ontologies (guint *length);
+TrackerClass ** tracker_ontologies_get_classes (guint *length);
+TrackerProperty ** tracker_ontologies_get_properties (guint *length);
+
+/* Field mechanics */
+void tracker_ontologies_add_property (TrackerProperty *field);
+TrackerProperty * tracker_ontologies_get_property_by_uri (const gchar *uri);
+void tracker_ontologies_add_namespace (TrackerNamespace *namespace_);
+void tracker_ontologies_add_ontology (TrackerOntology *ontology);
+TrackerNamespace * tracker_ontologies_get_namespace_by_uri (const gchar *namespace_uri);
+TrackerOntology * tracker_ontologies_get_ontology_by_uri (const gchar *namespace_uri);
+const gchar* tracker_ontologies_get_uri_by_id (gint id);
+void tracker_ontologies_add_id_uri_pair (gint id,
+ const gchar *uri);
+
+G_END_DECLS
+
+#endif /* __LIBTRACKER_DATA_ONTOLOGY_H__ */
diff --git a/src/libtracker-common/tracker-ontology.c b/src/libtracker-data/tracker-ontology.c
similarity index 100%
rename from src/libtracker-common/tracker-ontology.c
rename to src/libtracker-data/tracker-ontology.c
diff --git a/src/libtracker-common/tracker-ontology.h b/src/libtracker-data/tracker-ontology.h
similarity index 90%
rename from src/libtracker-common/tracker-ontology.h
rename to src/libtracker-data/tracker-ontology.h
index 4a2a851..d3f26f9 100644
--- a/src/libtracker-common/tracker-ontology.h
+++ b/src/libtracker-data/tracker-ontology.h
@@ -19,15 +19,15 @@
* Author: Philip Van Hoof <philip codeminded be>
*/
-#ifndef __LIBTRACKER_COMMON_ONTOLOGY_H__
-#define __LIBTRACKER_COMMON_ONTOLOGY_H__
+#ifndef __LIBTRACKER_DATA_ONTOLOGY_H__
+#define __LIBTRACKER_DATA_ONTOLOGY_H__
#include <glib-object.h>
G_BEGIN_DECLS
-#if !defined (__LIBTRACKER_COMMON_INSIDE__) && !defined (TRACKER_COMPILATION)
-#error "only <libtracker-common/tracker-common.h> must be included directly."
+#if !defined (__LIBTRACKER_DATA_INSIDE__) && !defined (TRACKER_COMPILATION)
+#error "only <libtracker-data/tracker-data.h> must be included directly."
#endif
#define TRACKER_TYPE_ONTOLOGY (tracker_ontology_get_type ())
@@ -63,5 +63,5 @@ void tracker_ontology_set_is_new (TrackerOntology *ontology,
G_END_DECLS
-#endif /* __LIBTRACKER_COMMON_ONTOLOGY_H__ */
+#endif /* __LIBTRACKER_DATA_ONTOLOGY_H__ */
diff --git a/src/libtracker-common/tracker-property.c b/src/libtracker-data/tracker-property.c
similarity index 99%
rename from src/libtracker-common/tracker-property.c
rename to src/libtracker-data/tracker-property.c
index e1cffac..497649f 100644
--- a/src/libtracker-common/tracker-property.c
+++ b/src/libtracker-data/tracker-property.c
@@ -24,6 +24,8 @@
#include <glib.h>
+#include <libtracker-common/tracker-ontologies.h>
+
#include "tracker-namespace.h"
#include "tracker-ontologies.h"
#include "tracker-property.h"
diff --git a/src/libtracker-common/tracker-property.h b/src/libtracker-data/tracker-property.h
similarity index 96%
rename from src/libtracker-common/tracker-property.h
rename to src/libtracker-data/tracker-property.h
index 297438f..5dcb2fc 100644
--- a/src/libtracker-common/tracker-property.h
+++ b/src/libtracker-data/tracker-property.h
@@ -17,8 +17,8 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef __LIBTRACKER_COMMON_PROPERTY_H__
-#define __LIBTRACKER_COMMON_PROPERTY_H__
+#ifndef __LIBTRACKER_DATA_PROPERTY_H__
+#define __LIBTRACKER_DATA_PROPERTY_H__
#include <glib-object.h>
@@ -26,8 +26,8 @@
G_BEGIN_DECLS
-#if !defined (__LIBTRACKER_COMMON_INSIDE__) && !defined (TRACKER_COMPILATION)
-#error "only <libtracker-common/tracker-common.h> must be included directly."
+#if !defined (__LIBTRACKER_DATA_INSIDE__) && !defined (TRACKER_COMPILATION)
+#error "only <libtracker-data/tracker-data.h> must be included directly."
#endif
/*
@@ -129,5 +129,5 @@ void tracker_property_add_super_property (TrackerProperty
G_END_DECLS
-#endif /* __LIBTRACKER_COMMON_PROPERTY_H__ */
+#endif /* __LIBTRACKER_DATA_PROPERTY_H__ */
diff --git a/src/libtracker-fts/tracker-fts.c b/src/libtracker-fts/tracker-fts.c
index 72bdf7c..3b6ca81 100644
--- a/src/libtracker-fts/tracker-fts.c
+++ b/src/libtracker-fts/tracker-fts.c
@@ -2127,6 +2127,7 @@ static int sql_prepare(sqlite3 *db, const char *zDb, const char *zName,
typedef struct fulltext_vtab fulltext_vtab;
static fulltext_vtab *tracker_fts_vtab = NULL;
+static TrackerFtsMapFunc map_function = NULL;
/* A single term in a query is represented by an instances of
** the following structure. Each word which may match against
@@ -4155,7 +4156,7 @@ static int fulltextNext(sqlite3_vtab_cursor *pCursor){
const gchar *uri;
int col = plrColumn (&plReader);
- uri = tracker_ontologies_get_uri_by_id (col);
+ uri = map_function (col);
c->rank += get_metadata_weight (col);
if (uri && first_pos) {
@@ -7779,6 +7780,10 @@ int tracker_fts_init(sqlite3 *db){
return rc;
}
+void tracker_fts_set_map_function(TrackerFtsMapFunc map_func){
+ map_function = map_func;
+}
+
int tracker_fts_update_init(int id){
return initPendingTerms(tracker_fts_vtab, id);
}
diff --git a/src/libtracker-fts/tracker-fts.h b/src/libtracker-fts/tracker-fts.h
index 491404d..8c4a065 100644
--- a/src/libtracker-fts/tracker-fts.h
+++ b/src/libtracker-fts/tracker-fts.h
@@ -22,7 +22,10 @@
G_BEGIN_DECLS
+typedef const gchar *(*TrackerFtsMapFunc) (gint id);
+
int tracker_fts_init (sqlite3 *db);
+void tracker_fts_set_map_function (TrackerFtsMapFunc map_func);
int tracker_fts_update_init (int id);
int tracker_fts_update_text (int id, int column_id, const char *text, gboolean limit_word_length);
void tracker_fts_update_commit (void);
diff --git a/src/tracker-store/tracker-dbus.c b/src/tracker-store/tracker-dbus.c
index 5bc9019..b351555 100644
--- a/src/tracker-store/tracker-dbus.c
+++ b/src/tracker-store/tracker-dbus.c
@@ -28,8 +28,7 @@
#include <libtracker-db/tracker-db-dbus.h>
#include <libtracker-db/tracker-db-manager.h>
-#include <libtracker-data/tracker-data-manager.h>
-#include <libtracker-data/tracker-data-query.h>
+#include <libtracker-data/tracker-data.h>
#include "tracker-dbus.h"
#include "tracker-resources.h"
diff --git a/src/tracker-store/tracker-events.c b/src/tracker-store/tracker-events.c
index 9dd1229..37beaf0 100644
--- a/src/tracker-store/tracker-events.c
+++ b/src/tracker-store/tracker-events.c
@@ -22,7 +22,7 @@
#include "config.h"
-#include <libtracker-common/tracker-ontologies.h>
+#include <libtracker-data/tracker-data.h>
#include "tracker-events.h"
diff --git a/src/tracker-store/tracker-events.h b/src/tracker-store/tracker-events.h
index 3729c17..bbd5954 100644
--- a/src/tracker-store/tracker-events.h
+++ b/src/tracker-store/tracker-events.h
@@ -23,7 +23,8 @@
#ifndef __TRACKER_STORE_EVENTS_H__
#define __TRACKER_STORE_EVENTS_H__
-#include <libtracker-common/tracker-dbus.h>
+#include <libtracker-common/tracker-common.h>
+#include <libtracker-data/tracker-data.h>
G_BEGIN_DECLS
diff --git a/src/tracker-store/tracker-statistics.c b/src/tracker-store/tracker-statistics.c
index 8f98e62..5b6c70e 100644
--- a/src/tracker-store/tracker-statistics.c
+++ b/src/tracker-store/tracker-statistics.c
@@ -30,7 +30,7 @@
#include <libtracker-db/tracker-db-dbus.h>
#include <libtracker-db/tracker-db-manager.h>
-#include <libtracker-data/tracker-data-manager.h>
+#include <libtracker-data/tracker-data.h>
#include "tracker-dbus.h"
#include "tracker-marshal.h"
diff --git a/src/tracker-store/tracker-writeback.c b/src/tracker-store/tracker-writeback.c
index ba1100d..0e25f60 100644
--- a/src/tracker-store/tracker-writeback.c
+++ b/src/tracker-store/tracker-writeback.c
@@ -22,7 +22,7 @@
#include "config.h"
-#include <libtracker-common/tracker-ontologies.h>
+#include <libtracker-data/tracker-data.h>
#include "tracker-writeback.h"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]