[tracker/wip/carlosg/compiler-warnings: 3/10] libtracker-data: Port to G_ADD_PRIVATE



commit 2d91bc01772874d0c46e6b0e35210a5aea4e6671
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Oct 1 01:08:34 2018 +0200

    libtracker-data: Port to G_ADD_PRIVATE

 src/libtracker-data/tracker-class.c     |  64 ++++++++--------
 src/libtracker-data/tracker-class.h     |   2 -
 src/libtracker-data/tracker-namespace.c |  28 +++----
 src/libtracker-data/tracker-namespace.h |   3 -
 src/libtracker-data/tracker-ontology.c  |  24 +++---
 src/libtracker-data/tracker-property.c  | 128 +++++++++++++++-----------------
 src/libtracker-data/tracker-property.h  |   1 -
 7 files changed, 112 insertions(+), 138 deletions(-)
---
diff --git a/src/libtracker-data/tracker-class.c b/src/libtracker-data/tracker-class.c
index f216c8e94..76d5416c9 100644
--- a/src/libtracker-data/tracker-class.c
+++ b/src/libtracker-data/tracker-class.c
@@ -29,8 +29,7 @@
 #include "tracker-namespace.h"
 #include "tracker-ontologies.h"
 
-#define GET_PRIV(obj) (((TrackerClass*) obj)->priv)
-#define TRACKER_CLASS_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TRACKER_TYPE_CLASS, 
TrackerClassPrivate))
+typedef struct _TrackerClassPrivate TrackerClassPrivate;
 
 struct _TrackerClassPrivate {
        gchar *uri;
@@ -53,16 +52,14 @@ struct _TrackerClassPrivate {
 
 static void class_finalize     (GObject      *object);
 
-G_DEFINE_TYPE (TrackerClass, tracker_class, G_TYPE_OBJECT);
+G_DEFINE_TYPE_WITH_PRIVATE (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;
-
-       g_type_class_add_private (object_class, sizeof (TrackerClassPrivate));
+       object_class->finalize = class_finalize;
 }
 
 static void
@@ -70,16 +67,13 @@ tracker_class_init (TrackerClass *service)
 {
        TrackerClassPrivate *priv;
 
-       priv = TRACKER_CLASS_GET_PRIVATE (service);
+       priv = tracker_class_get_instance_private (service);
 
        priv->id = 0;
        priv->super_classes = g_array_new (TRUE, TRUE, sizeof (TrackerClass *));
        priv->domain_indexes = g_array_new (TRUE, TRUE, sizeof (TrackerProperty *));
        priv->last_domain_indexes = NULL;
        priv->last_super_classes = NULL;
-
-       /* Make GET_PRIV working */
-       service->priv = priv;
 }
 
 static void
@@ -87,7 +81,7 @@ class_finalize (GObject *object)
 {
        TrackerClassPrivate *priv;
 
-       priv = GET_PRIV (object);
+       priv = tracker_class_get_instance_private (TRACKER_CLASS (object));
 
        g_free (priv->uri);
        g_free (priv->name);
@@ -115,7 +109,7 @@ tracker_class_new (gboolean use_gvdb)
        service = g_object_new (TRACKER_TYPE_CLASS, NULL);
 
        if (use_gvdb) {
-               priv = GET_PRIV (service);
+               priv = tracker_class_get_instance_private (service);
                priv->use_gvdb = use_gvdb;
        }
 
@@ -129,7 +123,7 @@ tracker_class_get_uri (TrackerClass *service)
 
        g_return_val_if_fail (TRACKER_IS_CLASS (service), NULL);
 
-       priv = GET_PRIV (service);
+       priv = tracker_class_get_instance_private (service);
 
        return priv->uri;
 }
@@ -141,7 +135,7 @@ tracker_class_get_name (TrackerClass *service)
 
        g_return_val_if_fail (TRACKER_IS_CLASS (service), NULL);
 
-       priv = GET_PRIV (service);
+       priv = tracker_class_get_instance_private (service);
 
        return priv->name;
 }
@@ -153,7 +147,7 @@ tracker_class_get_count (TrackerClass *service)
 
        g_return_val_if_fail (TRACKER_IS_CLASS (service), 0);
 
-       priv = GET_PRIV (service);
+       priv = tracker_class_get_instance_private (service);
 
        return priv->count;
 }
@@ -165,7 +159,7 @@ tracker_class_get_id (TrackerClass *service)
 
        g_return_val_if_fail (TRACKER_IS_CLASS (service), 0);
 
-       priv = GET_PRIV (service);
+       priv = tracker_class_get_instance_private (service);
 
        return priv->id;
 }
@@ -177,7 +171,7 @@ tracker_class_get_super_classes (TrackerClass *service)
 
        g_return_val_if_fail (TRACKER_IS_CLASS (service), NULL);
 
-       priv = GET_PRIV (service);
+       priv = tracker_class_get_instance_private (service);
 
        if (priv->use_gvdb) {
                TrackerClass *super_class;
@@ -211,7 +205,7 @@ tracker_class_get_domain_indexes (TrackerClass *service)
 
        g_return_val_if_fail (TRACKER_IS_CLASS (service), NULL);
 
-       priv = GET_PRIV (service);
+       priv = tracker_class_get_instance_private (service);
 
        return (TrackerProperty **) priv->domain_indexes->data;
 }
@@ -224,7 +218,7 @@ tracker_class_get_last_domain_indexes (TrackerClass *service)
 
        g_return_val_if_fail (TRACKER_IS_CLASS (service), NULL);
 
-       priv = GET_PRIV (service);
+       priv = tracker_class_get_instance_private (service);
 
        return (TrackerProperty **) (priv->last_domain_indexes ? priv->last_domain_indexes->data : NULL);
 }
@@ -236,7 +230,7 @@ tracker_class_get_last_super_classes (TrackerClass *service)
 
        g_return_val_if_fail (TRACKER_IS_CLASS (service), NULL);
 
-       priv = GET_PRIV (service);
+       priv = tracker_class_get_instance_private (service);
 
        return (TrackerClass **) (priv->last_super_classes ? priv->last_super_classes->data : NULL);
 }
@@ -248,7 +242,7 @@ tracker_class_get_is_new (TrackerClass *service)
 
        g_return_val_if_fail (TRACKER_IS_CLASS (service), FALSE);
 
-       priv = GET_PRIV (service);
+       priv = tracker_class_get_instance_private (service);
 
        return priv->is_new;
 }
@@ -260,7 +254,7 @@ tracker_class_get_notify (TrackerClass *service)
 
        g_return_val_if_fail (TRACKER_IS_CLASS (service), FALSE);
 
-       priv = GET_PRIV (service);
+       priv = tracker_class_get_instance_private (service);
 
        return priv->notify;
 }
@@ -272,7 +266,7 @@ tracker_class_get_db_schema_changed (TrackerClass *service)
 
        g_return_val_if_fail (TRACKER_IS_CLASS (service), FALSE);
 
-       priv = GET_PRIV (service);
+       priv = tracker_class_get_instance_private (service);
 
        return priv->db_schema_changed;
 }
