[gnome-online-accounts] provider: Use G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-online-accounts] provider: Use G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE
- Date: Tue, 7 Feb 2017 15:57:40 +0000 (UTC)
commit 57efebfe37a38d2121af00cf02e0126940e33541
Author: Debarshi Ray <debarshir gnome org>
Date: Tue Feb 7 16:31:10 2017 +0100
provider: Use G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE
This paves the way for improving our GObject use and reducing the
amount of boilerplate.
src/goabackend/goaprovider.c | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/src/goabackend/goaprovider.c b/src/goabackend/goaprovider.c
index 4f13c36..478d32a 100644
--- a/src/goabackend/goaprovider.c
+++ b/src/goabackend/goaprovider.c
@@ -101,9 +101,7 @@ static void goa_provider_show_account_real (GoaProvider *provider,
GtkGrid *dummy1,
GtkGrid *dummy2);
-#define GOA_PROVIDER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GOA_TYPE_PROVIDER,
GoaProviderPrivate))
-
-G_DEFINE_ABSTRACT_TYPE (GoaProvider, goa_provider, G_TYPE_OBJECT);
+G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GoaProvider, goa_provider, G_TYPE_OBJECT);
static struct {
GoaProviderFeatures feature;
@@ -230,7 +228,7 @@ goa_provider_dispose (GObject *object)
static void
goa_provider_init (GoaProvider *self)
{
- self->priv = GOA_PROVIDER_GET_PRIVATE (self);
+ self->priv = goa_provider_get_instance_private (self);
}
static void
@@ -238,8 +236,6 @@ goa_provider_class_init (GoaProviderClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- g_type_class_add_private (klass, sizeof (GoaProviderPrivate));
-
object_class->set_property = goa_provider_set_property;
object_class->get_property = goa_provider_get_property;
object_class->dispose = goa_provider_dispose;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]