summaryrefslogtreecommitdiff
path: root/libsecret
diff options
context:
space:
mode:
authorNiels De Graef <nielsdegraef@gmail.com>2019-01-24 00:07:33 +0100
committerNiels De Graef <nielsdegraef@gmail.com>2019-01-24 00:07:33 +0100
commit950b22bab6103640220f0368936d3dbfdd17ba1a (patch)
treef93e2ae974bf15464e14e044367a800e63351d2d /libsecret
parent5f24b4521b6561a9a7678016c62ec8a73dccdaea (diff)
downloadlibsecret-950b22bab6103640220f0368936d3dbfdd17ba1a.tar.gz
Remove deprecated g_type_class_add_private()
Use `G_ADD_PRIVATE()` or its shorthand when defining a type using `G_DEFINE_TYPE_WITH_PRIVATE()`
Diffstat (limited to 'libsecret')
-rw-r--r--libsecret/secret-collection.c6
-rw-r--r--libsecret/secret-item.c5
-rw-r--r--libsecret/secret-prompt.c6
-rw-r--r--libsecret/secret-service.c6
4 files changed, 8 insertions, 15 deletions
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 ();
}