@@ -285,7 +279,7 @@ tracker_class_set_uri (TrackerClass *service,
 
        g_return_if_fail (TRACKER_IS_CLASS (service));
 
-       priv = GET_PRIV (service);
+       priv = tracker_class_get_instance_private (service);
 
        g_free (priv->uri);
        g_free (priv->name);
@@ -326,7 +320,7 @@ tracker_class_set_count (TrackerClass *service,
 
        g_return_if_fail (TRACKER_IS_CLASS (service));
 
-       priv = GET_PRIV (service);
+       priv = tracker_class_get_instance_private (service);
 
        priv->count = value;
 }
@@ -340,7 +334,7 @@ tracker_class_set_id (TrackerClass *service,
 
        g_return_if_fail (TRACKER_IS_CLASS (service));
 
-       priv = GET_PRIV (service);
+       priv = tracker_class_get_instance_private (service);
 
        priv->id = value;
 }
@@ -354,7 +348,7 @@ tracker_class_add_super_class (TrackerClass *service,
        g_return_if_fail (TRACKER_IS_CLASS (service));
        g_return_if_fail (TRACKER_IS_CLASS (value));
 
-       priv = GET_PRIV (service);
+       priv = tracker_class_get_instance_private (service);
 
        g_array_append_val (priv->super_classes, value);
 }
@@ -366,7 +360,7 @@ tracker_class_reset_super_classes (TrackerClass *service)
 
        g_return_if_fail (TRACKER_IS_CLASS (service));
 
-       priv = GET_PRIV (service);
+       priv = tracker_class_get_instance_private (service);
 
        if (priv->last_super_classes) {
                g_array_free (priv->last_super_classes, TRUE);
@@ -385,7 +379,7 @@ tracker_class_add_domain_index (TrackerClass *service,
        g_return_if_fail (TRACKER_IS_CLASS (service));
        g_return_if_fail (TRACKER_IS_PROPERTY (value));
 
-       priv = GET_PRIV (service);
+       priv = tracker_class_get_instance_private (service);
 
        g_array_append_val (priv->domain_indexes, value);
 }
@@ -401,7 +395,7 @@ tracker_class_del_domain_index (TrackerClass    *service,
        g_return_if_fail (TRACKER_IS_CLASS (service));
        g_return_if_fail (TRACKER_IS_PROPERTY (value));
 
-       priv = GET_PRIV (service);
+       priv = tracker_class_get_instance_private (service);
 
        properties = (TrackerProperty **) priv->domain_indexes->data;
        while (*properties) {
@@ -425,7 +419,7 @@ tracker_class_reset_domain_indexes (TrackerClass *service)
 
        g_return_if_fail (TRACKER_IS_CLASS (service));
 
-       priv = GET_PRIV (service);
+       priv = tracker_class_get_instance_private (service);
        priv->last_domain_indexes = priv->domain_indexes;
        priv->domain_indexes = g_array_new (TRUE, TRUE, sizeof (TrackerProperty *));
 }
@@ -438,7 +432,7 @@ tracker_class_set_is_new (TrackerClass *service,
 
        g_return_if_fail (TRACKER_IS_CLASS (service));
 
-       priv = GET_PRIV (service);
+       priv = tracker_class_get_instance_private (service);
 
        priv->is_new = value;
 }
@@ -452,7 +446,7 @@ tracker_class_set_notify (TrackerClass *service,
 
        g_return_if_fail (TRACKER_IS_CLASS (service));
 
-       priv = GET_PRIV (service);
+       priv = tracker_class_get_instance_private (service);
 
        priv->notify = value;
 }
@@ -465,7 +459,7 @@ tracker_class_set_db_schema_changed (TrackerClass *service,
 
        g_return_if_fail (TRACKER_IS_CLASS (service));
 
-       priv = GET_PRIV (service);
+       priv = tracker_class_get_instance_private (service);
 
        priv->db_schema_changed = value;
 }
@@ -478,7 +472,7 @@ tracker_class_set_ontologies (TrackerClass      *class,
 
        g_return_if_fail (TRACKER_IS_CLASS (class));
        g_return_if_fail (ontologies != NULL);
-       priv = GET_PRIV (class);
 
+       priv = tracker_class_get_instance_private (class);
        priv->ontologies = ontologies;
 }
diff --git a/src/libtracker-data/tracker-class.h b/src/libtracker-data/tracker-class.h
index 9ac46acd8..1c01e8914 100644
--- a/src/libtracker-data/tracker-class.h
+++ b/src/libtracker-data/tracker-class.h
@@ -40,11 +40,9 @@ typedef struct _TrackerOntologies TrackerOntologies;
 typedef struct _TrackerProperty TrackerProperty;
 typedef struct _TrackerClass TrackerClass;
 typedef struct _TrackerClassClass TrackerClassClass;
-typedef struct _TrackerClassPrivate TrackerClassPrivate;
 
 struct _TrackerClass {
        GObject parent;
-       TrackerClassPrivate *priv;
 };
 
 struct _TrackerClassClass {
diff --git a/src/libtracker-data/tracker-namespace.c b/src/libtracker-data/tracker-namespace.c
index 9134a2d3e..618570062 100644
--- a/src/libtracker-data/tracker-namespace.c
+++ b/src/libtracker-data/tracker-namespace.c
@@ -27,8 +27,7 @@
 #include "tracker-namespace.h"
 #include "tracker-ontologies.h"
 
-#define GET_PRIV(obj) (((TrackerNamespace*)obj)->priv)
-#define TRACKER_NAMESPACE_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TRACKER_TYPE_NAMESPACE, 
TrackerNamespacePrivate))
+typedef struct _TrackerNamespacePrivate TrackerNamespacePrivate;
 
 struct _TrackerNamespacePrivate {
        gchar *uri;
@@ -42,22 +41,19 @@ struct _TrackerNamespacePrivate {
 
 static void namespace_finalize     (GObject      *object);
 
-G_DEFINE_TYPE (TrackerNamespace, tracker_namespace, G_TYPE_OBJECT);
+G_DEFINE_TYPE_WITH_PRIVATE (TrackerNamespace, tracker_namespace, G_TYPE_OBJECT);
 
 static void
 tracker_namespace_class_init (TrackerNamespaceClass *klass)
 {
        GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
-       object_class->finalize     = namespace_finalize;
-
-       g_type_class_add_private (object_class, sizeof (TrackerNamespacePrivate));
+       object_class->finalize = namespace_finalize;
 }
 
 static void
 tracker_namespace_init (TrackerNamespace *service)
 {
-       service->priv = TRACKER_NAMESPACE_GET_PRIVATE (service);
 }
 
 static void
@@ -65,7 +61,7 @@ namespace_finalize (GObject *object)
 {
        TrackerNamespacePrivate *priv;
 
-       priv = GET_PRIV (object);
+       priv = tracker_namespace_get_instance_private (TRACKER_NAMESPACE (object));
 
        g_free (priv->uri);
        g_free (priv->prefix);
@@ -82,7 +78,7 @@ tracker_namespace_new (gboolean use_gvdb)
        namespace = g_object_new (TRACKER_TYPE_NAMESPACE, NULL);
 
        if (use_gvdb) {
-               priv = GET_PRIV (namespace);
+               priv = tracker_namespace_get_instance_private (namespace);
                priv->use_gvdb = use_gvdb;
        }
 
@@ -96,7 +92,7 @@ tracker_namespace_get_uri (TrackerNamespace *namespace)
 
        g_return_val_if_fail (TRACKER_IS_NAMESPACE (namespace), NULL);
 
-       priv = GET_PRIV (namespace);
+       priv = tracker_namespace_get_instance_private (namespace);
 
        return priv->uri;
 }
@@ -108,7 +104,7 @@ tracker_namespace_get_prefix (TrackerNamespace *namespace)
 
        g_return_val_if_fail (TRACKER_IS_NAMESPACE (namespace), NULL);
 
-       priv = GET_PRIV (namespace);
+       priv = tracker_namespace_get_instance_private (namespace);
 
        if (!priv->prefix && priv->use_gvdb) {
                priv->prefix = g_strdup (tracker_ontologies_get_namespace_string_gvdb (priv->ontologies, 
priv->uri, "prefix"));
@@ -124,7 +120,7 @@ tracker_namespace_get_is_new (TrackerNamespace *namespace)
 
        g_return_val_if_fail (TRACKER_IS_NAMESPACE (namespace), FALSE);
 
-       priv = GET_PRIV (namespace);
+       priv = tracker_namespace_get_instance_private (namespace);
 
        return priv->is_new;
 }
@@ -137,7 +133,7 @@ tracker_namespace_set_uri (TrackerNamespace *namespace,
 
        g_return_if_fail (TRACKER_IS_NAMESPACE (namespace));
 
-       priv = GET_PRIV (namespace);
+       priv = tracker_namespace_get_instance_private (namespace);
 
        g_free (priv->uri);
 
@@ -156,7 +152,7 @@ tracker_namespace_set_prefix (TrackerNamespace *namespace,
 
        g_return_if_fail (TRACKER_IS_NAMESPACE (namespace));
 
-       priv = GET_PRIV (namespace);
+       priv = tracker_namespace_get_instance_private (namespace);
 
        g_free (priv->prefix);
 
@@ -175,7 +171,7 @@ tracker_namespace_set_is_new (TrackerNamespace *namespace,
 
        g_return_if_fail (TRACKER_IS_NAMESPACE (namespace));
 
-       priv = GET_PRIV (namespace);
+       priv = tracker_namespace_get_instance_private (namespace);
 
        priv->is_new = value;
 }
@@ -188,7 +184,7 @@ tracker_namespace_set_ontologies (TrackerNamespace  *namespace,
 
        g_return_if_fail (TRACKER_IS_NAMESPACE (namespace));
        g_return_if_fail (ontologies != NULL);
-       priv = GET_PRIV (namespace);
 
+       priv = tracker_namespace_get_instance_private (namespace);
        priv->ontologies = ontologies;
 }
diff --git a/src/libtracker-data/tracker-namespace.h b/src/libtracker-data/tracker-namespace.h
index dccc24be4..4ae2154a3 100644
--- a/src/libtracker-data/tracker-namespace.h
+++ b/src/libtracker-data/tracker-namespace.h
@@ -38,12 +38,9 @@ G_BEGIN_DECLS
 
 typedef struct _TrackerNamespace TrackerNamespace;
 typedef struct _TrackerNamespaceClass TrackerNamespaceClass;
-typedef struct _TrackerNamespacePrivate TrackerNamespacePrivate;
-
 
 struct _TrackerNamespace {
        GObject parent;
-       TrackerNamespacePrivate *priv;
 };
 
 struct _TrackerNamespaceClass {
diff --git a/src/libtracker-data/tracker-ontology.c b/src/libtracker-data/tracker-ontology.c
index ed2ef2d80..edfc14394 100644
--- a/src/libtracker-data/tracker-ontology.c
+++ b/src/libtracker-data/tracker-ontology.c
@@ -28,8 +28,6 @@
 
 #include "tracker-ontology.h"
 
-#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TRACKER_TYPE_ONTOLOGY, TrackerOntologyPrivate))
-
 typedef struct _TrackerOntologyPrivate TrackerOntologyPrivate;
 
 struct _TrackerOntologyPrivate {
@@ -41,16 +39,14 @@ struct _TrackerOntologyPrivate {
 
 static void ontology_finalize     (GObject      *object);
 
-G_DEFINE_TYPE (TrackerOntology, tracker_ontology, G_TYPE_OBJECT);
+G_DEFINE_TYPE_WITH_PRIVATE (TrackerOntology, tracker_ontology, G_TYPE_OBJECT);
 
 static void
 tracker_ontology_class_init (TrackerOntologyClass *klass)
 {
        GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
-       object_class->finalize     = ontology_finalize;
-
-       g_type_class_add_private (object_class, sizeof (TrackerOntologyPrivate));
+       object_class->finalize = ontology_finalize;
 }
 
 static void
@@ -63,7 +59,7 @@ ontology_finalize (GObject *object)
 {
        TrackerOntologyPrivate *priv;
 
-       priv = GET_PRIV (object);
+       priv = tracker_ontology_get_instance_private (TRACKER_ONTOLOGY (object));
 
        g_free (priv->uri);
 
@@ -87,7 +83,7 @@ tracker_ontology_get_last_modified (TrackerOntology *ontology)
 
        g_return_val_if_fail (TRACKER_IS_ONTOLOGY (ontology), 0);
 
-       priv = GET_PRIV (ontology);
+       priv = tracker_ontology_get_instance_private (ontology);
 
        return priv->last_modified;
 }
@@ -99,7 +95,7 @@ tracker_ontology_get_is_new (TrackerOntology *ontology)
 
        g_return_val_if_fail (TRACKER_IS_ONTOLOGY (ontology), FALSE);
 
-       priv = GET_PRIV (ontology);
+       priv = tracker_ontology_get_instance_private (ontology);
 
        return priv->is_new;
 }
@@ -113,7 +109,7 @@ tracker_ontology_set_last_modified (TrackerOntology *ontology,
 
        g_return_if_fail (TRACKER_IS_ONTOLOGY (ontology));
 
-       priv = GET_PRIV (ontology);
+       priv = tracker_ontology_get_instance_private (ontology);
 
        priv->last_modified = value;
 }
@@ -126,7 +122,7 @@ tracker_ontology_get_uri (TrackerOntology *ontology)
 
        g_return_val_if_fail (TRACKER_IS_ONTOLOGY (ontology), NULL);
 
-       priv = GET_PRIV (ontology);
+       priv = tracker_ontology_get_instance_private (ontology);
 
        return priv->uri;
 }
@@ -140,7 +136,7 @@ tracker_ontology_set_uri (TrackerOntology *ontology,
 
        g_return_if_fail (TRACKER_IS_ONTOLOGY (ontology));
 
-       priv = GET_PRIV (ontology);
+       priv = tracker_ontology_get_instance_private (ontology);
 
        g_free (priv->uri);
 
@@ -159,7 +155,7 @@ tracker_ontology_set_is_new (TrackerOntology *ontology,
 
        g_return_if_fail (TRACKER_IS_ONTOLOGY (ontology));
 
-       priv = GET_PRIV (ontology);
+       priv = tracker_ontology_get_instance_private (ontology);
 
        priv->is_new = value;
 }
@@ -172,7 +168,7 @@ tracker_ontology_set_ontologies (TrackerOntology   *ontology,
 
        g_return_if_fail (TRACKER_IS_ONTOLOGY (ontology));
        g_return_if_fail (ontologies != NULL);
-       priv = GET_PRIV (ontology);
+       priv = tracker_ontology_get_instance_private (ontology);
 
        priv->ontologies = ontologies;
 }
diff --git a/src/libtracker-data/tracker-property.c b/src/libtracker-data/tracker-property.c
index bd6c3ddaf..8b94a8c89 100644
--- a/src/libtracker-data/tracker-property.c
+++ b/src/libtracker-data/tracker-property.c
@@ -37,8 +37,7 @@
 #define XSD_INTEGER  TRACKER_PREFIX_XSD "integer"
 #define XSD_STRING   TRACKER_PREFIX_XSD "string"
 
-#define GET_PRIV(obj) (((TrackerProperty*) obj)->priv)
-#define TRACKER_PROPERTY_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TRACKER_TYPE_PROPERTY, 
TrackerPropertyPrivate))
+typedef struct _TrackerPropertyPrivate TrackerPropertyPrivate;
 
 struct _TrackerPropertyPrivate {
        gchar         *uri;
@@ -119,16 +118,14 @@ tracker_property_type_get_type (void)
        return etype;
 }
 
-G_DEFINE_TYPE (TrackerProperty, tracker_property, G_TYPE_OBJECT);
+G_DEFINE_TYPE_WITH_PRIVATE (TrackerProperty, tracker_property, G_TYPE_OBJECT);
 
 static void
 tracker_property_class_init (TrackerPropertyClass *klass)
 {
        GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
-       object_class->finalize     = property_finalize;
-
-       g_type_class_add_private (object_class, sizeof (TrackerPropertyPrivate));
+       object_class->finalize = property_finalize;
 }
 
 static void
@@ -136,7 +133,7 @@ tracker_property_init (TrackerProperty *property)
 {
        TrackerPropertyPrivate *priv;
 
-       priv = TRACKER_PROPERTY_GET_PRIVATE (property);
+       priv = tracker_property_get_instance_private (property);
 
        priv->id = 0;
        priv->weight = 1;
@@ -147,9 +144,6 @@ tracker_property_init (TrackerProperty *property)
        priv->domain_indexes = g_array_new (TRUE, TRUE, sizeof (TrackerClass *));
        priv->last_super_properties = NULL;
        priv->cardinality_changed = FALSE;
-
-       /* Make GET_PRIV working */
-       property->priv = priv;
 }
 
 static void
@@ -157,7 +151,7 @@ property_finalize (GObject *object)
 {
        TrackerPropertyPrivate *priv;
 
-       priv = GET_PRIV (object);
+       priv = tracker_property_get_instance_private (TRACKER_PROPERTY (object));
 
        g_free (priv->uri);
        g_free (priv->name);
@@ -207,7 +201,7 @@ tracker_property_new (gboolean use_gvdb)
        property = g_object_new (TRACKER_TYPE_PROPERTY, NULL);
 
        if (use_gvdb) {
-               priv = GET_PRIV (property);
+               priv = tracker_property_get_instance_private (property);
                priv->use_gvdb = use_gvdb;
        }
 
@@ -221,7 +215,7 @@ tracker_property_get_uri (TrackerProperty *property)
 
        g_return_val_if_fail (TRACKER_IS_PROPERTY (property), NULL);
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        return priv->uri;
 }
@@ -233,7 +227,7 @@ tracker_property_get_transient (TrackerProperty *property)
 
        g_return_val_if_fail (TRACKER_IS_PROPERTY (property), FALSE);
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        return priv->transient;
 }
@@ -246,7 +240,7 @@ tracker_property_get_name (TrackerProperty *property)
 
        g_return_val_if_fail (TRACKER_IS_PROPERTY (property), NULL);
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        return priv->name;
 }
@@ -258,7 +252,7 @@ tracker_property_get_table_name (TrackerProperty *property)
 
        g_return_val_if_fail (TRACKER_IS_PROPERTY (property), NULL);
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        if (!priv->table_name) {
                if (tracker_property_get_multiple_values (property)) {
@@ -280,7 +274,7 @@ tracker_property_get_data_type (TrackerProperty *property)
 
        g_return_val_if_fail (TRACKER_IS_PROPERTY (property), TRACKER_PROPERTY_TYPE_STRING); //FIXME
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        if (priv->use_gvdb) {
                const gchar *range_uri;
@@ -316,7 +310,7 @@ tracker_property_get_domain (TrackerProperty *property)
 
        g_return_val_if_fail (property != NULL, NULL);
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        if (!priv->domain && priv->use_gvdb) {
                const gchar *domain_uri;
@@ -338,7 +332,7 @@ tracker_property_get_domain_indexes (TrackerProperty *property)
 
        g_return_val_if_fail (property != NULL, NULL);
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        if (priv->use_gvdb) {
                TrackerClass *domain_index;
@@ -373,7 +367,7 @@ tracker_property_get_last_super_properties (TrackerProperty *property)
        g_return_val_if_fail (TRACKER_IS_PROPERTY (property), NULL);
        g_return_val_if_fail (property != NULL, NULL);
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        return (TrackerProperty **) (priv->last_super_properties ? priv->last_super_properties->data : NULL);
 }
@@ -385,7 +379,7 @@ tracker_property_reset_super_properties (TrackerProperty *property)
 
        g_return_if_fail (TRACKER_IS_PROPERTY (property));
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        if (priv->last_super_properties) {
                g_array_free (priv->last_super_properties, TRUE);
@@ -403,7 +397,7 @@ tracker_property_get_range (TrackerProperty *property)
 
        g_return_val_if_fail (TRACKER_IS_PROPERTY (property), NULL);
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        if (!priv->range && priv->use_gvdb) {
                const gchar *range_uri;
@@ -422,7 +416,7 @@ tracker_property_get_weight (TrackerProperty *property)
 
        g_return_val_if_fail (TRACKER_IS_PROPERTY (property), -1);
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        return priv->weight;
 }
@@ -434,7 +428,7 @@ tracker_property_get_id (TrackerProperty *property)
 
        g_return_val_if_fail (TRACKER_IS_PROPERTY (property), 0);
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        return priv->id;
 }
@@ -446,7 +440,7 @@ tracker_property_get_indexed (TrackerProperty *property)
 
        g_return_val_if_fail (TRACKER_IS_PROPERTY (property), FALSE);
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        return priv->indexed;
 }
@@ -458,7 +452,7 @@ tracker_property_get_secondary_index (TrackerProperty *property)
 
        g_return_val_if_fail (TRACKER_IS_PROPERTY (property), NULL);
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        return priv->secondary_index;
 }
@@ -473,7 +467,7 @@ tracker_property_get_fulltext_indexed (TrackerProperty *property)
 
        g_return_val_if_fail (property != NULL, FALSE);
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        if (priv->use_gvdb) {
                GVariant *value;
@@ -500,7 +494,7 @@ tracker_property_get_orig_fulltext_indexed (TrackerProperty *property)
 
        g_return_val_if_fail (property != NULL, FALSE);
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        return priv->orig_fulltext_indexed;
 }
@@ -512,7 +506,7 @@ tracker_property_get_is_new (TrackerProperty *property)
 
        g_return_val_if_fail (TRACKER_IS_PROPERTY (property), FALSE);
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        return priv->is_new;
 }
@@ -527,7 +521,7 @@ tracker_property_get_is_new_domain_index (TrackerProperty *property,
        g_return_val_if_fail (TRACKER_IS_PROPERTY (property), FALSE);
        g_return_val_if_fail (TRACKER_IS_CLASS (class), FALSE);
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        if (!priv->is_new_domain_index) {
                return FALSE;
@@ -549,7 +543,7 @@ tracker_property_get_writeback (TrackerProperty *property)
 
        g_return_val_if_fail (TRACKER_IS_PROPERTY (property), FALSE);
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        return priv->writeback;
 }
@@ -561,7 +555,7 @@ tracker_property_get_db_schema_changed (TrackerProperty *property)
 
        g_return_val_if_fail (TRACKER_IS_PROPERTY (property), FALSE);
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        return priv->db_schema_changed;
 }
@@ -573,7 +567,7 @@ tracker_property_get_cardinality_changed (TrackerProperty *property)
 
        g_return_val_if_fail (TRACKER_IS_PROPERTY (property), FALSE);
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        return priv->cardinality_changed;
 }
@@ -585,7 +579,7 @@ tracker_property_get_multiple_values (TrackerProperty *property)
 
        g_return_val_if_fail (TRACKER_IS_PROPERTY (property), FALSE);
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        if (priv->use_gvdb) {
                GVariant *value;
@@ -612,7 +606,7 @@ tracker_property_get_last_multiple_values (TrackerProperty *property)
 
        g_return_val_if_fail (TRACKER_IS_PROPERTY (property), FALSE);
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        return priv->last_multiple_values;
 }
@@ -624,7 +618,7 @@ tracker_property_get_orig_multiple_values (TrackerProperty *property)
 
        g_return_val_if_fail (TRACKER_IS_PROPERTY (property), FALSE);
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        return priv->orig_multiple_values;
 }
@@ -636,7 +630,7 @@ tracker_property_get_is_inverse_functional_property (TrackerProperty *property)
 
        g_return_val_if_fail (TRACKER_IS_PROPERTY (property), FALSE);
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        if (priv->use_gvdb) {
                GVariant *value;
@@ -663,7 +657,7 @@ tracker_property_get_force_journal (TrackerProperty *property)
 
        g_return_val_if_fail (TRACKER_IS_PROPERTY (property), FALSE);
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        return priv->force_journal;
 }
@@ -675,7 +669,7 @@ tracker_property_get_super_properties (TrackerProperty *property)
 
        g_return_val_if_fail (TRACKER_IS_PROPERTY (property), NULL);
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        return (TrackerProperty **) priv->super_properties->data;
 }
@@ -687,7 +681,7 @@ tracker_property_get_default_value (TrackerProperty *property)
 
        g_return_val_if_fail (TRACKER_IS_PROPERTY (property), NULL);
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        return priv->default_value;
 }
@@ -700,7 +694,7 @@ tracker_property_set_uri (TrackerProperty *property,
 
        g_return_if_fail (TRACKER_IS_PROPERTY (property));
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        g_free (priv->uri);
        g_free (priv->name);
@@ -741,7 +735,7 @@ tracker_property_set_transient (TrackerProperty *property,
 
        g_return_if_fail (TRACKER_IS_PROPERTY (property));
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        priv->transient = value;
 }
@@ -754,7 +748,7 @@ tracker_property_set_domain (TrackerProperty *property,
 
        g_return_if_fail (TRACKER_IS_PROPERTY (property));
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        if (priv->domain) {
                g_object_unref (priv->domain);
@@ -775,7 +769,7 @@ tracker_property_add_domain_index (TrackerProperty *property,
        g_return_if_fail (TRACKER_IS_PROPERTY (property));
        g_return_if_fail (TRACKER_IS_CLASS (value));
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        g_array_append_val (priv->domain_indexes, value);
 }
@@ -791,7 +785,7 @@ tracker_property_del_domain_index (TrackerProperty *property,
        g_return_if_fail (TRACKER_IS_PROPERTY (property));
        g_return_if_fail (TRACKER_IS_CLASS (value));
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        classes = (TrackerClass **) priv->domain_indexes->data;
        while (*classes) {
@@ -815,7 +809,7 @@ tracker_property_reset_domain_indexes (TrackerProperty *property)
 
        g_return_if_fail (TRACKER_IS_PROPERTY (property));
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
        g_array_free (priv->domain_indexes, TRUE);
        priv->domain_indexes = g_array_new (TRUE, TRUE, sizeof (TrackerClass *));
 }
@@ -828,7 +822,7 @@ tracker_property_set_secondary_index (TrackerProperty *property,
 
        g_return_if_fail (TRACKER_IS_PROPERTY (property));
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        if (priv->secondary_index) {
                g_object_unref (priv->secondary_index);
@@ -850,7 +844,7 @@ tracker_property_set_range (TrackerProperty *property,
        g_return_if_fail (TRACKER_IS_PROPERTY (property));
        g_return_if_fail (TRACKER_IS_CLASS (value));
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        if (priv->range) {
                g_object_unref (priv->range);
@@ -883,7 +877,7 @@ tracker_property_set_weight (TrackerProperty *property,
        TrackerPropertyPrivate *priv;
        g_return_if_fail (TRACKER_IS_PROPERTY (property));
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        priv->weight = value;
 }
@@ -896,7 +890,7 @@ tracker_property_set_id (TrackerProperty *property,
        TrackerPropertyPrivate *priv;
        g_return_if_fail (TRACKER_IS_PROPERTY (property));
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        priv->id = value;
 }
@@ -909,7 +903,7 @@ tracker_property_set_indexed (TrackerProperty *property,
 
        g_return_if_fail (TRACKER_IS_PROPERTY (property));
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        priv->indexed = value;
 }
@@ -922,7 +916,7 @@ tracker_property_set_is_new (TrackerProperty *property,
 
        g_return_if_fail (TRACKER_IS_PROPERTY (property));
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        priv->is_new = value;
 }
@@ -940,7 +934,7 @@ tracker_property_set_is_new_domain_index (TrackerProperty *property,
                g_return_if_fail (TRACKER_IS_CLASS (class));
        }
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        if (value) {
                if (!priv->is_new_domain_index) {
@@ -982,7 +976,7 @@ tracker_property_set_writeback (TrackerProperty *property,
 
        g_return_if_fail (TRACKER_IS_PROPERTY (property));
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        priv->writeback = value;
 }
@@ -995,7 +989,7 @@ tracker_property_set_db_schema_changed (TrackerProperty *property,
 
        g_return_if_fail (TRACKER_IS_PROPERTY (property));
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        priv->db_schema_changed = value;
 }
@@ -1008,7 +1002,7 @@ tracker_property_set_cardinality_changed (TrackerProperty *property,
 
        g_return_if_fail (TRACKER_IS_PROPERTY (property));
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        priv->cardinality_changed = value;
 }
@@ -1021,7 +1015,7 @@ tracker_property_set_orig_fulltext_indexed (TrackerProperty *property,
 
        g_return_if_fail (TRACKER_IS_PROPERTY (property));
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        priv->orig_fulltext_indexed = value;
 }
@@ -1034,7 +1028,7 @@ tracker_property_set_fulltext_indexed (TrackerProperty *property,
 
        g_return_if_fail (TRACKER_IS_PROPERTY (property));
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        priv->fulltext_indexed = value;
 }
@@ -1047,7 +1041,7 @@ tracker_property_set_multiple_values (TrackerProperty *property,
 
        g_return_if_fail (TRACKER_IS_PROPERTY (property));
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        priv->multiple_values = value;
 }
@@ -1060,7 +1054,7 @@ tracker_property_set_last_multiple_values (TrackerProperty *property,
 
        g_return_if_fail (TRACKER_IS_PROPERTY (property));
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        priv->last_multiple_values = value;
 }
@@ -1073,7 +1067,7 @@ tracker_property_set_orig_multiple_values (TrackerProperty *property,
 
        g_return_if_fail (TRACKER_IS_PROPERTY (property));
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        priv->orig_multiple_values = value;
 }
@@ -1087,7 +1081,7 @@ tracker_property_set_is_inverse_functional_property (TrackerProperty *property,
 
        g_return_if_fail (TRACKER_IS_PROPERTY (property));
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        priv->is_inverse_functional_property = value;
 }
@@ -1100,7 +1094,7 @@ tracker_property_set_force_journal (TrackerProperty *property,
 
        g_return_if_fail (TRACKER_IS_PROPERTY (property));
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        priv->force_journal = value;
 }
@@ -1114,7 +1108,7 @@ tracker_property_add_super_property (TrackerProperty *property,
        g_return_if_fail (TRACKER_IS_PROPERTY (property));
        g_return_if_fail (TRACKER_IS_PROPERTY (value));
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        g_array_append_val (priv->super_properties, value);
 }
@@ -1129,7 +1123,7 @@ tracker_property_del_super_property (TrackerProperty *property,
        g_return_if_fail (TRACKER_IS_PROPERTY (property));
        g_return_if_fail (TRACKER_IS_PROPERTY (value));
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        for (i = 0; priv->super_properties->len; i++) {
                TrackerProperty *c_value = g_array_index (priv->super_properties, TrackerProperty*, i);
@@ -1149,7 +1143,7 @@ tracker_property_set_default_value (TrackerProperty *property,
 
        g_return_if_fail (TRACKER_IS_PROPERTY (property));
 
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        g_free (priv->default_value);
        priv->default_value = g_strdup (value);
@@ -1163,7 +1157,7 @@ tracker_property_set_ontologies (TrackerProperty   *property,
 
        g_return_if_fail (TRACKER_IS_PROPERTY (property));
        g_return_if_fail (ontologies != NULL);
-       priv = GET_PRIV (property);
+       priv = tracker_property_get_instance_private (property);
 
        priv->ontologies = ontologies;
 }
diff --git a/src/libtracker-data/tracker-property.h b/src/libtracker-data/tracker-property.h
index eb75adbee..d6c314d47 100644
--- a/src/libtracker-data/tracker-property.h
+++ b/src/libtracker-data/tracker-property.h
@@ -65,7 +65,6 @@ typedef struct _TrackerPropertyPrivate TrackerPropertyPrivate;
 
 struct _TrackerProperty {
        GObject parent;
-       TrackerPropertyPrivate *priv;
 };
 
 struct _TrackerPropertyClass {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]