diff --git a/libsecret/secret-collection.c b/libsecret/secret-collection.c index 8582080..a6d1e87 100644 --- a/libsecret/secret-collection.c +++ b/libsecret/secret-collection.c @@ -119,6 +119,7 @@ static void secret_collection_initable_iface (GInitableIface *iface); static void secret_collection_async_initable_iface (GAsyncInitableIface *iface); G_DEFINE_TYPE_WITH_CODE (SecretCollection, secret_collection, G_TYPE_DBUS_PROXY, + G_ADD_PRIVATE (SecretCollection) G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, secret_collection_initable_iface); G_IMPLEMENT_INTERFACE (G_TYPE_ASYNC_INITABLE, secret_collection_async_initable_iface); ); @@ -133,8 +134,7 @@ items_table_new (void) static void secret_collection_init (SecretCollection *self) { - self->pv = G_TYPE_INSTANCE_GET_PRIVATE (self, SECRET_TYPE_COLLECTION, - SecretCollectionPrivate); + self->pv = secret_collection_get_instance_private (self); g_mutex_init (&self->pv->mutex); self->pv->cancellable = g_cancellable_new (); @@ -503,8 +503,6 @@ secret_collection_class_init (SecretCollectionClass *klass) g_object_class_install_property (gobject_class, PROP_MODIFIED, g_param_spec_uint64 ("modified", "Modified", "Item modified date", 0UL, G_MAXUINT64, 0UL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - - g_type_class_add_private (gobject_class, sizeof (SecretCollectionPrivate)); } static gboolean diff --git a/libsecret/secret-item.c b/libsecret/secret-item.c index ca5e432..d447bcd 100644 --- a/libsecret/secret-item.c +++ b/libsecret/secret-item.c @@ -114,6 +114,7 @@ static void secret_item_initable_iface (GInitableIface *iface); static void secret_item_async_initable_iface (GAsyncInitableIface *iface); G_DEFINE_TYPE_WITH_CODE (SecretItem, secret_item, G_TYPE_DBUS_PROXY, + G_ADD_PRIVATE (SecretItem) G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, secret_item_initable_iface); G_IMPLEMENT_INTERFACE (G_TYPE_ASYNC_INITABLE, secret_item_async_initable_iface); ); @@ -121,7 +122,7 @@ G_DEFINE_TYPE_WITH_CODE (SecretItem, secret_item, G_TYPE_DBUS_PROXY, static void secret_item_init (SecretItem *self) { - self->pv = G_TYPE_INSTANCE_GET_PRIVATE (self, SECRET_TYPE_ITEM, SecretItemPrivate); + self->pv = secret_item_get_instance_private (self); g_mutex_init (&self->pv->mutex); } @@ -403,8 +404,6 @@ secret_item_class_init (SecretItemClass *klass) g_object_class_install_property (gobject_class, PROP_MODIFIED, g_param_spec_uint64 ("modified", "Modified", "Item modified date", 0UL, G_MAXUINT64, 0UL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - - g_type_class_add_private (gobject_class, sizeof (SecretItemPrivate)); } typedef struct { diff --git a/libsecret/secret-prompt.c b/libsecret/secret-prompt.c index 4c6aeda..b6e71a0 100644 --- a/libsecret/secret-prompt.c +++ b/libsecret/secret-prompt.c @@ -59,19 +59,17 @@ struct _SecretPromptPrivate { gint prompted; }; -G_DEFINE_TYPE (SecretPrompt, secret_prompt, G_TYPE_DBUS_PROXY); +G_DEFINE_TYPE_WITH_PRIVATE (SecretPrompt, secret_prompt, G_TYPE_DBUS_PROXY); static void secret_prompt_init (SecretPrompt *self) { - self->pv = G_TYPE_INSTANCE_GET_PRIVATE (self, SECRET_TYPE_PROMPT, - SecretPromptPrivate); + self->pv = secret_prompt_get_instance_private (self); } static void secret_prompt_class_init (SecretPromptClass *klass) { - g_type_class_add_private (klass, sizeof (SecretPromptPrivate)); } typedef struct { diff --git a/libsecret/secret-service.c b/libsecret/secret-service.c index 9d5c805..dc8b86c 100644 --- a/libsecret/secret-service.c +++ b/libsecret/secret-service.c @@ -140,6 +140,7 @@ static void secret_service_initable_iface (GInitableIface *iface); static void secret_service_async_initable_iface (GAsyncInitableIface *iface); G_DEFINE_TYPE_WITH_CODE (SecretService, secret_service, G_TYPE_DBUS_PROXY, + G_ADD_PRIVATE (SecretService) G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, secret_service_initable_iface); G_IMPLEMENT_INTERFACE (G_TYPE_ASYNC_INITABLE, secret_service_async_initable_iface); ); @@ -225,8 +226,7 @@ service_cache_instance (SecretService *instance) static void secret_service_init (SecretService *self) { - self->pv = G_TYPE_INSTANCE_GET_PRIVATE (self, SECRET_TYPE_SERVICE, - SecretServicePrivate); + self->pv = secret_service_get_instance_private (self); g_mutex_init (&self->pv->mutex); self->pv->cancellable = g_cancellable_new (); @@ -557,8 +557,6 @@ secret_service_class_init (SecretServiceClass *klass) g_param_spec_boxed ("collections", "Collections", "Secret Service Collections", _secret_list_get_type (), G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); - g_type_class_add_private (klass, sizeof (SecretServicePrivate)); - /* Initialize this error domain, registers dbus errors */ _secret_error_quark = secret_error_get_quark (); }