From 782c4c1caa44f1d497fea77ea8ada838c298570e Mon Sep 17 00:00:00 2001 From: Allison Ryan Lortie Date: Mon, 30 Nov 2015 21:44:07 +0000 Subject: Modernise the headers of dconf-client Add support for g_autoptr() on DConfClient and DConfChangeset. Switch to using G_DECLARE_FINAL_TYPE in the declaration of DConfClient. https://bugzilla.gnome.org/show_bug.cgi?id=758871 --- client/dconf-client.c | 4 +++- client/dconf-client.h | 9 ++------- 2 files changed, 5 insertions(+), 8 deletions(-) (limited to 'client') diff --git a/client/dconf-client.c b/client/dconf-client.c index fb26527..2af7dfa 100644 --- a/client/dconf-client.c +++ b/client/dconf-client.c @@ -87,7 +87,9 @@ dconf_client_init (DConfClient *client) static void dconf_client_class_init (DConfClientClass *class) { - class->finalize = dconf_client_finalize; + GObjectClass *object_class = G_OBJECT_CLASS (class); + + object_class->finalize = dconf_client_finalize; /** * DConfClient::changed: diff --git a/client/dconf-client.h b/client/dconf-client.h index d15d2ce..e37c615 100644 --- a/client/dconf-client.h +++ b/client/dconf-client.h @@ -26,13 +26,7 @@ G_BEGIN_DECLS #define DCONF_TYPE_CLIENT (dconf_client_get_type ()) -#define DCONF_CLIENT(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), DCONF_TYPE_CLIENT, DConfClient)) -#define DCONF_IS_CLIENT(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), DCONF_TYPE_CLIENT)) - -typedef GObjectClass DConfClientClass; -typedef struct _DConfClient DConfClient; - -GType dconf_client_get_type (void); +G_DECLARE_FINAL_TYPE(DConfClient, dconf_client, DCONF, CLIENT, GObject) DConfClient * dconf_client_new (void); @@ -85,6 +79,7 @@ void dconf_client_unwatch_sync (DConfCl void dconf_client_sync (DConfClient *client); + G_END_DECLS #endif /* __dconf_client_h__ */ -- cgit v1.2.1