Commit 83f7b63c authored by Carlos Garnacho's avatar Carlos Garnacho
Browse files

tracker3: Move away from g_type_class_add_private()

Use G_*_PRIVATE when declaring the type.
parent d678d9f6
......@@ -703,7 +703,7 @@ void
grl_tracker_source_store_metadata (GrlSource *source,
GrlSourceStoreMetadataSpec *sms)
{
GrlTrackerSourcePriv *priv = GRL_TRACKER_SOURCE_GET_PRIVATE (source);
GrlTrackerSourcePrivate *priv = GRL_TRACKER_SOURCE (source)->priv;
TrackerResource *resource;
GrlTrackerOp *os;
......@@ -968,7 +968,7 @@ grl_tracker_source_cancel (GrlSource *source, guint operation_id)
gboolean
grl_tracker_source_change_start (GrlSource *source, GError **error)
{
GrlTrackerSourcePriv *priv = GRL_TRACKER_SOURCE_GET_PRIVATE (source);
GrlTrackerSourcePrivate *priv = GRL_TRACKER_SOURCE (source)->priv;
priv->notifier =
grl_tracker_source_notify_new (source, priv->tracker_connection);
......@@ -979,7 +979,7 @@ grl_tracker_source_change_start (GrlSource *source, GError **error)
gboolean
grl_tracker_source_change_stop (GrlSource *source, GError **error)
{
GrlTrackerSourcePriv *priv = GRL_TRACKER_SOURCE_GET_PRIVATE (source);
GrlTrackerSourcePrivate *priv = GRL_TRACKER_SOURCE (source)->priv;
g_clear_object (&priv->notifier);
......
......@@ -62,7 +62,7 @@ typedef enum {
GRL_TRACKER_SOURCE_STATE_DELETED,
} GrlTrackerSourceState;
struct _GrlTrackerSourcePriv {
struct _GrlTrackerSourcePrivate {
TrackerSparqlConnection *tracker_connection;
GDBusProxy *writeback;
......
......@@ -453,7 +453,7 @@ grl_tracker_source_create_statement (GrlTrackerSource *source,
const gchar *extra_sparql,
GError **error)
{
GrlTrackerSourcePriv *priv = source->priv;
GrlTrackerSourcePrivate *priv = source->priv;
CachedStatement *cache;
GError *tracker_error = NULL;
GList *link, *keys_copy;
......
......@@ -75,7 +75,7 @@ GrlTrackerCache *grl_tracker_item_cache;
/* ================== TrackerSource GObject ================ */
G_DEFINE_TYPE (GrlTrackerSource, grl_tracker_source, GRL_TYPE_SOURCE);
G_DEFINE_TYPE_WITH_PRIVATE (GrlTrackerSource, grl_tracker_source, GRL_TYPE_SOURCE);
static GrlTrackerSource *
grl_tracker_source_new (TrackerSparqlConnection *connection)
......@@ -124,14 +124,12 @@ grl_tracker_source_class_init (GrlTrackerSourceClass * klass)
G_PARAM_WRITABLE
| G_PARAM_CONSTRUCT_ONLY
| G_PARAM_STATIC_NAME));
g_type_class_add_private (klass, sizeof (GrlTrackerSourcePriv));
}
static void
grl_tracker_source_init (GrlTrackerSource *source)
{
GrlTrackerSourcePriv *priv = GRL_TRACKER_SOURCE_GET_PRIVATE (source);
GrlTrackerSourcePrivate *priv = grl_tracker_source_get_instance_private (source);
GDBusConnection *connection;
source->priv = priv;
......@@ -172,7 +170,7 @@ grl_tracker_source_set_property (GObject *object,
GParamSpec *pspec)
{
GrlTrackerSourcePriv *priv = GRL_TRACKER_SOURCE_GET_PRIVATE (object);
GrlTrackerSourcePrivate *priv = GRL_TRACKER_SOURCE (object)->priv;
switch (propid) {
case PROP_TRACKER_CONNECTION:
......@@ -188,7 +186,7 @@ grl_tracker_source_set_property (GObject *object,
TrackerSparqlConnection *
grl_tracker_source_get_tracker_connection (GrlTrackerSource *source)
{
GrlTrackerSourcePriv *priv;
GrlTrackerSourcePrivate *priv;
g_return_val_if_fail (GRL_IS_TRACKER_SOURCE (source), NULL);
......@@ -202,7 +200,7 @@ grl_tracker_source_get_tracker_connection (GrlTrackerSource *source)
void
grl_tracker_add_source (GrlTrackerSource *source)
{
GrlTrackerSourcePriv *priv = GRL_TRACKER_SOURCE_GET_PRIVATE (source);
GrlTrackerSourcePrivate *priv = source->priv;
GRL_DEBUG ("====================>add source '%s'",
grl_source_get_name (GRL_SOURCE (source)));
......@@ -217,7 +215,7 @@ grl_tracker_add_source (GrlTrackerSource *source)
void
grl_tracker_del_source (GrlTrackerSource *source)
{
GrlTrackerSourcePriv *priv = GRL_TRACKER_SOURCE_GET_PRIVATE (source);
GrlTrackerSourcePrivate *priv = source->priv;
GRL_DEBUG ("==================>del source '%s'",
grl_source_get_name (GRL_SOURCE (source)));
......@@ -232,7 +230,7 @@ grl_tracker_del_source (GrlTrackerSource *source)
gboolean
grl_tracker_source_can_notify (GrlTrackerSource *source)
{
GrlTrackerSourcePriv *priv = GRL_TRACKER_SOURCE_GET_PRIVATE (source);
GrlTrackerSourcePrivate *priv = source->priv;
if (priv->state == GRL_TRACKER_SOURCE_STATE_RUNNING)
return priv->notifier != NULL;
......
......@@ -55,14 +55,14 @@
GrlTrackerSourceClass))
typedef struct _GrlTrackerSource GrlTrackerSource;
typedef struct _GrlTrackerSourcePriv GrlTrackerSourcePriv;
typedef struct _GrlTrackerSourcePrivate GrlTrackerSourcePrivate;
struct _GrlTrackerSource {
GrlSource parent;
/*< private >*/
GrlTrackerSourcePriv *priv;
GrlTrackerSourcePrivate *priv;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment