[tracker] Rename TrackerService to TrackerClass
- From: Jürg Billeter <juergbi src gnome org>
- To: svn-commits-list gnome org
- Subject: [tracker] Rename TrackerService to TrackerClass
- Date: Thu, 16 Apr 2009 05:27:09 -0400 (EDT)
commit 7ee10218c427f0f0927345d505e03173c1e3c4ed
Author: Jürg Billeter <j bitron ch>
Date: Wed Apr 15 11:30:00 2009 +0200
Rename TrackerService to TrackerClass
---
.../libtracker-common-sections.txt | 80 +-
.../libtracker-common/libtracker-common.types | 3 +-
src/libtracker-common/Makefile.am | 4 +-
src/libtracker-common/tracker-class.c | 844 ++++++++++++++++++++
src/libtracker-common/tracker-class.h | 119 +++
src/libtracker-common/tracker-common.h | 2 +-
src/libtracker-common/tracker-ontology.c | 84 +-
src/libtracker-common/tracker-ontology.h | 6 +-
src/libtracker-common/tracker-service.c | 844 --------------------
src/libtracker-common/tracker-service.h | 119 ---
src/libtracker-data/tracker-data-backup.c | 2 +-
src/libtracker-data/tracker-data-query.c | 38 +-
src/libtracker-data/tracker-data-query.h | 16 +-
src/libtracker-data/tracker-data-update.c | 78 +-
src/libtracker-data/tracker-data-update.h | 20 +-
src/libtracker-db/tracker-db-manager.c | 42 +-
src/libtracker/tracker.c | 18 +-
src/libtracker/tracker.h | 2 +-
src/tracker-indexer/tracker-indexer.c | 64 +-
src/tracker-search-tool/tracker-search-tool.c | 2 +-
src/tracker-utils/tracker-info.c | 2 +-
src/tracker-utils/tracker-search.c | 2 +-
tests/libtracker-common/tracker-ontology-test.c | 58 +-
23 files changed, 1225 insertions(+), 1224 deletions(-)
diff --git a/docs/reference/libtracker-common/libtracker-common-sections.txt b/docs/reference/libtracker-common/libtracker-common-sections.txt
index 9fe89b9..1c385e0 100644
--- a/docs/reference/libtracker-common/libtracker-common-sections.txt
+++ b/docs/reference/libtracker-common/libtracker-common-sections.txt
@@ -337,46 +337,46 @@ tracker_parser_text_into_array
tracker_parser_text_to_string
</SECTION>
-<INCLUDE>libtracker-common/tracker-service.h</INCLUDE>
+<INCLUDE>libtracker-common/tracker-class.h</INCLUDE>
<SECTION>
-<FILE>tracker-service</FILE>
-<TITLE>Service</TITLE>
-TrackerService
-tracker_service_new
-tracker_service_get_content_metadata
-tracker_service_get_db_type
-tracker_service_get_embedded
-tracker_service_get_enabled
-tracker_service_get_has_full_text
-tracker_service_get_has_metadata
-tracker_service_get_has_thumbs
-tracker_service_get_id
-tracker_service_get_key_metadata
-tracker_service_get_name
-tracker_service_get_parent
-tracker_service_get_property_prefix
-tracker_service_get_show_service_directories
-tracker_service_get_show_service_files
-tracker_service_set_content_metadata
-tracker_service_set_db_type
-tracker_service_set_embedded
-tracker_service_set_enabled
-tracker_service_set_has_full_text
-tracker_service_set_has_metadata
-tracker_service_set_has_thumbs
-tracker_service_set_id
-tracker_service_set_key_metadata
-tracker_service_set_name
-tracker_service_set_parent
-tracker_service_set_property_prefix
-tracker_service_set_show_service_directories
-tracker_service_set_show_service_files
+<FILE>tracker-class</FILE>
+<TITLE>Class</TITLE>
+TrackerClass
+tracker_class_new
+tracker_class_get_content_metadata
+tracker_class_get_db_type
+tracker_class_get_embedded
+tracker_class_get_enabled
+tracker_class_get_has_full_text
+tracker_class_get_has_metadata
+tracker_class_get_has_thumbs
+tracker_class_get_id
+tracker_class_get_key_metadata
+tracker_class_get_name
+tracker_class_get_parent
+tracker_class_get_property_prefix
+tracker_class_get_show_service_directories
+tracker_class_get_show_service_files
+tracker_class_set_content_metadata
+tracker_class_set_db_type
+tracker_class_set_embedded
+tracker_class_set_enabled
+tracker_class_set_has_full_text
+tracker_class_set_has_metadata
+tracker_class_set_has_thumbs
+tracker_class_set_id
+tracker_class_set_key_metadata
+tracker_class_set_name
+tracker_class_set_parent
+tracker_class_set_property_prefix
+tracker_class_set_show_service_directories
+tracker_class_set_show_service_files
<SUBSECTION Standard>
-TRACKER_SERVICE
-TRACKER_IS_SERVICE
-TRACKER_TYPE_SERVICE
-tracker_service_get_type
-TRACKER_SERVICE_CLASS
-TRACKER_IS_SERVICE_CLASS
-TRACKER_SERVICE_GET_CLASS
+TRACKER_CLASS
+TRACKER_IS_CLASS
+TRACKER_TYPE_CLASS
+tracker_class_get_type
+TRACKER_CLASS_CLASS
+TRACKER_IS_CLASS_CLASS
+TRACKER_CLASS_GET_CLASS
</SECTION>
diff --git a/docs/reference/libtracker-common/libtracker-common.types b/docs/reference/libtracker-common/libtracker-common.types
index 142b1d0..cbf5574 100644
--- a/docs/reference/libtracker-common/libtracker-common.types
+++ b/docs/reference/libtracker-common/libtracker-common.types
@@ -1,7 +1,8 @@
#include <libtracker-common/tracker-common.h>
+tracker_class_get_type
tracker_config_get_type
tracker_field_get_type
tracker_hal_get_type
tracker_language_get_type
-tracker_service_get_type
+
diff --git a/src/libtracker-common/Makefile.am b/src/libtracker-common/Makefile.am
index 5f01a9c..8d48ff0 100644
--- a/src/libtracker-common/Makefile.am
+++ b/src/libtracker-common/Makefile.am
@@ -35,6 +35,7 @@ endif
libtracker_common_la_SOURCES = \
$(os_sources) \
$(hal_sources) \
+ tracker-class.c \
tracker-config.c \
tracker-dbus.c \
tracker-field.c \
@@ -47,7 +48,6 @@ libtracker_common_la_SOURCES = \
tracker-nfs-lock.c \
tracker-ontology.c \
tracker-parser.c \
- tracker-service.c \
tracker-type-utils.c \
tracker-utils.c \
tracker-thumbnailer.c \
@@ -64,6 +64,7 @@ noinst_HEADERS = \
tracker-albumart.h
libtracker_commoninclude_HEADERS = \
+ tracker-class.h \
tracker-common.h \
tracker-config.h \
tracker-field.h \
@@ -72,7 +73,6 @@ libtracker_commoninclude_HEADERS = \
tracker-module-config.h \
tracker-ontology.h \
tracker-parser.h \
- tracker-service.h \
tracker-type-utils.h \
tracker-utils.h
diff --git a/src/libtracker-common/tracker-class.c b/src/libtracker-common/tracker-class.c
new file mode 100644
index 0000000..c9bcd9e
--- /dev/null
+++ b/src/libtracker-common/tracker-class.c
@@ -0,0 +1,844 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * 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 General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 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
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU 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.
+ */
+
+#include <string.h>
+#include <stdlib.h>
+
+#include <glib.h>
+
+#include "tracker-class.h"
+
+#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TRACKER_TYPE_CLASS, TrackerClassPriv))
+
+typedef struct _TrackerClassPriv TrackerClassPriv;
+
+struct _TrackerClassPriv {
+ gint id;
+
+ gchar *name;
+ gchar *parent;
+
+ gchar *property_prefix;
+ gchar *content_metadata;
+ GSList *key_metadata;
+
+ TrackerDBType db_type;
+
+ gboolean enabled;
+ gboolean embedded;
+
+ gboolean has_metadata;
+ gboolean has_full_text;
+ gboolean has_thumbs;
+
+ gboolean show_service_files;
+ gboolean show_service_directories;
+};
+
+static void class_finalize (GObject *object);
+static void class_get_property (GObject *object,
+ guint param_id,
+ GValue *value,
+ GParamSpec *pspec);
+static void class_set_property (GObject *object,
+ guint param_id,
+ const GValue *value,
+ GParamSpec *pspec);
+
+enum {
+ PROP_0,
+ PROP_ID,
+ PROP_NAME,
+ PROP_PARENT,
+ PROP_PROPERTY_PREFIX,
+ PROP_CONTENT_METADATA,
+ PROP_KEY_METADATA,
+ PROP_DB_TYPE,
+ PROP_ENABLED,
+ PROP_EMBEDDED,
+ PROP_HAS_METADATA,
+ PROP_HAS_FULL_TEXT,
+ PROP_HAS_THUMBS,
+ PROP_SHOW_SERVICE_FILES,
+ PROP_SHOW_SERVICE_DIRECTORIES
+};
+
+GType
+tracker_db_type_get_type (void)
+{
+ static GType etype = 0;
+
+ if (etype == 0) {
+ static const GEnumValue values[] = {
+ { TRACKER_DB_TYPE_UNKNOWN,
+ "TRACKER_DB_TYPE_UNKNOWN",
+ "unknown" },
+ { TRACKER_DB_TYPE_DATA,
+ "TRACKER_DB_TYPE_DATA",
+ "data" },
+ { TRACKER_DB_TYPE_INDEX,
+ "TRACKER_DB_TYPE_INDEX",
+ "index" },
+ { TRACKER_DB_TYPE_COMMON,
+ "TRACKER_DB_TYPE_COMMON",
+ "common" },
+ { TRACKER_DB_TYPE_CONTENT,
+ "TRACKER_DB_TYPE_CONTENT",
+ "content" },
+ { TRACKER_DB_TYPE_EMAIL,
+ "TRACKER_DB_TYPE_EMAIL",
+ "email" },
+ { TRACKER_DB_TYPE_FILES,
+ "TRACKER_DB_TYPE_FILES",
+ "files" },
+ { TRACKER_DB_TYPE_CACHE,
+ "TRACKER_DB_TYPE_CACHE",
+ "cache" },
+ { TRACKER_DB_TYPE_USER,
+ "TRACKER_DB_TYPE_USER",
+ "user" },
+ { 0, NULL, NULL }
+ };
+
+ etype = g_enum_register_static ("TrackerDBType", values);
+ }
+
+ return etype;
+}
+
+G_DEFINE_TYPE (TrackerClass, tracker_class, G_TYPE_OBJECT);
+
+static void
+tracker_class_class_init (TrackerClassClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ object_class->finalize = class_finalize;
+ object_class->get_property = class_get_property;
+ object_class->set_property = class_set_property;
+
+ g_object_class_install_property (object_class,
+ PROP_ID,
+ g_param_spec_int ("id",
+ "id",
+ "Unique identifier for this service",
+ 0,
+ G_MAXINT,
+ 0,
+ G_PARAM_READWRITE));
+ g_object_class_install_property (object_class,
+ PROP_NAME,
+ g_param_spec_string ("name",
+ "name",
+ "Service name",
+ NULL,
+ G_PARAM_READWRITE));
+ g_object_class_install_property (object_class,
+ PROP_PARENT,
+ g_param_spec_string ("parent",
+ "parent",
+ "Service name of parent",
+ NULL,
+ G_PARAM_READWRITE));
+ g_object_class_install_property (object_class,
+ PROP_PROPERTY_PREFIX,
+ g_param_spec_string ("property-prefix",
+ "property-prefix",
+ "The properties of this category are prefix:name",
+ NULL,
+ G_PARAM_READWRITE));
+ g_object_class_install_property (object_class,
+ PROP_CONTENT_METADATA,
+ g_param_spec_string ("content-metadata",
+ "content-metadata",
+ "Content metadata",
+ NULL,
+ G_PARAM_READWRITE));
+ g_object_class_install_property (object_class,
+ PROP_KEY_METADATA,
+ g_param_spec_pointer ("key-metadata",
+ "key-metadata",
+ "Key metadata",
+ G_PARAM_READWRITE));
+ g_object_class_install_property (object_class,
+ PROP_DB_TYPE,
+ g_param_spec_enum ("db-type",
+ "db-type",
+ "Database type",
+ tracker_db_type_get_type (),
+ TRACKER_DB_TYPE_DATA,
+ G_PARAM_READWRITE));
+ g_object_class_install_property (object_class,
+ PROP_ENABLED,
+ g_param_spec_boolean ("enabled",
+ "enabled",
+ "Enabled",
+ TRUE,
+ G_PARAM_READWRITE));
+ g_object_class_install_property (object_class,
+ PROP_EMBEDDED,
+ g_param_spec_boolean ("embedded",
+ "embedded",
+ "Embedded",
+ FALSE,
+ G_PARAM_READWRITE));
+ g_object_class_install_property (object_class,
+ PROP_HAS_METADATA,
+ g_param_spec_boolean ("has-metadata",
+ "has-metadata",
+ "Has metadata",
+ FALSE,
+ G_PARAM_READWRITE));
+ g_object_class_install_property (object_class,
+ PROP_HAS_FULL_TEXT,
+ g_param_spec_boolean ("has-full-text",
+ "has-full-text",
+ "Has full text",
+ FALSE,
+ G_PARAM_READWRITE));
+ g_object_class_install_property (object_class,
+ PROP_HAS_THUMBS,
+ g_param_spec_boolean ("has-thumbs",
+ "has-thumbs",
+ "Has thumbnails",
+ FALSE,
+ G_PARAM_READWRITE));
+ g_object_class_install_property (object_class,
+ PROP_SHOW_SERVICE_FILES,
+ g_param_spec_boolean ("show-service-files",
+ "show-service-files",
+ "Show service files",
+ FALSE,
+ G_PARAM_READWRITE));
+ g_object_class_install_property (object_class,
+ PROP_SHOW_SERVICE_DIRECTORIES,
+ g_param_spec_boolean ("show-service-directories",
+ "show-service-directories",
+ "Show service directories",
+ FALSE,
+ G_PARAM_READWRITE));
+
+ g_type_class_add_private (object_class, sizeof (TrackerClassPriv));
+}
+
+static void
+tracker_class_init (TrackerClass *service)
+{
+}
+
+static void
+class_finalize (GObject *object)
+{
+ TrackerClassPriv *priv;
+
+ priv = GET_PRIV (object);
+
+ g_free (priv->name);
+ g_free (priv->parent);
+ g_free (priv->content_metadata);
+ g_free (priv->property_prefix);
+
+ g_slist_foreach (priv->key_metadata, (GFunc) g_free, NULL);
+ g_slist_free (priv->key_metadata);
+
+ (G_OBJECT_CLASS (tracker_class_parent_class)->finalize) (object);
+}
+
+static void
+class_get_property (GObject *object,
+ guint param_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ TrackerClassPriv *priv;
+
+ priv = GET_PRIV (object);
+
+ switch (param_id) {
+ case PROP_ID:
+ g_value_set_int (value, priv->id);
+ break;
+ case PROP_NAME:
+ g_value_set_string (value, priv->name);
+ break;
+ case PROP_PARENT:
+ g_value_set_string (value, priv->parent);
+ break;
+ case PROP_PROPERTY_PREFIX:
+ g_value_set_string (value, priv->property_prefix);
+ break;
+ case PROP_CONTENT_METADATA:
+ g_value_set_string (value, priv->content_metadata);
+ break;
+ case PROP_KEY_METADATA:
+ g_value_set_pointer (value, priv->key_metadata);
+ break;
+ case PROP_DB_TYPE:
+ g_value_set_enum (value, priv->db_type);
+ break;
+ case PROP_ENABLED:
+ g_value_set_boolean (value, priv->enabled);
+ break;
+ case PROP_EMBEDDED:
+ g_value_set_boolean (value, priv->embedded);
+ break;
+ case PROP_HAS_METADATA:
+ g_value_set_boolean (value, priv->has_metadata);
+ break;
+ case PROP_HAS_FULL_TEXT:
+ g_value_set_boolean (value, priv->has_full_text);
+ break;
+ case PROP_HAS_THUMBS:
+ g_value_set_boolean (value, priv->has_thumbs);
+ break;
+ case PROP_SHOW_SERVICE_FILES:
+ g_value_set_boolean (value, priv->show_service_files);
+ break;
+ case PROP_SHOW_SERVICE_DIRECTORIES:
+ g_value_set_boolean (value, priv->show_service_directories);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
+ break;
+ };
+}
+
+static void
+class_set_property (GObject *object,
+ guint param_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ TrackerClassPriv *priv;
+
+ priv = GET_PRIV (object);
+
+ switch (param_id) {
+ case PROP_ID:
+ tracker_class_set_id (TRACKER_CLASS (object),
+ g_value_get_int (value));
+ break;
+ case PROP_NAME:
+ tracker_class_set_name (TRACKER_CLASS (object),
+ g_value_get_string (value));
+ break;
+ case PROP_PROPERTY_PREFIX:
+ tracker_class_set_property_prefix (TRACKER_CLASS (object),
+ g_value_get_string (value));
+ break;
+ case PROP_PARENT:
+ tracker_class_set_parent (TRACKER_CLASS (object),
+ g_value_get_string (value));
+ break;
+ case PROP_CONTENT_METADATA:
+ tracker_class_set_content_metadata (TRACKER_CLASS (object),
+ g_value_get_string (value));
+ break;
+ case PROP_KEY_METADATA:
+ tracker_class_set_key_metadata (TRACKER_CLASS (object),
+ g_value_get_pointer (value));
+ break;
+ case PROP_DB_TYPE:
+ tracker_class_set_db_type (TRACKER_CLASS (object),
+ g_value_get_enum (value));
+ break;
+ case PROP_ENABLED:
+ tracker_class_set_enabled (TRACKER_CLASS (object),
+ g_value_get_boolean (value));
+ break;
+ case PROP_EMBEDDED:
+ tracker_class_set_embedded (TRACKER_CLASS (object),
+ g_value_get_boolean (value));
+ break;
+ case PROP_HAS_METADATA:
+ tracker_class_set_has_metadata (TRACKER_CLASS (object),
+ g_value_get_boolean (value));
+ break;
+ case PROP_HAS_FULL_TEXT:
+ tracker_class_set_has_full_text (TRACKER_CLASS (object),
+ g_value_get_boolean (value));
+ break;
+ case PROP_HAS_THUMBS:
+ tracker_class_set_has_thumbs (TRACKER_CLASS (object),
+ g_value_get_boolean (value));
+ break;
+ case PROP_SHOW_SERVICE_FILES:
+ tracker_class_set_show_service_files (TRACKER_CLASS (object),
+ g_value_get_boolean (value));
+ break;
+ case PROP_SHOW_SERVICE_DIRECTORIES:
+ tracker_class_set_show_service_directories (TRACKER_CLASS (object),
+ g_value_get_boolean (value));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
+ break;
+ };
+}
+
+static gboolean
+class_int_validate (TrackerClass *service,
+ const gchar *property,
+ gint value)
+{
+#ifdef G_DISABLE_CHECKS
+ GParamSpec *spec;
+ GValue value = { 0 };
+ gboolean valid;
+
+ spec = g_object_class_find_property (G_OBJECT_CLASS (service), property);
+ g_return_val_if_fail (spec != NULL, FALSE);
+
+ g_value_init (&value, spec->value_type);
+ g_value_set_int (&value, verbosity);
+ valid = g_param_value_validate (spec, &value);
+ g_value_unset (&value);
+
+ g_return_val_if_fail (valid != TRUE, FALSE);
+#endif
+
+ return TRUE;
+}
+
+TrackerClass *
+tracker_class_new (void)
+{
+ TrackerClass *service;
+
+ service = g_object_new (TRACKER_TYPE_CLASS, NULL);
+
+ return service;
+}
+
+gint
+tracker_class_get_id (TrackerClass *service)
+{
+ TrackerClassPriv *priv;
+
+ g_return_val_if_fail (TRACKER_IS_CLASS (service), -1);
+
+ priv = GET_PRIV (service);
+
+ return priv->id;
+}
+
+const gchar *
+tracker_class_get_name (TrackerClass *service)
+{
+ TrackerClassPriv *priv;
+
+ g_return_val_if_fail (TRACKER_IS_CLASS (service), NULL);
+
+ priv = GET_PRIV (service);
+
+ return priv->name;
+}
+
+const gchar *
+tracker_class_get_parent (TrackerClass *service)
+{
+ TrackerClassPriv *priv;
+
+ g_return_val_if_fail (TRACKER_IS_CLASS (service), NULL);
+
+ priv = GET_PRIV (service);
+
+ return priv->parent;
+}
+
+const gchar *
+tracker_class_get_property_prefix (TrackerClass *service)
+{
+ TrackerClassPriv *priv;
+
+ g_return_val_if_fail (TRACKER_IS_CLASS (service), NULL);
+
+ priv = GET_PRIV (service);
+
+ return priv->property_prefix;
+}
+
+const gchar *
+tracker_class_get_content_metadata (TrackerClass *service)
+{
+ TrackerClassPriv *priv;
+
+ g_return_val_if_fail (TRACKER_IS_CLASS (service), NULL);
+
+ priv = GET_PRIV (service);
+
+ return priv->content_metadata;
+}
+
+const GSList *
+tracker_class_get_key_metadata (TrackerClass *service)
+{
+ TrackerClassPriv *priv;
+
+ g_return_val_if_fail (TRACKER_IS_CLASS (service), NULL);
+
+ priv = GET_PRIV (service);
+
+ return priv->key_metadata;
+}
+
+TrackerDBType
+tracker_class_get_db_type (TrackerClass *service)
+{
+ TrackerClassPriv *priv;
+
+ g_return_val_if_fail (TRACKER_IS_CLASS (service), TRACKER_DB_TYPE_DATA);
+
+ priv = GET_PRIV (service);
+
+ return priv->db_type;
+}
+
+gboolean
+tracker_class_get_enabled (TrackerClass *service)
+{
+ TrackerClassPriv *priv;
+
+ g_return_val_if_fail (TRACKER_IS_CLASS (service), FALSE);
+
+ priv = GET_PRIV (service);
+
+ return priv->enabled;
+}
+
+gboolean
+tracker_class_get_embedded (TrackerClass *service)
+{
+ TrackerClassPriv *priv;
+
+ g_return_val_if_fail (TRACKER_IS_CLASS (service), FALSE);
+
+ priv = GET_PRIV (service);
+
+ return priv->embedded;
+}
+
+gboolean
+tracker_class_get_has_metadata (TrackerClass *service)
+{
+ TrackerClassPriv *priv;
+
+ g_return_val_if_fail (TRACKER_IS_CLASS (service), FALSE);
+
+ priv = GET_PRIV (service);
+
+ return priv->has_metadata;
+}
+
+gboolean
+tracker_class_get_has_full_text (TrackerClass *service)
+{
+ TrackerClassPriv *priv;
+
+ g_return_val_if_fail (TRACKER_IS_CLASS (service), FALSE);
+
+ priv = GET_PRIV (service);
+
+ return priv->has_full_text;
+}
+
+gboolean
+tracker_class_get_has_thumbs (TrackerClass *service)
+{
+ TrackerClassPriv *priv;
+
+ g_return_val_if_fail (TRACKER_IS_CLASS (service), FALSE);
+
+ priv = GET_PRIV (service);
+
+ return priv->has_thumbs;
+}
+
+gboolean
+tracker_class_get_show_service_files (TrackerClass *service)
+{
+ TrackerClassPriv *priv;
+
+ g_return_val_if_fail (TRACKER_IS_CLASS (service), FALSE);
+
+ priv = GET_PRIV (service);
+
+ return priv->show_service_files;
+}
+
+gboolean
+tracker_class_get_show_service_directories (TrackerClass *service)
+{
+ TrackerClassPriv *priv;
+
+ g_return_val_if_fail (TRACKER_IS_CLASS (service), FALSE);
+
+ priv = GET_PRIV (service);
+
+ return priv->show_service_directories;
+}
+
+void
+tracker_class_set_id (TrackerClass *service,
+ gint value)
+{
+ TrackerClassPriv *priv;
+
+ g_return_if_fail (TRACKER_IS_CLASS (service));
+
+ if (!class_int_validate (service, "id", value)) {
+ return;
+ }
+
+ priv = GET_PRIV (service);
+
+ priv->id = value;
+ g_object_notify (G_OBJECT (service), "id");
+}
+
+void
+tracker_class_set_name (TrackerClass *service,
+ const gchar *value)
+{
+ TrackerClassPriv *priv;
+
+ g_return_if_fail (TRACKER_IS_CLASS (service));
+
+ priv = GET_PRIV (service);
+
+ g_free (priv->name);
+
+ if (value) {
+ priv->name = g_strdup (value);
+ } else {
+ priv->name = NULL;
+ }
+
+ g_object_notify (G_OBJECT (service), "name");
+}
+
+void
+tracker_class_set_parent (TrackerClass *service,
+ const gchar *value)
+{
+ TrackerClassPriv *priv;
+
+ g_return_if_fail (TRACKER_IS_CLASS (service));
+
+ priv = GET_PRIV (service);
+
+ g_free (priv->parent);
+
+ if (value) {
+ priv->parent = g_strdup (value);
+ } else {
+ priv->parent = NULL;
+ }
+
+ g_object_notify (G_OBJECT (service), "parent");
+}
+
+void
+tracker_class_set_property_prefix (TrackerClass *service,
+ const gchar *value)
+{
+ TrackerClassPriv *priv;
+
+ g_return_if_fail (TRACKER_IS_CLASS (service));
+
+ priv = GET_PRIV (service);
+
+ g_free (priv->property_prefix);
+
+ if (value) {
+ priv->property_prefix = g_strdup (value);
+ } else {
+ priv->property_prefix = NULL;
+ }
+
+ g_object_notify (G_OBJECT (service), "property-prefix");
+}
+
+void
+tracker_class_set_content_metadata (TrackerClass *service,
+ const gchar *value)
+{
+ TrackerClassPriv *priv;
+
+ g_return_if_fail (TRACKER_IS_CLASS (service));
+
+ priv = GET_PRIV (service);
+
+ g_free (priv->content_metadata);
+
+ if (value) {
+ priv->content_metadata = g_strdup (value);
+ } else {
+ priv->content_metadata = NULL;
+ }
+
+ g_object_notify (G_OBJECT (service), "content-metadata");
+}
+
+void
+tracker_class_set_key_metadata (TrackerClass *service,
+ const GSList *value)
+{
+ TrackerClassPriv *priv;
+
+ g_return_if_fail (TRACKER_IS_CLASS (service));
+
+ priv = GET_PRIV (service);
+
+ g_slist_foreach (priv->key_metadata, (GFunc) g_free, NULL);
+ g_slist_free (priv->key_metadata);
+
+ if (value) {
+ GSList *new_list;
+ const GSList *l;
+
+ new_list = NULL;
+
+ for (l = value; l; l = l->next) {
+ new_list = g_slist_prepend (new_list, g_strdup (l->data));
+ }
+
+ new_list = g_slist_reverse (new_list);
+ priv->key_metadata = new_list;
+ } else {
+ priv->key_metadata = NULL;
+ }
+
+ g_object_notify (G_OBJECT (service), "key-metadata");
+}
+
+void
+tracker_class_set_db_type (TrackerClass *service,
+ TrackerDBType value)
+{
+ TrackerClassPriv *priv;
+
+ g_return_if_fail (TRACKER_IS_CLASS (service));
+
+ priv = GET_PRIV (service);
+
+ priv->db_type = value;
+ g_object_notify (G_OBJECT (service), "db-type");
+}
+
+void
+tracker_class_set_enabled (TrackerClass *service,
+ gboolean value)
+{
+ TrackerClassPriv *priv;
+
+ g_return_if_fail (TRACKER_IS_CLASS (service));
+
+ priv = GET_PRIV (service);
+
+ priv->enabled = value;
+ g_object_notify (G_OBJECT (service), "enabled");
+}
+
+void
+tracker_class_set_embedded (TrackerClass *service,
+ gboolean value)
+{
+ TrackerClassPriv *priv;
+
+ g_return_if_fail (TRACKER_IS_CLASS (service));
+
+ priv = GET_PRIV (service);
+
+ priv->embedded = value;
+ g_object_notify (G_OBJECT (service), "embedded");
+}
+
+void
+tracker_class_set_has_metadata (TrackerClass *service,
+ gboolean value)
+{
+ TrackerClassPriv *priv;
+
+ g_return_if_fail (TRACKER_IS_CLASS (service));
+
+ priv = GET_PRIV (service);
+
+ priv->has_metadata = value;
+ g_object_notify (G_OBJECT (service), "has-metadata");
+}
+
+void
+tracker_class_set_has_full_text (TrackerClass *service,
+ gboolean value)
+{
+ TrackerClassPriv *priv;
+
+ g_return_if_fail (TRACKER_IS_CLASS (service));
+
+ priv = GET_PRIV (service);
+
+ priv->has_full_text = value;
+ g_object_notify (G_OBJECT (service), "has-full-text");
+}
+
+void
+tracker_class_set_has_thumbs (TrackerClass *service,
+ gboolean value)
+{
+ TrackerClassPriv *priv;
+
+ g_return_if_fail (TRACKER_IS_CLASS (service));
+
+ priv = GET_PRIV (service);
+
+ priv->has_thumbs = value;
+ g_object_notify (G_OBJECT (service), "has-thumbs");
+}
+
+void
+tracker_class_set_show_service_files (TrackerClass *service,
+ gboolean value)
+{
+ TrackerClassPriv *priv;
+
+ g_return_if_fail (TRACKER_IS_CLASS (service));
+
+ priv = GET_PRIV (service);
+
+ priv->show_service_files = value;
+ g_object_notify (G_OBJECT (service), "show-service-files");
+}
+
+void
+tracker_class_set_show_service_directories (TrackerClass *service,
+ gboolean value)
+{
+ TrackerClassPriv *priv;
+
+ g_return_if_fail (TRACKER_IS_CLASS (service));
+
+ priv = GET_PRIV (service);
+
+ priv->show_service_directories = value;
+ g_object_notify (G_OBJECT (service), "show-service-directories");
+}
+
diff --git a/src/libtracker-common/tracker-class.h b/src/libtracker-common/tracker-class.h
new file mode 100644
index 0000000..8de96e6
--- /dev/null
+++ b/src/libtracker-common/tracker-class.h
@@ -0,0 +1,119 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * 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 General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 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
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU 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_COMMON_CLASS_H__
+#define __LIBTRACKER_COMMON_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."
+#endif
+
+#define TRACKER_TYPE_DB_TYPE (tracker_db_type_get_type ())
+
+typedef enum {
+ TRACKER_DB_TYPE_UNKNOWN,
+ TRACKER_DB_TYPE_DATA,
+ TRACKER_DB_TYPE_INDEX,
+ TRACKER_DB_TYPE_COMMON,
+ TRACKER_DB_TYPE_CONTENT,
+ TRACKER_DB_TYPE_EMAIL,
+ TRACKER_DB_TYPE_FILES,
+ TRACKER_DB_TYPE_CACHE,
+ TRACKER_DB_TYPE_USER
+} TrackerDBType;
+
+GType tracker_db_type_get_type (void) G_GNUC_CONST;
+
+
+#define TRACKER_TYPE_CLASS (tracker_class_get_type ())
+#define TRACKER_CLASS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TRACKER_TYPE_CLASS, TrackerClass))
+#define TRACKER_CLASS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TRACKER_TYPE_CLASS, TrackerClassClass))
+#define TRACKER_IS_CLASS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TRACKER_TYPE_CLASS))
+#define TRACKER_IS_CLASS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TRACKER_TYPE_CLASS))
+#define TRACKER_CLASS_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TRACKER_TYPE_CLASS, TrackerClassClass))
+
+typedef struct _TrackerClass TrackerClass;
+typedef struct _TrackerClassClass TrackerClassClass;
+
+struct _TrackerClass {
+ GObject parent;
+};
+
+struct _TrackerClassClass {
+ GObjectClass parent_class;
+};
+
+GType tracker_class_get_type (void) G_GNUC_CONST;
+
+TrackerClass *tracker_class_new (void);
+
+gint tracker_class_get_id (TrackerClass *service);
+const gchar * tracker_class_get_name (TrackerClass *service);
+const gchar * tracker_class_get_parent (TrackerClass *service);
+const gchar * tracker_class_get_property_prefix (TrackerClass *service);
+const gchar * tracker_class_get_content_metadata (TrackerClass *service);
+const GSList * tracker_class_get_key_metadata (TrackerClass *service);
+TrackerDBType tracker_class_get_db_type (TrackerClass *service);
+gboolean tracker_class_get_enabled (TrackerClass *service);
+gboolean tracker_class_get_embedded (TrackerClass *service);
+gboolean tracker_class_get_has_metadata (TrackerClass *service);
+gboolean tracker_class_get_has_full_text (TrackerClass *service);
+gboolean tracker_class_get_has_thumbs (TrackerClass *service);
+gboolean tracker_class_get_show_service_files (TrackerClass *service);
+gboolean tracker_class_get_show_service_directories (TrackerClass *service);
+
+void tracker_class_set_id (TrackerClass *service,
+ gint value);
+void tracker_class_set_name (TrackerClass *service,
+ const gchar *value);
+void tracker_class_set_parent (TrackerClass *service,
+ const gchar *value);
+void tracker_class_set_property_prefix (TrackerClass *service,
+ const gchar *value);
+void tracker_class_set_content_metadata (TrackerClass *service,
+ const gchar *value);
+void tracker_class_set_key_metadata (TrackerClass *service,
+ const GSList *value);
+void tracker_class_set_db_type (TrackerClass *service,
+ TrackerDBType value);
+void tracker_class_set_enabled (TrackerClass *service,
+ gboolean value);
+void tracker_class_set_embedded (TrackerClass *service,
+ gboolean value);
+void tracker_class_set_has_metadata (TrackerClass *service,
+ gboolean value);
+void tracker_class_set_has_full_text (TrackerClass *service,
+ gboolean value);
+void tracker_class_set_has_thumbs (TrackerClass *service,
+ gboolean value);
+void tracker_class_set_show_service_files (TrackerClass *service,
+ gboolean value);
+void tracker_class_set_show_service_directories (TrackerClass *service,
+ gboolean value);
+
+G_END_DECLS
+
+#endif /* __LIBTRACKER_COMMON_CLASS_H__ */
+
diff --git a/src/libtracker-common/tracker-common.h b/src/libtracker-common/tracker-common.h
index a5e5ae0..f93542f 100644
--- a/src/libtracker-common/tracker-common.h
+++ b/src/libtracker-common/tracker-common.h
@@ -40,7 +40,7 @@ G_BEGIN_DECLS
#include "tracker-module-config.h"
#include "tracker-ontology.h"
#include "tracker-parser.h"
-#include "tracker-service.h"
+#include "tracker-class.h"
#include "tracker-type-utils.h"
#include "tracker-utils.h"
diff --git a/src/libtracker-common/tracker-ontology.c b/src/libtracker-common/tracker-ontology.c
index 18029f8..56a4105 100644
--- a/src/libtracker-common/tracker-ontology.c
+++ b/src/libtracker-common/tracker-ontology.c
@@ -40,10 +40,10 @@ typedef struct {
static gboolean initialized;
-/* Hash (gint service_type_id, TrackerService *service) */
+/* Hash (gint service_type_id, TrackerClass *service) */
static GHashTable *service_ids;
-/* Hash (gchar *service_name, TrackerService *service) */
+/* Hash (gchar *service_name, TrackerClass *service) */
static GHashTable *service_names;
/* Hash (gchar *mime, gint service_type_id) */
@@ -206,7 +206,7 @@ tracker_ontology_shutdown (void)
}
void
-tracker_ontology_service_add (TrackerService *service,
+tracker_ontology_service_add (TrackerClass *service,
GSList *mimes,
GSList *mime_prefixes)
{
@@ -216,10 +216,10 @@ tracker_ontology_service_add (TrackerService *service,
gint id;
const gchar *name;
- g_return_if_fail (TRACKER_IS_SERVICE (service));
+ g_return_if_fail (TRACKER_IS_CLASS (service));
- id = tracker_service_get_id (service);
- name = tracker_service_get_name (service);
+ id = tracker_class_get_id (service);
+ name = tracker_class_get_name (service);
g_hash_table_insert (service_names,
g_strdup (name),
@@ -244,7 +244,7 @@ tracker_ontology_service_add (TrackerService *service,
}
}
-TrackerService *
+TrackerClass *
tracker_ontology_get_service_by_name (const gchar *service_str)
{
g_return_val_if_fail (service_str != NULL, NULL);
@@ -255,7 +255,7 @@ tracker_ontology_get_service_by_name (const gchar *service_str)
G_CONST_RETURN gchar *
tracker_ontology_get_service_by_id (gint id)
{
- TrackerService *service;
+ TrackerClass *service;
service = ontology_hash_lookup_by_id (service_ids, id);
@@ -263,7 +263,7 @@ tracker_ontology_get_service_by_id (gint id)
return NULL;
}
- return tracker_service_get_name (service);
+ return tracker_class_get_name (service);
}
G_CONST_RETURN gchar *
@@ -298,7 +298,7 @@ tracker_ontology_get_service_by_mime (const gchar *mime)
gint
tracker_ontology_get_service_id_by_name (const char *service_str)
{
- TrackerService *service;
+ TrackerClass *service;
g_return_val_if_fail (service_str != NULL, -1);
@@ -308,13 +308,13 @@ tracker_ontology_get_service_id_by_name (const char *service_str)
return -1;
}
- return tracker_service_get_id (service);
+ return tracker_class_get_id (service);
}
gchar *
tracker_ontology_get_service_parent (const gchar *service_str)
{
- TrackerService *service;
+ TrackerClass *service;
const gchar *parent = NULL;
g_return_val_if_fail (service_str != NULL, NULL);
@@ -322,7 +322,7 @@ tracker_ontology_get_service_parent (const gchar *service_str)
service = g_hash_table_lookup (service_names, service_str);
if (service) {
- parent = tracker_service_get_parent (service);
+ parent = tracker_class_get_parent (service);
}
return g_strdup (parent);
@@ -331,7 +331,7 @@ tracker_ontology_get_service_parent (const gchar *service_str)
gchar *
tracker_ontology_get_service_parent_by_id (gint id)
{
- TrackerService *service;
+ TrackerClass *service;
service = ontology_hash_lookup_by_id (service_ids, id);
@@ -339,19 +339,19 @@ tracker_ontology_get_service_parent_by_id (gint id)
return NULL;
}
- return g_strdup (tracker_service_get_parent (service));
+ return g_strdup (tracker_class_get_parent (service));
}
gint
tracker_ontology_get_service_parent_id_by_id (gint id)
{
- TrackerService *service;
+ TrackerClass *service;
const gchar *parent = NULL;
service = ontology_hash_lookup_by_id (service_ids, id);
if (service) {
- parent = tracker_service_get_parent (service);
+ parent = tracker_class_get_parent (service);
}
if (!parent) {
@@ -364,7 +364,7 @@ tracker_ontology_get_service_parent_id_by_id (gint id)
return -1;
}
- return tracker_service_get_id (service);
+ return tracker_class_get_id (service);
}
TrackerDBType
@@ -394,7 +394,7 @@ tracker_ontology_get_service_db_by_name (const gchar *service_str)
GSList *
tracker_ontology_get_service_names_registered (void)
{
- TrackerService *service;
+ TrackerClass *service;
GList *services, *l;
GSList *names = NULL;
@@ -402,7 +402,7 @@ tracker_ontology_get_service_names_registered (void)
for (l = services; l; l = l->next) {
service = l->data;
- names = g_slist_prepend (names, g_strdup (tracker_service_get_name (service)));
+ names = g_slist_prepend (names, g_strdup (tracker_class_get_name (service)));
}
return names;
@@ -420,8 +420,8 @@ tracker_ontology_get_field_names_registered (const gchar *service_str)
parent_prefix = NULL;
if (service_str) {
- TrackerService *service;
- TrackerService *parent;
+ TrackerClass *service;
+ TrackerClass *parent;
const gchar *parent_name;
service = tracker_ontology_get_service_by_name (service_str);
@@ -430,7 +430,7 @@ tracker_ontology_get_field_names_registered (const gchar *service_str)
}
/* Prefix for properties of the category */
- prefix = tracker_service_get_property_prefix (service);
+ prefix = tracker_class_get_property_prefix (service);
if (!prefix || g_strcmp0 (prefix, " ") == 0) {
prefix = service_str;
@@ -443,7 +443,7 @@ tracker_ontology_get_field_names_registered (const gchar *service_str)
parent = tracker_ontology_get_service_by_name (parent_name);
if (parent) {
- parent_prefix = tracker_service_get_property_prefix (parent);
+ parent_prefix = tracker_class_get_property_prefix (parent);
if (!parent_prefix || g_strcmp0 (parent_prefix, " ") == 0) {
parent_prefix = parent_name;
@@ -479,16 +479,16 @@ calculate_subcategories_foreach (gpointer key,
gpointer value,
gpointer user_data)
{
- TrackerService *service;
+ TrackerClass *service;
CalculateSubcategoriesForEach *data;
service = value;
data = user_data;
- if (!g_strcmp0 (tracker_service_get_name (service), data->name) ||
- !g_strcmp0 (tracker_service_get_parent (service), data->name) ||
+ if (!g_strcmp0 (tracker_class_get_name (service), data->name) ||
+ !g_strcmp0 (tracker_class_get_parent (service), data->name) ||
!g_strcmp0 ("*", data->name)) {
- gint id = tracker_service_get_id (service);
+ gint id = tracker_class_get_id (service);
g_array_append_val (data->subcategories, id);
}
}
@@ -529,7 +529,7 @@ tracker_ontology_service_is_valid (const gchar *service_str)
gboolean
tracker_ontology_service_has_embedded (const gchar *service_str)
{
- TrackerService *service;
+ TrackerClass *service;
g_return_val_if_fail (service_str != NULL, FALSE);
@@ -539,13 +539,13 @@ tracker_ontology_service_has_embedded (const gchar *service_str)
return FALSE;
}
- return tracker_service_get_embedded (service);
+ return tracker_class_get_embedded (service);
}
gboolean
tracker_ontology_service_has_metadata (const gchar *service_str)
{
- TrackerService *service;
+ TrackerClass *service;
g_return_val_if_fail (service_str != NULL, FALSE);
@@ -555,13 +555,13 @@ tracker_ontology_service_has_metadata (const gchar *service_str)
return FALSE;
}
- return tracker_service_get_has_metadata (service);
+ return tracker_class_get_has_metadata (service);
}
gboolean
tracker_ontology_service_has_thumbnails (const gchar *service_str)
{
- TrackerService *service;
+ TrackerClass *service;
g_return_val_if_fail (service_str != NULL, FALSE);
@@ -571,13 +571,13 @@ tracker_ontology_service_has_thumbnails (const gchar *service_str)
return FALSE;
}
- return tracker_service_get_has_thumbs (service);
+ return tracker_class_get_has_thumbs (service);
}
gboolean
tracker_ontology_service_has_text (const char *service_str)
{
- TrackerService *service;
+ TrackerClass *service;
g_return_val_if_fail (service_str != NULL, FALSE);
@@ -587,14 +587,14 @@ tracker_ontology_service_has_text (const char *service_str)
return FALSE;
}
- return tracker_service_get_has_full_text (service);
+ return tracker_class_get_has_full_text (service);
}
gint
tracker_ontology_service_get_key_metadata (const gchar *service_str,
const gchar *meta_name)
{
- TrackerService *service;
+ TrackerClass *service;
gint i;
const GSList *l;
@@ -607,7 +607,7 @@ tracker_ontology_service_get_key_metadata (const gchar *service_str,
return 0;
}
- for (l = tracker_service_get_key_metadata (service), i = 1;
+ for (l = tracker_class_get_key_metadata (service), i = 1;
l;
l = l->next, i++) {
if (!l->data) {
@@ -639,7 +639,7 @@ tracker_ontology_service_get_key_collate (const gchar *service_str,
gboolean
tracker_ontology_service_get_show_directories (const gchar *service_str)
{
- TrackerService *service;
+ TrackerClass *service;
service = g_hash_table_lookup (service_names, service_str);
@@ -647,13 +647,13 @@ tracker_ontology_service_get_show_directories (const gchar *service_str)
return FALSE;
}
- return tracker_service_get_show_service_directories (service);
+ return tracker_class_get_show_service_directories (service);
}
gboolean
tracker_ontology_service_get_show_files (const gchar *service_str)
{
- TrackerService *service;
+ TrackerClass *service;
service = g_hash_table_lookup (service_names, service_str);
@@ -661,7 +661,7 @@ tracker_ontology_service_get_show_files (const gchar *service_str)
return FALSE;
}
- return tracker_service_get_show_service_files (service);
+ return tracker_class_get_show_service_files (service);
}
/* Field mechanics */
diff --git a/src/libtracker-common/tracker-ontology.h b/src/libtracker-common/tracker-ontology.h
index 17cf62b..c53f4a5 100644
--- a/src/libtracker-common/tracker-ontology.h
+++ b/src/libtracker-common/tracker-ontology.h
@@ -25,7 +25,7 @@
#include <glib-object.h>
#include "tracker-field.h"
-#include "tracker-service.h"
+#include "tracker-class.h"
G_BEGIN_DECLS
@@ -37,10 +37,10 @@ void tracker_ontology_init (void);
void tracker_ontology_shutdown (void);
/* Service mechanics */
-void tracker_ontology_service_add (TrackerService *service,
+void tracker_ontology_service_add (TrackerClass *service,
GSList *mimes,
GSList *mime_prefixes);
-TrackerService *tracker_ontology_get_service_by_name (const gchar *service_str);
+TrackerClass *tracker_ontology_get_service_by_name (const gchar *service_str);
G_CONST_RETURN gchar *
tracker_ontology_get_service_by_id (gint id);
G_CONST_RETURN gchar *
diff --git a/src/libtracker-common/tracker-service.c b/src/libtracker-common/tracker-service.c
deleted file mode 100644
index fc35174..0000000
--- a/src/libtracker-common/tracker-service.c
+++ /dev/null
@@ -1,844 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * 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 General Public
- * License as published by the Free Software Foundation; either
- * version 2 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
- * General Public License for more details.
- *
- * You should have received a copy of the GNU 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.
- */
-
-#include <string.h>
-#include <stdlib.h>
-
-#include <glib.h>
-
-#include "tracker-service.h"
-
-#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TRACKER_TYPE_SERVICE, TrackerServicePriv))
-
-typedef struct _TrackerServicePriv TrackerServicePriv;
-
-struct _TrackerServicePriv {
- gint id;
-
- gchar *name;
- gchar *parent;
-
- gchar *property_prefix;
- gchar *content_metadata;
- GSList *key_metadata;
-
- TrackerDBType db_type;
-
- gboolean enabled;
- gboolean embedded;
-
- gboolean has_metadata;
- gboolean has_full_text;
- gboolean has_thumbs;
-
- gboolean show_service_files;
- gboolean show_service_directories;
-};
-
-static void service_finalize (GObject *object);
-static void service_get_property (GObject *object,
- guint param_id,
- GValue *value,
- GParamSpec *pspec);
-static void service_set_property (GObject *object,
- guint param_id,
- const GValue *value,
- GParamSpec *pspec);
-
-enum {
- PROP_0,
- PROP_ID,
- PROP_NAME,
- PROP_PARENT,
- PROP_PROPERTY_PREFIX,
- PROP_CONTENT_METADATA,
- PROP_KEY_METADATA,
- PROP_DB_TYPE,
- PROP_ENABLED,
- PROP_EMBEDDED,
- PROP_HAS_METADATA,
- PROP_HAS_FULL_TEXT,
- PROP_HAS_THUMBS,
- PROP_SHOW_SERVICE_FILES,
- PROP_SHOW_SERVICE_DIRECTORIES
-};
-
-GType
-tracker_db_type_get_type (void)
-{
- static GType etype = 0;
-
- if (etype == 0) {
- static const GEnumValue values[] = {
- { TRACKER_DB_TYPE_UNKNOWN,
- "TRACKER_DB_TYPE_UNKNOWN",
- "unknown" },
- { TRACKER_DB_TYPE_DATA,
- "TRACKER_DB_TYPE_DATA",
- "data" },
- { TRACKER_DB_TYPE_INDEX,
- "TRACKER_DB_TYPE_INDEX",
- "index" },
- { TRACKER_DB_TYPE_COMMON,
- "TRACKER_DB_TYPE_COMMON",
- "common" },
- { TRACKER_DB_TYPE_CONTENT,
- "TRACKER_DB_TYPE_CONTENT",
- "content" },
- { TRACKER_DB_TYPE_EMAIL,
- "TRACKER_DB_TYPE_EMAIL",
- "email" },
- { TRACKER_DB_TYPE_FILES,
- "TRACKER_DB_TYPE_FILES",
- "files" },
- { TRACKER_DB_TYPE_CACHE,
- "TRACKER_DB_TYPE_CACHE",
- "cache" },
- { TRACKER_DB_TYPE_USER,
- "TRACKER_DB_TYPE_USER",
- "user" },
- { 0, NULL, NULL }
- };
-
- etype = g_enum_register_static ("TrackerDBType", values);
- }
-
- return etype;
-}
-
-G_DEFINE_TYPE (TrackerService, tracker_service, G_TYPE_OBJECT);
-
-static void
-tracker_service_class_init (TrackerServiceClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- object_class->finalize = service_finalize;
- object_class->get_property = service_get_property;
- object_class->set_property = service_set_property;
-
- g_object_class_install_property (object_class,
- PROP_ID,
- g_param_spec_int ("id",
- "id",
- "Unique identifier for this service",
- 0,
- G_MAXINT,
- 0,
- G_PARAM_READWRITE));
- g_object_class_install_property (object_class,
- PROP_NAME,
- g_param_spec_string ("name",
- "name",
- "Service name",
- NULL,
- G_PARAM_READWRITE));
- g_object_class_install_property (object_class,
- PROP_PARENT,
- g_param_spec_string ("parent",
- "parent",
- "Service name of parent",
- NULL,
- G_PARAM_READWRITE));
- g_object_class_install_property (object_class,
- PROP_PROPERTY_PREFIX,
- g_param_spec_string ("property-prefix",
- "property-prefix",
- "The properties of this category are prefix:name",
- NULL,
- G_PARAM_READWRITE));
- g_object_class_install_property (object_class,
- PROP_CONTENT_METADATA,
- g_param_spec_string ("content-metadata",
- "content-metadata",
- "Content metadata",
- NULL,
- G_PARAM_READWRITE));
- g_object_class_install_property (object_class,
- PROP_KEY_METADATA,
- g_param_spec_pointer ("key-metadata",
- "key-metadata",
- "Key metadata",
- G_PARAM_READWRITE));
- g_object_class_install_property (object_class,
- PROP_DB_TYPE,
- g_param_spec_enum ("db-type",
- "db-type",
- "Database type",
- tracker_db_type_get_type (),
- TRACKER_DB_TYPE_DATA,
- G_PARAM_READWRITE));
- g_object_class_install_property (object_class,
- PROP_ENABLED,
- g_param_spec_boolean ("enabled",
- "enabled",
- "Enabled",
- TRUE,
- G_PARAM_READWRITE));
- g_object_class_install_property (object_class,
- PROP_EMBEDDED,
- g_param_spec_boolean ("embedded",
- "embedded",
- "Embedded",
- FALSE,
- G_PARAM_READWRITE));
- g_object_class_install_property (object_class,
- PROP_HAS_METADATA,
- g_param_spec_boolean ("has-metadata",
- "has-metadata",
- "Has metadata",
- FALSE,
- G_PARAM_READWRITE));
- g_object_class_install_property (object_class,
- PROP_HAS_FULL_TEXT,
- g_param_spec_boolean ("has-full-text",
- "has-full-text",
- "Has full text",
- FALSE,
- G_PARAM_READWRITE));
- g_object_class_install_property (object_class,
- PROP_HAS_THUMBS,
- g_param_spec_boolean ("has-thumbs",
- "has-thumbs",
- "Has thumbnails",
- FALSE,
- G_PARAM_READWRITE));
- g_object_class_install_property (object_class,
- PROP_SHOW_SERVICE_FILES,
- g_param_spec_boolean ("show-service-files",
- "show-service-files",
- "Show service files",
- FALSE,
- G_PARAM_READWRITE));
- g_object_class_install_property (object_class,
- PROP_SHOW_SERVICE_DIRECTORIES,
- g_param_spec_boolean ("show-service-directories",
- "show-service-directories",
- "Show service directories",
- FALSE,
- G_PARAM_READWRITE));
-
- g_type_class_add_private (object_class, sizeof (TrackerServicePriv));
-}
-
-static void
-tracker_service_init (TrackerService *service)
-{
-}
-
-static void
-service_finalize (GObject *object)
-{
- TrackerServicePriv *priv;
-
- priv = GET_PRIV (object);
-
- g_free (priv->name);
- g_free (priv->parent);
- g_free (priv->content_metadata);
- g_free (priv->property_prefix);
-
- g_slist_foreach (priv->key_metadata, (GFunc) g_free, NULL);
- g_slist_free (priv->key_metadata);
-
- (G_OBJECT_CLASS (tracker_service_parent_class)->finalize) (object);
-}
-
-static void
-service_get_property (GObject *object,
- guint param_id,
- GValue *value,
- GParamSpec *pspec)
-{
- TrackerServicePriv *priv;
-
- priv = GET_PRIV (object);
-
- switch (param_id) {
- case PROP_ID:
- g_value_set_int (value, priv->id);
- break;
- case PROP_NAME:
- g_value_set_string (value, priv->name);
- break;
- case PROP_PARENT:
- g_value_set_string (value, priv->parent);
- break;
- case PROP_PROPERTY_PREFIX:
- g_value_set_string (value, priv->property_prefix);
- break;
- case PROP_CONTENT_METADATA:
- g_value_set_string (value, priv->content_metadata);
- break;
- case PROP_KEY_METADATA:
- g_value_set_pointer (value, priv->key_metadata);
- break;
- case PROP_DB_TYPE:
- g_value_set_enum (value, priv->db_type);
- break;
- case PROP_ENABLED:
- g_value_set_boolean (value, priv->enabled);
- break;
- case PROP_EMBEDDED:
- g_value_set_boolean (value, priv->embedded);
- break;
- case PROP_HAS_METADATA:
- g_value_set_boolean (value, priv->has_metadata);
- break;
- case PROP_HAS_FULL_TEXT:
- g_value_set_boolean (value, priv->has_full_text);
- break;
- case PROP_HAS_THUMBS:
- g_value_set_boolean (value, priv->has_thumbs);
- break;
- case PROP_SHOW_SERVICE_FILES:
- g_value_set_boolean (value, priv->show_service_files);
- break;
- case PROP_SHOW_SERVICE_DIRECTORIES:
- g_value_set_boolean (value, priv->show_service_directories);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
- break;
- };
-}
-
-static void
-service_set_property (GObject *object,
- guint param_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- TrackerServicePriv *priv;
-
- priv = GET_PRIV (object);
-
- switch (param_id) {
- case PROP_ID:
- tracker_service_set_id (TRACKER_SERVICE (object),
- g_value_get_int (value));
- break;
- case PROP_NAME:
- tracker_service_set_name (TRACKER_SERVICE (object),
- g_value_get_string (value));
- break;
- case PROP_PROPERTY_PREFIX:
- tracker_service_set_property_prefix (TRACKER_SERVICE (object),
- g_value_get_string (value));
- break;
- case PROP_PARENT:
- tracker_service_set_parent (TRACKER_SERVICE (object),
- g_value_get_string (value));
- break;
- case PROP_CONTENT_METADATA:
- tracker_service_set_content_metadata (TRACKER_SERVICE (object),
- g_value_get_string (value));
- break;
- case PROP_KEY_METADATA:
- tracker_service_set_key_metadata (TRACKER_SERVICE (object),
- g_value_get_pointer (value));
- break;
- case PROP_DB_TYPE:
- tracker_service_set_db_type (TRACKER_SERVICE (object),
- g_value_get_enum (value));
- break;
- case PROP_ENABLED:
- tracker_service_set_enabled (TRACKER_SERVICE (object),
- g_value_get_boolean (value));
- break;
- case PROP_EMBEDDED:
- tracker_service_set_embedded (TRACKER_SERVICE (object),
- g_value_get_boolean (value));
- break;
- case PROP_HAS_METADATA:
- tracker_service_set_has_metadata (TRACKER_SERVICE (object),
- g_value_get_boolean (value));
- break;
- case PROP_HAS_FULL_TEXT:
- tracker_service_set_has_full_text (TRACKER_SERVICE (object),
- g_value_get_boolean (value));
- break;
- case PROP_HAS_THUMBS:
- tracker_service_set_has_thumbs (TRACKER_SERVICE (object),
- g_value_get_boolean (value));
- break;
- case PROP_SHOW_SERVICE_FILES:
- tracker_service_set_show_service_files (TRACKER_SERVICE (object),
- g_value_get_boolean (value));
- break;
- case PROP_SHOW_SERVICE_DIRECTORIES:
- tracker_service_set_show_service_directories (TRACKER_SERVICE (object),
- g_value_get_boolean (value));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
- break;
- };
-}
-
-static gboolean
-service_int_validate (TrackerService *service,
- const gchar *property,
- gint value)
-{
-#ifdef G_DISABLE_CHECKS
- GParamSpec *spec;
- GValue value = { 0 };
- gboolean valid;
-
- spec = g_object_class_find_property (G_OBJECT_CLASS (service), property);
- g_return_val_if_fail (spec != NULL, FALSE);
-
- g_value_init (&value, spec->value_type);
- g_value_set_int (&value, verbosity);
- valid = g_param_value_validate (spec, &value);
- g_value_unset (&value);
-
- g_return_val_if_fail (valid != TRUE, FALSE);
-#endif
-
- return TRUE;
-}
-
-TrackerService *
-tracker_service_new (void)
-{
- TrackerService *service;
-
- service = g_object_new (TRACKER_TYPE_SERVICE, NULL);
-
- return service;
-}
-
-gint
-tracker_service_get_id (TrackerService *service)
-{
- TrackerServicePriv *priv;
-
- g_return_val_if_fail (TRACKER_IS_SERVICE (service), -1);
-
- priv = GET_PRIV (service);
-
- return priv->id;
-}
-
-const gchar *
-tracker_service_get_name (TrackerService *service)
-{
- TrackerServicePriv *priv;
-
- g_return_val_if_fail (TRACKER_IS_SERVICE (service), NULL);
-
- priv = GET_PRIV (service);
-
- return priv->name;
-}
-
-const gchar *
-tracker_service_get_parent (TrackerService *service)
-{
- TrackerServicePriv *priv;
-
- g_return_val_if_fail (TRACKER_IS_SERVICE (service), NULL);
-
- priv = GET_PRIV (service);
-
- return priv->parent;
-}
-
-const gchar *
-tracker_service_get_property_prefix (TrackerService *service)
-{
- TrackerServicePriv *priv;
-
- g_return_val_if_fail (TRACKER_IS_SERVICE (service), NULL);
-
- priv = GET_PRIV (service);
-
- return priv->property_prefix;
-}
-
-const gchar *
-tracker_service_get_content_metadata (TrackerService *service)
-{
- TrackerServicePriv *priv;
-
- g_return_val_if_fail (TRACKER_IS_SERVICE (service), NULL);
-
- priv = GET_PRIV (service);
-
- return priv->content_metadata;
-}
-
-const GSList *
-tracker_service_get_key_metadata (TrackerService *service)
-{
- TrackerServicePriv *priv;
-
- g_return_val_if_fail (TRACKER_IS_SERVICE (service), NULL);
-
- priv = GET_PRIV (service);
-
- return priv->key_metadata;
-}
-
-TrackerDBType
-tracker_service_get_db_type (TrackerService *service)
-{
- TrackerServicePriv *priv;
-
- g_return_val_if_fail (TRACKER_IS_SERVICE (service), TRACKER_DB_TYPE_DATA);
-
- priv = GET_PRIV (service);
-
- return priv->db_type;
-}
-
-gboolean
-tracker_service_get_enabled (TrackerService *service)
-{
- TrackerServicePriv *priv;
-
- g_return_val_if_fail (TRACKER_IS_SERVICE (service), FALSE);
-
- priv = GET_PRIV (service);
-
- return priv->enabled;
-}
-
-gboolean
-tracker_service_get_embedded (TrackerService *service)
-{
- TrackerServicePriv *priv;
-
- g_return_val_if_fail (TRACKER_IS_SERVICE (service), FALSE);
-
- priv = GET_PRIV (service);
-
- return priv->embedded;
-}
-
-gboolean
-tracker_service_get_has_metadata (TrackerService *service)
-{
- TrackerServicePriv *priv;
-
- g_return_val_if_fail (TRACKER_IS_SERVICE (service), FALSE);
-
- priv = GET_PRIV (service);
-
- return priv->has_metadata;
-}
-
-gboolean
-tracker_service_get_has_full_text (TrackerService *service)
-{
- TrackerServicePriv *priv;
-
- g_return_val_if_fail (TRACKER_IS_SERVICE (service), FALSE);
-
- priv = GET_PRIV (service);
-
- return priv->has_full_text;
-}
-
-gboolean
-tracker_service_get_has_thumbs (TrackerService *service)
-{
- TrackerServicePriv *priv;
-
- g_return_val_if_fail (TRACKER_IS_SERVICE (service), FALSE);
-
- priv = GET_PRIV (service);
-
- return priv->has_thumbs;
-}
-
-gboolean
-tracker_service_get_show_service_files (TrackerService *service)
-{
- TrackerServicePriv *priv;
-
- g_return_val_if_fail (TRACKER_IS_SERVICE (service), FALSE);
-
- priv = GET_PRIV (service);
-
- return priv->show_service_files;
-}
-
-gboolean
-tracker_service_get_show_service_directories (TrackerService *service)
-{
- TrackerServicePriv *priv;
-
- g_return_val_if_fail (TRACKER_IS_SERVICE (service), FALSE);
-
- priv = GET_PRIV (service);
-
- return priv->show_service_directories;
-}
-
-void
-tracker_service_set_id (TrackerService *service,
- gint value)
-{
- TrackerServicePriv *priv;
-
- g_return_if_fail (TRACKER_IS_SERVICE (service));
-
- if (!service_int_validate (service, "id", value)) {
- return;
- }
-
- priv = GET_PRIV (service);
-
- priv->id = value;
- g_object_notify (G_OBJECT (service), "id");
-}
-
-void
-tracker_service_set_name (TrackerService *service,
- const gchar *value)
-{
- TrackerServicePriv *priv;
-
- g_return_if_fail (TRACKER_IS_SERVICE (service));
-
- priv = GET_PRIV (service);
-
- g_free (priv->name);
-
- if (value) {
- priv->name = g_strdup (value);
- } else {
- priv->name = NULL;
- }
-
- g_object_notify (G_OBJECT (service), "name");
-}
-
-void
-tracker_service_set_parent (TrackerService *service,
- const gchar *value)
-{
- TrackerServicePriv *priv;
-
- g_return_if_fail (TRACKER_IS_SERVICE (service));
-
- priv = GET_PRIV (service);
-
- g_free (priv->parent);
-
- if (value) {
- priv->parent = g_strdup (value);
- } else {
- priv->parent = NULL;
- }
-
- g_object_notify (G_OBJECT (service), "parent");
-}
-
-void
-tracker_service_set_property_prefix (TrackerService *service,
- const gchar *value)
-{
- TrackerServicePriv *priv;
-
- g_return_if_fail (TRACKER_IS_SERVICE (service));
-
- priv = GET_PRIV (service);
-
- g_free (priv->property_prefix);
-
- if (value) {
- priv->property_prefix = g_strdup (value);
- } else {
- priv->property_prefix = NULL;
- }
-
- g_object_notify (G_OBJECT (service), "property-prefix");
-}
-
-void
-tracker_service_set_content_metadata (TrackerService *service,
- const gchar *value)
-{
- TrackerServicePriv *priv;
-
- g_return_if_fail (TRACKER_IS_SERVICE (service));
-
- priv = GET_PRIV (service);
-
- g_free (priv->content_metadata);
-
- if (value) {
- priv->content_metadata = g_strdup (value);
- } else {
- priv->content_metadata = NULL;
- }
-
- g_object_notify (G_OBJECT (service), "content-metadata");
-}
-
-void
-tracker_service_set_key_metadata (TrackerService *service,
- const GSList *value)
-{
- TrackerServicePriv *priv;
-
- g_return_if_fail (TRACKER_IS_SERVICE (service));
-
- priv = GET_PRIV (service);
-
- g_slist_foreach (priv->key_metadata, (GFunc) g_free, NULL);
- g_slist_free (priv->key_metadata);
-
- if (value) {
- GSList *new_list;
- const GSList *l;
-
- new_list = NULL;
-
- for (l = value; l; l = l->next) {
- new_list = g_slist_prepend (new_list, g_strdup (l->data));
- }
-
- new_list = g_slist_reverse (new_list);
- priv->key_metadata = new_list;
- } else {
- priv->key_metadata = NULL;
- }
-
- g_object_notify (G_OBJECT (service), "key-metadata");
-}
-
-void
-tracker_service_set_db_type (TrackerService *service,
- TrackerDBType value)
-{
- TrackerServicePriv *priv;
-
- g_return_if_fail (TRACKER_IS_SERVICE (service));
-
- priv = GET_PRIV (service);
-
- priv->db_type = value;
- g_object_notify (G_OBJECT (service), "db-type");
-}
-
-void
-tracker_service_set_enabled (TrackerService *service,
- gboolean value)
-{
- TrackerServicePriv *priv;
-
- g_return_if_fail (TRACKER_IS_SERVICE (service));
-
- priv = GET_PRIV (service);
-
- priv->enabled = value;
- g_object_notify (G_OBJECT (service), "enabled");
-}
-
-void
-tracker_service_set_embedded (TrackerService *service,
- gboolean value)
-{
- TrackerServicePriv *priv;
-
- g_return_if_fail (TRACKER_IS_SERVICE (service));
-
- priv = GET_PRIV (service);
-
- priv->embedded = value;
- g_object_notify (G_OBJECT (service), "embedded");
-}
-
-void
-tracker_service_set_has_metadata (TrackerService *service,
- gboolean value)
-{
- TrackerServicePriv *priv;
-
- g_return_if_fail (TRACKER_IS_SERVICE (service));
-
- priv = GET_PRIV (service);
-
- priv->has_metadata = value;
- g_object_notify (G_OBJECT (service), "has-metadata");
-}
-
-void
-tracker_service_set_has_full_text (TrackerService *service,
- gboolean value)
-{
- TrackerServicePriv *priv;
-
- g_return_if_fail (TRACKER_IS_SERVICE (service));
-
- priv = GET_PRIV (service);
-
- priv->has_full_text = value;
- g_object_notify (G_OBJECT (service), "has-full-text");
-}
-
-void
-tracker_service_set_has_thumbs (TrackerService *service,
- gboolean value)
-{
- TrackerServicePriv *priv;
-
- g_return_if_fail (TRACKER_IS_SERVICE (service));
-
- priv = GET_PRIV (service);
-
- priv->has_thumbs = value;
- g_object_notify (G_OBJECT (service), "has-thumbs");
-}
-
-void
-tracker_service_set_show_service_files (TrackerService *service,
- gboolean value)
-{
- TrackerServicePriv *priv;
-
- g_return_if_fail (TRACKER_IS_SERVICE (service));
-
- priv = GET_PRIV (service);
-
- priv->show_service_files = value;
- g_object_notify (G_OBJECT (service), "show-service-files");
-}
-
-void
-tracker_service_set_show_service_directories (TrackerService *service,
- gboolean value)
-{
- TrackerServicePriv *priv;
-
- g_return_if_fail (TRACKER_IS_SERVICE (service));
-
- priv = GET_PRIV (service);
-
- priv->show_service_directories = value;
- g_object_notify (G_OBJECT (service), "show-service-directories");
-}
-
diff --git a/src/libtracker-common/tracker-service.h b/src/libtracker-common/tracker-service.h
deleted file mode 100644
index 849a788..0000000
--- a/src/libtracker-common/tracker-service.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * 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 General Public
- * License as published by the Free Software Foundation; either
- * version 2 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
- * General Public License for more details.
- *
- * You should have received a copy of the GNU 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_COMMON_SERVICES_H__
-#define __LIBTRACKER_COMMON_SERVICES_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."
-#endif
-
-#define TRACKER_TYPE_DB_TYPE (tracker_db_type_get_type ())
-
-typedef enum {
- TRACKER_DB_TYPE_UNKNOWN,
- TRACKER_DB_TYPE_DATA,
- TRACKER_DB_TYPE_INDEX,
- TRACKER_DB_TYPE_COMMON,
- TRACKER_DB_TYPE_CONTENT,
- TRACKER_DB_TYPE_EMAIL,
- TRACKER_DB_TYPE_FILES,
- TRACKER_DB_TYPE_CACHE,
- TRACKER_DB_TYPE_USER
-} TrackerDBType;
-
-GType tracker_db_type_get_type (void) G_GNUC_CONST;
-
-
-#define TRACKER_TYPE_SERVICE (tracker_service_get_type ())
-#define TRACKER_SERVICE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), TRACKER_TYPE_SERVICE, TrackerService))
-#define TRACKER_SERVICE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), TRACKER_TYPE_SERVICE, TrackerServiceClass))
-#define TRACKER_IS_SERVICE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), TRACKER_TYPE_SERVICE))
-#define TRACKER_IS_SERVICE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), TRACKER_TYPE_SERVICE))
-#define TRACKER_SERVICE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), TRACKER_TYPE_SERVICE, TrackerServiceClass))
-
-typedef struct _TrackerService TrackerService;
-typedef struct _TrackerServiceClass TrackerServiceClass;
-
-struct _TrackerService {
- GObject parent;
-};
-
-struct _TrackerServiceClass {
- GObjectClass parent_class;
-};
-
-GType tracker_service_get_type (void) G_GNUC_CONST;
-
-TrackerService *tracker_service_new (void);
-
-gint tracker_service_get_id (TrackerService *service);
-const gchar * tracker_service_get_name (TrackerService *service);
-const gchar * tracker_service_get_parent (TrackerService *service);
-const gchar * tracker_service_get_property_prefix (TrackerService *service);
-const gchar * tracker_service_get_content_metadata (TrackerService *service);
-const GSList * tracker_service_get_key_metadata (TrackerService *service);
-TrackerDBType tracker_service_get_db_type (TrackerService *service);
-gboolean tracker_service_get_enabled (TrackerService *service);
-gboolean tracker_service_get_embedded (TrackerService *service);
-gboolean tracker_service_get_has_metadata (TrackerService *service);
-gboolean tracker_service_get_has_full_text (TrackerService *service);
-gboolean tracker_service_get_has_thumbs (TrackerService *service);
-gboolean tracker_service_get_show_service_files (TrackerService *service);
-gboolean tracker_service_get_show_service_directories (TrackerService *service);
-
-void tracker_service_set_id (TrackerService *service,
- gint value);
-void tracker_service_set_name (TrackerService *service,
- const gchar *value);
-void tracker_service_set_parent (TrackerService *service,
- const gchar *value);
-void tracker_service_set_property_prefix (TrackerService *service,
- const gchar *value);
-void tracker_service_set_content_metadata (TrackerService *service,
- const gchar *value);
-void tracker_service_set_key_metadata (TrackerService *service,
- const GSList *value);
-void tracker_service_set_db_type (TrackerService *service,
- TrackerDBType value);
-void tracker_service_set_enabled (TrackerService *service,
- gboolean value);
-void tracker_service_set_embedded (TrackerService *service,
- gboolean value);
-void tracker_service_set_has_metadata (TrackerService *service,
- gboolean value);
-void tracker_service_set_has_full_text (TrackerService *service,
- gboolean value);
-void tracker_service_set_has_thumbs (TrackerService *service,
- gboolean value);
-void tracker_service_set_show_service_files (TrackerService *service,
- gboolean value);
-void tracker_service_set_show_service_directories (TrackerService *service,
- gboolean value);
-
-G_END_DECLS
-
-#endif /* __LIBTRACKER_COMMON_SERVICE_H__ */
-
diff --git a/src/libtracker-data/tracker-data-backup.c b/src/libtracker-data/tracker-data-backup.c
index b372d98..ac2ec34 100644
--- a/src/libtracker-data/tracker-data-backup.c
+++ b/src/libtracker-data/tracker-data-backup.c
@@ -112,7 +112,7 @@ tracker_data_backup_save (const gchar *turtle_filename,
{
#ifdef HAVE_RAPTOR
TrackerDBResultSet *data;
- TrackerService *service;
+ TrackerClass *service;
TurtleFile *turtle_file;
/* TODO: temporary location */
diff --git a/src/libtracker-data/tracker-data-query.c b/src/libtracker-data/tracker-data-query.c
index 9b28a1a..e9107ca 100644
--- a/src/libtracker-data/tracker-data-query.c
+++ b/src/libtracker-data/tracker-data-query.c
@@ -190,7 +190,7 @@ tracker_data_query_file_id_as_string (const gchar *service_type,
}
gboolean
-tracker_data_query_service_exists (TrackerService *service,
+tracker_data_query_service_exists (TrackerClass *service,
const gchar *dirname,
const gchar *basename,
guint32 *service_id,
@@ -204,7 +204,7 @@ tracker_data_query_service_exists (TrackerService *service,
db_id = db_mtime = 0;
- iface = tracker_db_manager_get_db_interface_by_type (tracker_service_get_name (service),
+ iface = tracker_db_manager_get_db_interface_by_type (tracker_class_get_name (service),
TRACKER_DB_CONTENT_TYPE_METADATA);
result_set = tracker_db_interface_execute_procedure (iface, NULL,
@@ -260,7 +260,7 @@ tracker_data_query_service_type_id (const gchar *dirname,
}
GHashTable *
-tracker_data_query_service_children (TrackerService *service,
+tracker_data_query_service_children (TrackerClass *service,
const gchar *dirname)
{
TrackerDBInterface *iface;
@@ -268,7 +268,7 @@ tracker_data_query_service_children (TrackerService *service,
gboolean valid = TRUE;
GHashTable *children;
- iface = tracker_db_manager_get_db_interface_by_type (tracker_service_get_name (service),
+ iface = tracker_db_manager_get_db_interface_by_type (tracker_class_get_name (service),
TRACKER_DB_CONTENT_TYPE_METADATA);
result_set = tracker_db_interface_execute_procedure (iface, NULL,
@@ -382,7 +382,7 @@ result_set_to_metadata (TrackerDBResultSet *result_set,
}
TrackerDataMetadata *
-tracker_data_query_metadata (TrackerService *service,
+tracker_data_query_metadata (TrackerClass *service,
guint32 service_id,
gboolean embedded)
{
@@ -393,10 +393,10 @@ tracker_data_query_metadata (TrackerService *service,
metadata = tracker_data_metadata_new ();
- g_return_val_if_fail (TRACKER_IS_SERVICE (service), metadata);
+ g_return_val_if_fail (TRACKER_IS_CLASS (service), metadata);
service_id_str = g_strdup_printf ("%d", service_id);
- iface = tracker_db_manager_get_db_interface_by_type (tracker_service_get_name (service),
+ iface = tracker_db_manager_get_db_interface_by_type (tracker_class_get_name (service),
TRACKER_DB_CONTENT_TYPE_METADATA);
@@ -416,14 +416,14 @@ tracker_data_query_metadata (TrackerService *service,
}
TrackerDBResultSet *
-tracker_data_query_backup_metadata (TrackerService *service)
+tracker_data_query_backup_metadata (TrackerClass *service)
{
TrackerDBInterface *iface;
TrackerDBResultSet *result_set;
- g_return_val_if_fail (TRACKER_IS_SERVICE (service), NULL);
+ g_return_val_if_fail (TRACKER_IS_CLASS (service), NULL);
- iface = tracker_db_manager_get_db_interface_by_service (tracker_service_get_name (service));
+ iface = tracker_db_manager_get_db_interface_by_service (tracker_class_get_name (service));
result_set = tracker_data_manager_exec_proc (iface,
"GetUserMetadataBackup",
@@ -432,7 +432,7 @@ tracker_data_query_backup_metadata (TrackerService *service)
}
static gchar *
-db_get_metadata (TrackerService *service,
+db_get_metadata (TrackerClass *service,
guint service_id,
gboolean keywords)
{
@@ -442,7 +442,7 @@ db_get_metadata (TrackerService *service,
GString *result;
gchar *str = NULL;
- iface = tracker_db_manager_get_db_interface_by_type (tracker_service_get_name (service),
+ iface = tracker_db_manager_get_db_interface_by_type (tracker_class_get_name (service),
TRACKER_DB_CONTENT_TYPE_METADATA);
result = g_string_new ("");
@@ -480,21 +480,21 @@ db_get_metadata (TrackerService *service,
}
gchar *
-tracker_data_query_unparsed_metadata (TrackerService *service,
+tracker_data_query_unparsed_metadata (TrackerClass *service,
guint service_id)
{
return db_get_metadata (service, service_id, TRUE);
}
gchar *
-tracker_data_query_parsed_metadata (TrackerService *service,
+tracker_data_query_parsed_metadata (TrackerClass *service,
guint service_id)
{
return db_get_metadata (service, service_id, FALSE);
}
gchar **
-tracker_data_query_metadata_field_values (TrackerService *service_def,
+tracker_data_query_metadata_field_values (TrackerClass *service_def,
guint32 service_id,
TrackerField *field)
{
@@ -504,9 +504,9 @@ tracker_data_query_metadata_field_values (TrackerService *service_def,
gchar **final_result = NULL;
gboolean is_numeric = FALSE;
- iface = tracker_db_manager_get_db_interface_by_type (tracker_service_get_name (service_def),
+ iface = tracker_db_manager_get_db_interface_by_type (tracker_class_get_name (service_def),
TRACKER_DB_CONTENT_TYPE_METADATA);
- metadata_key = tracker_ontology_service_get_key_metadata (tracker_service_get_name (service_def),
+ metadata_key = tracker_ontology_service_get_key_metadata (tracker_class_get_name (service_def),
tracker_field_get_name (field));
if (metadata_key > 0) {
@@ -582,7 +582,7 @@ tracker_data_query_metadata_field_values (TrackerService *service_def,
}
gchar *
-tracker_data_query_content (TrackerService *service,
+tracker_data_query_content (TrackerClass *service,
guint32 service_id)
{
TrackerDBInterface *iface;
@@ -592,7 +592,7 @@ tracker_data_query_content (TrackerService *service,
service_id_str = tracker_guint32_to_string (service_id);
field = tracker_ontology_get_field_by_name ("File:Contents");
- iface = tracker_db_manager_get_db_interface_by_type (tracker_service_get_name (service),
+ iface = tracker_db_manager_get_db_interface_by_type (tracker_class_get_name (service),
TRACKER_DB_CONTENT_TYPE_CONTENTS);
/* Delete contents if it has! */
diff --git a/src/libtracker-data/tracker-data-query.h b/src/libtracker-data/tracker-data-query.h
index 352ed3e..3639bd7 100644
--- a/src/libtracker-data/tracker-data-query.h
+++ b/src/libtracker-data/tracker-data-query.h
@@ -42,27 +42,27 @@ G_BEGIN_DECLS
/* Metadata API */
GPtrArray * tracker_data_query_all_metadata (const gchar *service_type,
const gchar *service_id);
-TrackerDataMetadata *tracker_data_query_metadata (TrackerService *service,
+TrackerDataMetadata *tracker_data_query_metadata (TrackerClass *service,
guint32 service_id,
gboolean embedded);
-TrackerDBResultSet *tracker_data_query_backup_metadata (TrackerService *service);
-gchar * tracker_data_query_parsed_metadata (TrackerService *service,
+TrackerDBResultSet *tracker_data_query_backup_metadata (TrackerClass *service);
+gchar * tracker_data_query_parsed_metadata (TrackerClass *service,
guint32 service_id);
-gchar * tracker_data_query_unparsed_metadata (TrackerService *service,
+gchar * tracker_data_query_unparsed_metadata (TrackerClass *service,
guint32 service_id);
-gchar ** tracker_data_query_metadata_field_values (TrackerService *service_def,
+gchar ** tracker_data_query_metadata_field_values (TrackerClass *service_def,
guint32 service_id,
TrackerField *field_def);
/* Using path */
-gboolean tracker_data_query_service_exists (TrackerService *service,
+gboolean tracker_data_query_service_exists (TrackerClass *service,
const gchar *dirname,
const gchar *basename,
guint32 *service_id,
time_t *mtime);
guint tracker_data_query_service_type_id (const gchar *dirname,
const gchar *basename);
-GHashTable * tracker_data_query_service_children (TrackerService *service,
+GHashTable * tracker_data_query_service_children (TrackerClass *service,
const gchar *dirname);
/* Deleted files */
@@ -80,7 +80,7 @@ guint32 tracker_data_query_file_id (const gchar
const gchar *path);
gchar * tracker_data_query_file_id_as_string (const gchar *service_type,
const gchar *path);
-gchar * tracker_data_query_content (TrackerService *service,
+gchar * tracker_data_query_content (TrackerClass *service,
guint32 service_id);
G_END_DECLS
diff --git a/src/libtracker-data/tracker-data-update.c b/src/libtracker-data/tracker-data-update.c
index 2eb8005..b0572ad 100644
--- a/src/libtracker-data/tracker-data-update.c
+++ b/src/libtracker-data/tracker-data-update.c
@@ -36,7 +36,7 @@
#include "tracker-data-query.h"
typedef struct {
- TrackerService *service;
+ TrackerClass *service;
guint32 iid_value;
TrackerLanguage *language;
TrackerConfig *config;
@@ -90,7 +90,7 @@ tracker_data_update_get_new_service_id (TrackerDBInterface *iface)
}
gboolean
-tracker_data_update_create_service (TrackerService *service,
+tracker_data_update_create_service (TrackerClass *service,
guint32 service_id,
const gchar *dirname,
const gchar *basename,
@@ -119,11 +119,11 @@ tracker_data_update_create_service (TrackerService *service,
}
volume_id_str = tracker_guint32_to_string (volume_id);
- iface = tracker_db_manager_get_db_interface_by_type (tracker_service_get_name (service),
+ iface = tracker_db_manager_get_db_interface_by_type (tracker_class_get_name (service),
TRACKER_DB_CONTENT_TYPE_METADATA);
id_str = tracker_guint32_to_string (service_id);
- service_type_id_str = tracker_gint_to_string (tracker_service_get_id (service));
+ service_type_id_str = tracker_gint_to_string (tracker_class_get_id (service));
path = g_build_filename (dirname, basename, NULL);
@@ -153,16 +153,16 @@ tracker_data_update_create_service (TrackerService *service,
}
void
-tracker_data_update_disable_service (TrackerService *service,
+tracker_data_update_disable_service (TrackerClass *service,
guint32 service_id)
{
TrackerDBInterface *iface;
gchar *service_id_str;
- g_return_if_fail (TRACKER_IS_SERVICE (service));
+ g_return_if_fail (TRACKER_IS_CLASS (service));
g_return_if_fail (service_id >= 1);
- iface = tracker_db_manager_get_db_interface_by_type (tracker_service_get_name (service),
+ iface = tracker_db_manager_get_db_interface_by_type (tracker_class_get_name (service),
TRACKER_DB_CONTENT_TYPE_METADATA);
service_id_str = tracker_guint32_to_string (service_id);
@@ -181,17 +181,17 @@ tracker_data_update_disable_service (TrackerService *service,
}
void
-tracker_data_update_delete_service (TrackerService *service,
+tracker_data_update_delete_service (TrackerClass *service,
guint32 service_id)
{
TrackerDBInterface *iface;
gchar *service_id_str;
- g_return_if_fail (TRACKER_IS_SERVICE (service));
+ g_return_if_fail (TRACKER_IS_CLASS (service));
g_return_if_fail (service_id >= 1);
- iface = tracker_db_manager_get_db_interface_by_type (tracker_service_get_name (service),
+ iface = tracker_db_manager_get_db_interface_by_type (tracker_class_get_name (service),
TRACKER_DB_CONTENT_TYPE_METADATA);
service_id_str = tracker_guint32_to_string (service_id);
@@ -213,15 +213,15 @@ tracker_data_update_delete_service (TrackerService *service,
}
void
-tracker_data_update_delete_service_recursively (TrackerService *service,
+tracker_data_update_delete_service_recursively (TrackerClass *service,
const gchar *service_path)
{
TrackerDBInterface *iface;
- g_return_if_fail (TRACKER_IS_SERVICE (service));
+ g_return_if_fail (TRACKER_IS_CLASS (service));
g_return_if_fail (service_path != NULL);
- iface = tracker_db_manager_get_db_interface_by_type (tracker_service_get_name (service),
+ iface = tracker_db_manager_get_db_interface_by_type (tracker_class_get_name (service),
TRACKER_DB_CONTENT_TYPE_METADATA);
/* We have to give two arguments. One is the actual path and
@@ -238,7 +238,7 @@ tracker_data_update_delete_service_recursively (TrackerService *service,
}
gboolean
-tracker_data_update_move_service (TrackerService *service,
+tracker_data_update_move_service (TrackerClass *service,
const gchar *from,
const gchar *to)
{
@@ -250,11 +250,11 @@ tracker_data_update_move_service (TrackerService *service,
gchar *to_basename;
gboolean retval = TRUE;
- g_return_val_if_fail (TRACKER_IS_SERVICE (service), FALSE);
+ g_return_val_if_fail (TRACKER_IS_CLASS (service), FALSE);
g_return_val_if_fail (from != NULL, FALSE);
g_return_val_if_fail (to != NULL, FALSE);
- iface = tracker_db_manager_get_db_interface_by_type (tracker_service_get_name (service),
+ iface = tracker_db_manager_get_db_interface_by_type (tracker_class_get_name (service),
TRACKER_DB_CONTENT_TYPE_METADATA);
tracker_file_get_path_and_name (from,
@@ -286,13 +286,13 @@ tracker_data_update_move_service (TrackerService *service,
}
void
-tracker_data_update_delete_all_metadata (TrackerService *service,
+tracker_data_update_delete_all_metadata (TrackerClass *service,
guint32 service_id)
{
TrackerDBInterface *iface;
gchar *service_id_str;
- iface = tracker_db_manager_get_db_interface_by_type (tracker_service_get_name (service),
+ iface = tracker_db_manager_get_db_interface_by_type (tracker_class_get_name (service),
TRACKER_DB_CONTENT_TYPE_METADATA);
service_id_str = tracker_guint32_to_string (service_id);
@@ -319,7 +319,7 @@ tracker_data_update_delete_all_metadata (TrackerService *service,
}
void
-tracker_data_update_set_metadata (TrackerService *service,
+tracker_data_update_set_metadata (TrackerClass *service,
guint32 service_id,
TrackerField *field,
const gchar *value,
@@ -335,7 +335,7 @@ tracker_data_update_set_metadata (TrackerService *service,
id_str = tracker_guint32_to_string (service_id);
- iface = tracker_db_manager_get_db_interface_by_type (tracker_service_get_name (service),
+ iface = tracker_db_manager_get_db_interface_by_type (tracker_class_get_name (service),
TRACKER_DB_CONTENT_TYPE_METADATA);
switch (tracker_field_get_data_type (field)) {
@@ -383,7 +383,7 @@ tracker_data_update_set_metadata (TrackerService *service,
break;
}
- metadata_key = tracker_ontology_service_get_key_metadata (tracker_service_get_name (service),
+ metadata_key = tracker_ontology_service_get_key_metadata (tracker_class_get_name (service),
tracker_field_get_name (field));
if (metadata_key > 0) {
gchar *val;
@@ -405,7 +405,7 @@ tracker_data_update_set_metadata (TrackerService *service,
service_id);
}
- collate_key = tracker_ontology_service_get_key_collate (tracker_service_get_name (service),
+ collate_key = tracker_ontology_service_get_key_collate (tracker_class_get_name (service),
tracker_field_get_name (field));
if (collate_key > 0) {
gchar *val;
@@ -425,7 +425,7 @@ tracker_data_update_set_metadata (TrackerService *service,
}
void
-tracker_data_update_delete_metadata (TrackerService *service,
+tracker_data_update_delete_metadata (TrackerClass *service,
guint32 service_id,
TrackerField *field,
const gchar *value)
@@ -435,7 +435,7 @@ tracker_data_update_delete_metadata (TrackerService *service,
gchar *id_str;
id_str = tracker_guint32_to_string (service_id);
- iface = tracker_db_manager_get_db_interface_by_type (tracker_service_get_name (service),
+ iface = tracker_db_manager_get_db_interface_by_type (tracker_class_get_name (service),
TRACKER_DB_CONTENT_TYPE_METADATA);
switch (tracker_field_get_data_type (field)) {
@@ -488,7 +488,7 @@ tracker_data_update_delete_metadata (TrackerService *service,
break;
}
- metadata_key = tracker_ontology_service_get_key_metadata (tracker_service_get_name (service),
+ metadata_key = tracker_ontology_service_get_key_metadata (tracker_class_get_name (service),
tracker_field_get_name (field));
if (metadata_key > 0) {
tracker_db_interface_execute_query (iface, NULL,
@@ -500,7 +500,7 @@ tracker_data_update_delete_metadata (TrackerService *service,
}
void
-tracker_data_update_set_content (TrackerService *service,
+tracker_data_update_set_content (TrackerClass *service,
guint32 service_id,
const gchar *text)
{
@@ -510,7 +510,7 @@ tracker_data_update_set_content (TrackerService *service,
id_str = tracker_guint32_to_string (service_id);
field = tracker_ontology_get_field_by_name ("File:Contents");
- iface = tracker_db_manager_get_db_interface_by_type (tracker_service_get_name (service),
+ iface = tracker_db_manager_get_db_interface_by_type (tracker_class_get_name (service),
TRACKER_DB_CONTENT_TYPE_CONTENTS);
tracker_db_interface_execute_procedure (iface, NULL,
@@ -523,7 +523,7 @@ tracker_data_update_set_content (TrackerService *service,
}
void
-tracker_data_update_delete_content (TrackerService *service,
+tracker_data_update_delete_content (TrackerClass *service,
guint32 service_id)
{
TrackerDBInterface *iface;
@@ -532,7 +532,7 @@ tracker_data_update_delete_content (TrackerService *service,
service_id_str = tracker_guint32_to_string (service_id);
field = tracker_ontology_get_field_by_name ("File:Contents");
- iface = tracker_db_manager_get_db_interface_by_type (tracker_service_get_name (service),
+ iface = tracker_db_manager_get_db_interface_by_type (tracker_class_get_name (service),
TRACKER_DB_CONTENT_TYPE_CONTENTS);
/* Delete contents if it has! */
@@ -549,7 +549,7 @@ void
tracker_data_update_delete_service_by_path (const gchar *path,
const gchar *rdf_type)
{
- TrackerService *service;
+ TrackerClass *service;
const gchar *service_type;
guint32 service_id;
@@ -564,7 +564,7 @@ tracker_data_update_delete_service_by_path (const gchar *path,
return;
}
- service_type = tracker_service_get_name (service);
+ service_type = tracker_class_get_name (service);
service_id = tracker_data_query_file_id (service_type, path);
/* When merging from the decomposed branch to trunk then this function
@@ -583,7 +583,7 @@ tracker_data_update_delete_service_by_path (const gchar *path,
void
tracker_data_update_delete_service_all (const gchar *rdf_type)
{
- TrackerService *service;
+ TrackerClass *service;
gchar *service_type_id;
TrackerDBInterface *iface;
@@ -592,11 +592,11 @@ tracker_data_update_delete_service_all (const gchar *rdf_type)
service = tracker_ontology_get_service_by_name (rdf_type);
- g_return_if_fail (TRACKER_IS_SERVICE (service));
+ g_return_if_fail (TRACKER_IS_CLASS (service));
- service_type_id = tracker_gint_to_string (tracker_service_get_id (service));
+ service_type_id = tracker_gint_to_string (tracker_class_get_id (service));
- iface = tracker_db_manager_get_db_interface_by_type (tracker_service_get_name (service),
+ iface = tracker_db_manager_get_db_interface_by_type (tracker_class_get_name (service),
TRACKER_DB_CONTENT_TYPE_METADATA);
tracker_db_interface_execute_procedure (iface,
@@ -639,14 +639,14 @@ set_metadata (TrackerField *field,
score = tracker_field_get_weight (field);
arr = g_strsplit (parsed_value, " ", -1);
- service_id = tracker_service_get_id (info->service);
+ service_id = tracker_class_get_id (info->service);
lindex = tracker_db_index_manager_get_index_by_service_id (service_id);
for (i = 0; arr[i]; i++) {
tracker_db_index_add_word (lindex,
arr[i],
info->iid_value,
- tracker_service_get_id (info->service),
+ tracker_class_get_id (info->service),
score);
}
@@ -695,7 +695,7 @@ tracker_data_update_replace_service (const gchar *path,
TrackerDBInterface *iface;
TrackerDBResultSet *result_set;
const gchar *modified;
- TrackerService *service;
+ TrackerClass *service;
gchar *escaped_path;
gchar *dirname;
gchar *basename;
@@ -723,7 +723,7 @@ tracker_data_update_replace_service (const gchar *path,
/* The current ontology doesn't allow sanity like what above would be */
service = tracker_ontology_get_service_by_name ("Files");
- iface = tracker_db_manager_get_db_interface_by_type (tracker_service_get_name (service),
+ iface = tracker_db_manager_get_db_interface_by_type (tracker_class_get_name (service),
TRACKER_DB_CONTENT_TYPE_METADATA);
modified = g_hash_table_lookup (metadata, "File:Modified");
diff --git a/src/libtracker-data/tracker-data-update.h b/src/libtracker-data/tracker-data-update.h
index 9382a66..fcfef34 100644
--- a/src/libtracker-data/tracker-data-update.h
+++ b/src/libtracker-data/tracker-data-update.h
@@ -35,18 +35,18 @@ G_BEGIN_DECLS
guint32 tracker_data_update_get_new_service_id (TrackerDBInterface *iface);
/* Services */
-gboolean tracker_data_update_create_service (TrackerService *service,
+gboolean tracker_data_update_create_service (TrackerClass *service,
guint32 service_id,
const gchar *dirname,
const gchar *basename,
GHashTable *metadata);
-void tracker_data_update_disable_service (TrackerService *service,
+void tracker_data_update_disable_service (TrackerClass *service,
guint32 service_id);
-void tracker_data_update_delete_service (TrackerService *service,
+void tracker_data_update_delete_service (TrackerClass *service,
guint32 service_id);
-void tracker_data_update_delete_service_recursively (TrackerService *service,
+void tracker_data_update_delete_service_recursively (TrackerClass *service,
const gchar *service_path);
-gboolean tracker_data_update_move_service (TrackerService *service,
+gboolean tracker_data_update_move_service (TrackerClass *service,
const gchar *from,
const gchar *to);
@@ -60,23 +60,23 @@ void tracker_data_update_delete_service_all (const gchar *rdf_type);
/* Metadata */
-void tracker_data_update_set_metadata (TrackerService *service,
+void tracker_data_update_set_metadata (TrackerClass *service,
guint32 service_id,
TrackerField *field,
const gchar *value,
const gchar *parsed_value);
-void tracker_data_update_delete_all_metadata (TrackerService *service,
+void tracker_data_update_delete_all_metadata (TrackerClass *service,
guint32 service_id);
-void tracker_data_update_delete_metadata (TrackerService *service,
+void tracker_data_update_delete_metadata (TrackerClass *service,
guint32 service_id,
TrackerField *field,
const gchar *value);
/* Contents */
-void tracker_data_update_set_content (TrackerService *service,
+void tracker_data_update_set_content (TrackerClass *service,
guint32 service_id,
const gchar *text);
-void tracker_data_update_delete_content (TrackerService *service,
+void tracker_data_update_delete_content (TrackerClass *service,
guint32 service_id);
diff --git a/src/libtracker-db/tracker-db-manager.c b/src/libtracker-db/tracker-db-manager.c
index d597fc5..af3091e 100644
--- a/src/libtracker-db/tracker-db-manager.c
+++ b/src/libtracker-db/tracker-db-manager.c
@@ -371,7 +371,7 @@ static void
load_service_file (TrackerDBInterface *iface,
const gchar *filename)
{
- TrackerService *service;
+ TrackerClass *service;
GKeyFile *key_file = NULL;
GError *error = NULL;
gchar *service_file, *str_id;
@@ -407,7 +407,7 @@ load_service_file (TrackerDBInterface *iface,
NULL);
id = tracker_db_interface_sqlite_get_last_insert_id (TRACKER_DB_INTERFACE_SQLITE (iface));
} else {
- id = tracker_service_get_id (service);
+ id = tracker_class_get_id (service);
}
str_id = tracker_guint_to_string (id);
@@ -772,17 +772,17 @@ db_row_to_field_def (TrackerDBResultSet *result_set)
return field_def;
}
-static TrackerService *
+static TrackerClass *
db_row_to_service (TrackerDBResultSet *result_set)
{
- TrackerService *service;
+ TrackerClass *service;
GSList *new_list = NULL;
gint id, i;
gchar *name, *parent, *content_metadata, *property_prefix = NULL;
gboolean enabled, embedded, has_metadata, has_fulltext;
gboolean has_thumbs, show_service_files, show_service_directories;
- service = tracker_service_new ();
+ service = tracker_class_new ();
tracker_db_result_set_get (result_set,
0, &id,
@@ -799,19 +799,19 @@ db_row_to_service (TrackerDBResultSet *result_set)
12, &show_service_directories,
-1);
- tracker_service_set_id (service, id);
- tracker_service_set_name (service, name);
- tracker_service_set_parent (service, parent);
- tracker_service_set_property_prefix (service, property_prefix);
- tracker_service_set_enabled (service, enabled);
- tracker_service_set_embedded (service, embedded);
- tracker_service_set_has_metadata (service, has_metadata);
- tracker_service_set_has_full_text (service, has_fulltext);
- tracker_service_set_has_thumbs (service, has_thumbs);
- tracker_service_set_content_metadata (service, content_metadata);
+ tracker_class_set_id (service, id);
+ tracker_class_set_name (service, name);
+ tracker_class_set_parent (service, parent);
+ tracker_class_set_property_prefix (service, property_prefix);
+ tracker_class_set_enabled (service, enabled);
+ tracker_class_set_embedded (service, embedded);
+ tracker_class_set_has_metadata (service, has_metadata);
+ tracker_class_set_has_full_text (service, has_fulltext);
+ tracker_class_set_has_thumbs (service, has_thumbs);
+ tracker_class_set_content_metadata (service, content_metadata);
- tracker_service_set_show_service_files (service, show_service_files);
- tracker_service_set_show_service_directories (service, show_service_directories);
+ tracker_class_set_show_service_files (service, show_service_files);
+ tracker_class_set_show_service_directories (service, show_service_directories);
for (i = 13; i < 24; i++) {
gchar *metadata;
@@ -842,7 +842,7 @@ db_row_to_service (TrackerDBResultSet *result_set)
new_list = g_slist_reverse (new_list);
- tracker_service_set_key_metadata (service, new_list);
+ tracker_class_set_key_metadata (service, new_list);
g_slist_foreach (new_list, (GFunc) g_free, NULL);
g_slist_free (new_list);
@@ -1439,7 +1439,7 @@ db_get_static_data (TrackerDBInterface *iface)
gboolean valid = TRUE;
while (valid) {
- TrackerService *service;
+ TrackerClass *service;
GSList *mimes, *mime_prefixes;
const gchar *name;
gint id;
@@ -1450,8 +1450,8 @@ db_get_static_data (TrackerDBInterface *iface)
continue;
}
- id = tracker_service_get_id (service);
- name = tracker_service_get_name (service);
+ id = tracker_class_get_id (service);
+ name = tracker_class_get_name (service);
mimes = db_get_mimes_for_service_id (iface, id);
mime_prefixes = db_get_mime_prefixes_for_service_id (iface, id);
diff --git a/src/libtracker/tracker.c b/src/libtracker/tracker.c
index db1e3e3..2bee793 100644
--- a/src/libtracker/tracker.c
+++ b/src/libtracker/tracker.c
@@ -26,7 +26,7 @@
#include "tracker-daemon-glue.h"
#include "tracker-search-glue.h"
-#define TRACKER_SERVICE "org.freedesktop.Tracker"
+#define TRACKER_CLASS "org.freedesktop.Tracker"
#define TRACKER_OBJECT "/org/freedesktop/Tracker"
#define TRACKER_INTERFACE "org.freedesktop.Tracker"
#define TRACKER_INTERFACE_SEARCH "org.freedesktop.Tracker.Search"
@@ -70,7 +70,7 @@ typedef struct {
} VoidCallBackStruct;
-const char *tracker_service_types[] = {
+const char *tracker_class_types[] = {
"Files",
"Folders",
"Documents",
@@ -116,12 +116,12 @@ const char *metadata_types[] = {
ServiceType
-tracker_service_name_to_type (const char *service)
+tracker_class_name_to_type (const char *service)
{
const char **st;
int i = 0;
- for (st=tracker_service_types; *st; st++) {
+ for (st=tracker_class_types; *st; st++) {
if (g_ascii_strcasecmp (service, *st) == 0) {
return i;
@@ -137,7 +137,7 @@ tracker_service_name_to_type (const char *service)
char *
tracker_type_to_service_name (ServiceType s)
{
- return g_strdup (tracker_service_types[s]);
+ return g_strdup (tracker_class_types[s]);
}
@@ -265,7 +265,7 @@ tracker_connect (gboolean enable_warnings)
}
proxy = dbus_g_proxy_new_for_name (connection,
- TRACKER_SERVICE,
+ TRACKER_CLASS,
TRACKER_OBJECT,
TRACKER_INTERFACE);
@@ -281,7 +281,7 @@ tracker_connect (gboolean enable_warnings)
client->proxy = proxy;
proxy = dbus_g_proxy_new_for_name (connection,
- TRACKER_SERVICE,
+ TRACKER_CLASS,
TRACKER_OBJECT "/Search",
TRACKER_INTERFACE_SEARCH);
@@ -381,7 +381,7 @@ char *
tracker_search_get_snippet (TrackerClient *client, ServiceType service, const char *uri, const char *search_text, GError **error)
{
char *result;
- const char *service_str = tracker_service_types[service];
+ const char *service_str = tracker_class_types[service];
if (!org_freedesktop_Tracker_Search_get_snippet (client->proxy_search, service_str, uri, search_text, &result, &*error)) {
return NULL;
@@ -509,7 +509,7 @@ tracker_search_get_snippet_async (TrackerClient *client, ServiceType service, co
callback_struct->callback = callback;
callback_struct->data = user_data;
- service_str = tracker_service_types[service];
+ service_str = tracker_class_types[service];
client->last_pending_call = org_freedesktop_Tracker_Search_get_snippet_async (client->proxy_search, service_str, uri, search_text, tracker_string_reply, callback_struct);
diff --git a/src/libtracker/tracker.h b/src/libtracker/tracker.h
index cc9a4a5..2ed71cd 100644
--- a/src/libtracker/tracker.h
+++ b/src/libtracker/tracker.h
@@ -98,7 +98,7 @@ TrackerClient * tracker_connect (gboolean enable_warnings);
void tracker_disconnect (TrackerClient *client);
-ServiceType tracker_service_name_to_type (const char *service);
+ServiceType tracker_class_name_to_type (const char *service);
char * tracker_type_to_service_name (ServiceType s);
diff --git a/src/tracker-indexer/tracker-indexer.c b/src/tracker-indexer/tracker-indexer.c
index deaa8a7..5c51368 100644
--- a/src/tracker-indexer/tracker-indexer.c
+++ b/src/tracker-indexer/tracker-indexer.c
@@ -167,7 +167,7 @@ struct PathInfo {
struct MetadataForeachData {
TrackerLanguage *language;
TrackerConfig *config;
- TrackerService *service;
+ TrackerClass *service;
gboolean add;
guint32 id;
};
@@ -1145,14 +1145,14 @@ index_metadata_item (TrackerField *field,
}
arr = g_strsplit (parsed_value, " ", -1);
- service_id = tracker_service_get_id (data->service);
+ service_id = tracker_class_get_id (data->service);
lindex = tracker_db_index_manager_get_index_by_service_id (service_id);
for (i = 0; arr[i]; i++) {
tracker_db_index_add_word (lindex,
arr[i],
data->id,
- tracker_service_get_id (data->service),
+ tracker_class_get_id (data->service),
score);
}
@@ -1203,7 +1203,7 @@ index_metadata_foreach (TrackerField *field,
static void
index_metadata (TrackerIndexer *indexer,
guint32 id,
- TrackerService *service,
+ TrackerClass *service,
TrackerModuleMetadata *metadata)
{
MetadataForeachData data;
@@ -1222,7 +1222,7 @@ index_metadata (TrackerIndexer *indexer,
static void
unindex_metadata (TrackerIndexer *indexer,
guint32 id,
- TrackerService *service,
+ TrackerClass *service,
TrackerDataMetadata *metadata)
{
MetadataForeachData data;
@@ -1427,7 +1427,7 @@ merge_word_table (gpointer key,
static void
item_update_content (TrackerIndexer *indexer,
- TrackerService *service,
+ TrackerClass *service,
guint32 id,
const gchar *old_text,
const gchar *new_text)
@@ -1468,7 +1468,7 @@ item_update_content (TrackerIndexer *indexer,
update_words_no_parsing (indexer,
id,
- tracker_service_get_id (service),
+ tracker_class_get_id (service),
new_words);
/* Remove old text and set new one in the db */
@@ -1484,7 +1484,7 @@ item_update_content (TrackerIndexer *indexer,
g_hash_table_unref (new_words);
}
-static TrackerService *
+static TrackerClass *
get_service_for_file (TrackerModuleFile *file,
TrackerIndexerModule *module)
{
@@ -1526,7 +1526,7 @@ remove_existing_non_emb_metadata (TrackerField *field,
static void
remove_stale_children (TrackerIndexer *indexer,
- TrackerService *service,
+ TrackerClass *service,
PathInfo *parent_info,
const gchar *path)
{
@@ -1535,7 +1535,7 @@ remove_stale_children (TrackerIndexer *indexer,
PathInfo *info;
gint i;
- iface = tracker_db_manager_get_db_interface_by_type (tracker_service_get_name (service),
+ iface = tracker_db_manager_get_db_interface_by_type (tracker_class_get_name (service),
TRACKER_DB_CONTENT_TYPE_METADATA);
children = tracker_data_search_files_get (iface, path);
@@ -1591,7 +1591,7 @@ item_add_or_update (TrackerIndexer *indexer,
TrackerModuleMetadata *metadata,
const gchar *text)
{
- TrackerService *service;
+ TrackerClass *service;
guint32 id;
gchar *mount_point = NULL;
gchar *service_path;
@@ -1646,7 +1646,7 @@ item_add_or_update (TrackerIndexer *indexer,
item_update_content (indexer, service, id, old_text, text);
- if (strcmp (tracker_service_get_name (service), "Folders") == 0) {
+ if (strcmp (tracker_class_get_name (service), "Folders") == 0) {
gchar *path;
/* Remove no longer existing children, this is necessary in case
@@ -1685,7 +1685,7 @@ item_add_or_update (TrackerIndexer *indexer,
/* Save in the index */
index_text_with_parsing (indexer,
id,
- tracker_service_get_id (service),
+ tracker_class_get_id (service),
text,
1);
@@ -1714,7 +1714,7 @@ item_add_or_update (TrackerIndexer *indexer,
tracker_removable_device_add_metadata (indexer,
mount_point,
service_path,
- tracker_service_get_name (service),
+ tracker_class_get_name (service),
metadata);
}
#endif
@@ -1774,7 +1774,7 @@ update_moved_item_thumbnail (TrackerIndexer *indexer,
static void
update_moved_item_removable_device (TrackerIndexer *indexer,
- TrackerService *service,
+ TrackerClass *service,
GFile *file,
GFile *source_file)
{
@@ -1782,7 +1782,7 @@ update_moved_item_removable_device (TrackerIndexer *indexer,
gchar *path, *source_path;
gchar *mount_point = NULL;
- service_name = tracker_service_get_name (service);
+ service_name = tracker_class_get_name (service);
path = g_file_get_path (file);
source_path = g_file_get_path (source_file);
@@ -1818,7 +1818,7 @@ update_moved_item_removable_device (TrackerIndexer *indexer,
static void
update_moved_item_index (TrackerIndexer *indexer,
- TrackerService *service,
+ TrackerClass *service,
TrackerDataMetadata *old_metadata,
guint32 service_id,
GFile *file,
@@ -1863,14 +1863,14 @@ update_moved_item_index (TrackerIndexer *indexer,
static void
item_erase (TrackerIndexer *indexer,
- TrackerService *service,
+ TrackerClass *service,
guint32 service_id)
{
gchar *content, *metadata;
guint32 service_type_id;
TrackerDataMetadata *data_metadata;
- service_type_id = tracker_service_get_id (service);
+ service_type_id = tracker_class_get_id (service);
/* Get mime type and remove thumbnail from thumbnailerd */
data_metadata = tracker_data_query_metadata (service, service_id, TRUE);
@@ -1939,7 +1939,7 @@ item_move (TrackerIndexer *indexer,
const gchar *dirname,
const gchar *basename)
{
- TrackerService *service;
+ TrackerClass *service;
TrackerDataMetadata *old_metadata;
gchar *path, *source_path;
gchar *dest_dirname, *dest_basename;
@@ -1996,7 +1996,7 @@ item_move (TrackerIndexer *indexer,
g_free (dest_dirname);
g_free (dest_basename);
- if (info->recurse && strcmp (tracker_service_get_name (service), "Folders") == 0) {
+ if (info->recurse && strcmp (tracker_class_get_name (service), "Folders") == 0) {
children = tracker_data_query_service_children (service, source_path);
}
@@ -2065,7 +2065,7 @@ item_mark_for_removal (TrackerIndexer *indexer,
const gchar *dirname,
const gchar *basename)
{
- TrackerService *service;
+ TrackerClass *service;
gchar *path;
gchar *mount_point = NULL;
const gchar *service_type;
@@ -2101,7 +2101,7 @@ item_mark_for_removal (TrackerIndexer *indexer,
/* This is needed in a few places. */
path = g_build_path (G_DIR_SEPARATOR_S, dirname, basename, NULL);
- if (info->recurse && strcmp (tracker_service_get_name (service), "Folders") == 0) {
+ if (info->recurse && strcmp (tracker_class_get_name (service), "Folders") == 0) {
children = tracker_data_query_service_children (service, path);
}
@@ -2138,7 +2138,7 @@ item_mark_for_removal (TrackerIndexer *indexer,
tracker_removable_device_add_removal (indexer, mount_point,
path,
- tracker_service_get_name (service));
+ tracker_class_get_name (service));
}
#endif
g_free (mount_point);
@@ -2197,7 +2197,7 @@ handle_metadata_add (TrackerIndexer *indexer,
GStrv values,
GError **error)
{
- TrackerService *service;
+ TrackerClass *service;
TrackerField *field;
guint service_id, i, j;
gchar **set_values;
@@ -2273,13 +2273,13 @@ handle_metadata_add (TrackerIndexer *indexer,
if (tracker_field_get_filtered (field)) {
unindex_text_with_parsing (indexer,
service_id,
- tracker_service_get_id (service),
+ tracker_class_get_id (service),
old_contents[0],
tracker_field_get_weight (field));
} else {
unindex_text_no_parsing (indexer,
service_id,
- tracker_service_get_id (service),
+ tracker_class_get_id (service),
old_contents[0],
tracker_field_get_weight (field));
}
@@ -2291,7 +2291,7 @@ handle_metadata_add (TrackerIndexer *indexer,
for (i = 0, j = 0; values[i] != NULL; i++) {
g_debug ("Setting metadata: service_type '%s' id '%d' field '%s' value '%s'",
- tracker_service_get_name (service),
+ tracker_class_get_name (service),
service_id,
tracker_field_get_name (field),
values[i]);
@@ -2309,13 +2309,13 @@ handle_metadata_add (TrackerIndexer *indexer,
if (tracker_field_get_filtered (field)) {
index_text_no_parsing (indexer,
service_id,
- tracker_service_get_id (service),
+ tracker_class_get_id (service),
joined,
tracker_field_get_weight (field));
} else {
index_text_with_parsing (indexer,
service_id,
- tracker_service_get_id (service),
+ tracker_class_get_id (service),
joined,
tracker_field_get_weight (field));
}
@@ -2337,7 +2337,7 @@ should_change_index_for_file (TrackerIndexer *indexer,
const gchar *dirname,
const gchar *basename)
{
- TrackerService *service;
+ TrackerClass *service;
gchar *path;
guint64 current_mtime;
time_t db_mtime;
@@ -2604,7 +2604,7 @@ cleanup_task_func (gpointer user_data)
{
TrackerIndexer *indexer;
TrackerIndexerPrivate *priv;
- TrackerService *service;
+ TrackerClass *service;
guint32 id;
indexer = (TrackerIndexer *) user_data;
diff --git a/src/tracker-search-tool/tracker-search-tool.c b/src/tracker-search-tool/tracker-search-tool.c
index 6bd9b62..d6c2bfd 100644
--- a/src/tracker-search-tool/tracker-search-tool.c
+++ b/src/tracker-search-tool/tracker-search-tool.c
@@ -1496,7 +1496,7 @@ get_meta_table_data (gpointer value,
gsearch->search_results_list_store, &gsearch->search_results_iter, gsearch);
} else {
- add_file_to_search_results (meta[0], tracker_service_name_to_type (meta[1]), meta[2],
+ add_file_to_search_results (meta[0], tracker_class_name_to_type (meta[1]), meta[2],
gsearch->search_results_list_store, &gsearch->search_results_iter, gsearch);
}
}
diff --git a/src/tracker-utils/tracker-info.c b/src/tracker-utils/tracker-info.c
index 89ec5f2..ff54fe6 100644
--- a/src/tracker-utils/tracker-info.c
+++ b/src/tracker-utils/tracker-info.c
@@ -165,7 +165,7 @@ main (int argc, char **argv)
type = SERVICE_FILES;
} else {
- type = tracker_service_name_to_type (service);
+ type = tracker_class_name_to_type (service);
if (type == SERVICE_OTHER_FILES && g_ascii_strcasecmp (service, "Other")) {
g_printerr (_("Service type not recognized, using 'Other' ..."));
diff --git a/src/tracker-utils/tracker-search.c b/src/tracker-utils/tracker-search.c
index 324c598..b2943ed 100644
--- a/src/tracker-utils/tracker-search.c
+++ b/src/tracker-utils/tracker-search.c
@@ -182,7 +182,7 @@ main (int argc, char **argv)
type = SERVICE_FILES;
} else {
- type = tracker_service_name_to_type (service);
+ type = tracker_class_name_to_type (service);
if (type == SERVICE_OTHER_FILES && g_ascii_strcasecmp (service, "Other")) {
g_printerr ("%s\n",
diff --git a/tests/libtracker-common/tracker-ontology-test.c b/tests/libtracker-common/tracker-ontology-test.c
index 1974baa..92006d5 100644
--- a/tests/libtracker-common/tracker-ontology-test.c
+++ b/tests/libtracker-common/tracker-ontology-test.c
@@ -24,22 +24,22 @@
#include <glib.h>
-#include <libtracker-common/tracker-service.h>
+#include <libtracker-common/tracker-class.h>
#include <libtracker-common/tracker-field.h>
#include <libtracker-common/tracker-ontology.h>
#include <tracker-test-helpers.h>
typedef struct {
- TrackerService *service;
- TrackerService *parent_service;
+ TrackerClass *service;
+ TrackerClass *parent_service;
} ExpectedResults;
static ExpectedResults *expected_results = NULL;
static gboolean
-test_cmp_service_equals (TrackerService *one,
- TrackerService *two)
+test_cmp_service_equals (TrackerClass *one,
+ TrackerClass *two)
{
if (one && !two) {
return FALSE;
@@ -54,13 +54,13 @@ test_cmp_service_equals (TrackerService *one,
}
return
- tracker_service_get_id (one) == tracker_service_get_id (two) &&
- tracker_test_helpers_cmpstr_equal (tracker_service_get_name (one),
- tracker_service_get_name (two)) &&
- tracker_test_helpers_cmpstr_equal (tracker_service_get_parent (one),
- tracker_service_get_parent (two)) &&
- tracker_service_get_db_type (one) == tracker_service_get_db_type (two) &&
- tracker_service_get_embedded (one) == tracker_service_get_embedded (two);
+ tracker_class_get_id (one) == tracker_class_get_id (two) &&
+ tracker_test_helpers_cmpstr_equal (tracker_class_get_name (one),
+ tracker_class_get_name (two)) &&
+ tracker_test_helpers_cmpstr_equal (tracker_class_get_parent (one),
+ tracker_class_get_parent (two)) &&
+ tracker_class_get_db_type (one) == tracker_class_get_db_type (two) &&
+ tracker_class_get_embedded (one) == tracker_class_get_embedded (two);
}
static gboolean
@@ -104,14 +104,14 @@ create_field_definition (const gchar *id,
return field;
}
-static TrackerService *
+static TrackerClass *
create_service_definition (gint id,
const gchar *name,
const gchar *parent,
const gchar *prefix,
gboolean embedded)
{
- TrackerService *service;
+ TrackerClass *service;
/* array_to_list use prepend, so use reverse order here */
gchar *key_metadata [] = {
@@ -120,18 +120,18 @@ create_service_definition (gint id,
NULL
};
- service = tracker_service_new ();
- tracker_service_set_id (service, id);
- tracker_service_set_name (service, name);
- tracker_service_set_parent (service, parent);
- tracker_service_set_property_prefix (service, prefix);
- tracker_service_set_db_type (service, TRACKER_DB_TYPE_CONTENT);
- tracker_service_set_enabled (service, FALSE);
- tracker_service_set_embedded (service, embedded);
- tracker_service_set_has_thumbs (service, TRUE);
- tracker_service_set_has_full_text (service, TRUE);
- tracker_service_set_has_metadata (service, FALSE);
- tracker_service_set_key_metadata (service, array_to_list (key_metadata));
+ service = tracker_class_new ();
+ tracker_class_set_id (service, id);
+ tracker_class_set_name (service, name);
+ tracker_class_set_parent (service, parent);
+ tracker_class_set_property_prefix (service, prefix);
+ tracker_class_set_db_type (service, TRACKER_DB_TYPE_CONTENT);
+ tracker_class_set_enabled (service, FALSE);
+ tracker_class_set_embedded (service, embedded);
+ tracker_class_set_has_thumbs (service, TRUE);
+ tracker_class_set_has_full_text (service, TRUE);
+ tracker_class_set_has_metadata (service, FALSE);
+ tracker_class_set_key_metadata (service, array_to_list (key_metadata));
return service;
}
@@ -139,8 +139,8 @@ create_service_definition (gint id,
static void
tracker_services_general_setup (void)
{
- TrackerService *service, *parent_service, *other_service;
- TrackerService *conv_service, *gaim_service, *gossip_service, *new_gaim_service;
+ TrackerClass *service, *parent_service, *other_service;
+ TrackerClass *conv_service, *gaim_service, *gossip_service, *new_gaim_service;
TrackerField *field_title;
GSList *mimes, *mime_prefixes;
gchar *m[] = {"application/rtf", "text/joke", "test/1", NULL};
@@ -266,7 +266,7 @@ test_get_service_type_for_mime (void)
static void
test_get_service (void)
{
- TrackerService *service;
+ TrackerClass *service;
service = tracker_ontology_get_service_by_name ("Test service");
g_assert (test_cmp_service_equals (service, expected_results->service));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]