summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllison Ryan Lortie <desrt@desrt.ca>2015-11-30 21:44:07 +0000
committerAllison Ryan Lortie <desrt@desrt.ca>2015-11-30 16:45:27 -0500
commit782c4c1caa44f1d497fea77ea8ada838c298570e (patch)
tree202c3c46c43ec4fe04e0e41ebad7afd87801e0d6
parentdf46616ff86bacb034e0b94ce73947739881fbf7 (diff)
downloaddconf-782c4c1caa44f1d497fea77ea8ada838c298570e.tar.gz
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
-rw-r--r--client/dconf-client.c4
-rw-r--r--client/dconf-client.h9
-rw-r--r--common/dconf-changeset.h2
-rw-r--r--configure.ac2
4 files changed, 8 insertions, 9 deletions
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__ */
diff --git a/common/dconf-changeset.h b/common/dconf-changeset.h
index 4f007b9..b0ce450 100644
--- a/common/dconf-changeset.h
+++ b/common/dconf-changeset.h
@@ -70,4 +70,6 @@ DConfChangeset * dconf_changeset_diff (DConfCh
void dconf_changeset_seal (DConfChangeset *changeset);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(DConfChangeset, dconf_changeset_unref)
+
#endif /* __dconf_changeset_h__ */
diff --git a/configure.ac b/configure.ac
index 60f78ba..21b57cb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -45,7 +45,7 @@ GLIB_GSETTINGS
GTK_DOC_CHECK([1.15])
# Dependencies
-PKG_CHECK_MODULES(glib, glib-2.0 >= 2.39.1)
+PKG_CHECK_MODULES(glib, glib-2.0 >= 2.44.0)
PKG_CHECK_MODULES(gio, gio-unix-2.0)
PKG_CHECK_MODULES(dbus, dbus-1)