diff options
author | Ryan Lortie <desrt@desrt.ca> | 2013-01-07 18:30:47 -0500 |
---|---|---|
committer | Ryan Lortie <desrt@desrt.ca> | 2013-01-08 13:19:33 -0500 |
commit | 92c6f91b41c1e0a26c9ab52640201930aa6f3e88 (patch) | |
tree | c781777d5197e21cc3a99e7701afcc40428c1423 /service | |
parent | 4ed6cd42312e600e44414b4a9f5ae4f232937a18 (diff) | |
download | dconf-92c6f91b41c1e0a26c9ab52640201930aa6f3e88.tar.gz |
writer: add @type argument to constructor
dconf_writer_new() now takes a type so we can create subtypes of
DConfWriter.
Diffstat (limited to 'service')
-rw-r--r-- | service/dconf-service.c | 2 | ||||
-rw-r--r-- | service/dconf-writer.c | 7 | ||||
-rw-r--r-- | service/dconf-writer.h | 3 |
3 files changed, 8 insertions, 4 deletions
diff --git a/service/dconf-service.c b/service/dconf-service.c index f4b2515..63ffff6 100644 --- a/service/dconf-service.c +++ b/service/dconf-service.c @@ -110,7 +110,7 @@ dconf_service_get_writer (DConfService *service, GError *error = NULL; gchar *object_path; - writer = dconf_writer_new (name); + writer = dconf_writer_new (DCONF_TYPE_WRITER, name); g_hash_table_insert (service->writers, g_strdup (name), writer); object_path = g_strjoin ("/", base_path, name, NULL); g_dbus_interface_skeleton_export (writer, connection, object_path, &error); diff --git a/service/dconf-writer.c b/service/dconf-writer.c index 05519a1..46aaf2d 100644 --- a/service/dconf-writer.c +++ b/service/dconf-writer.c @@ -325,7 +325,10 @@ dconf_writer_get_name (DConfWriter *writer) } GDBusInterfaceSkeleton * -dconf_writer_new (const gchar *name) +dconf_writer_new (GType type, + const gchar *name) { - return g_object_new (DCONF_TYPE_WRITER, "name", name, NULL); + g_return_val_if_fail (g_type_is_a (type, DCONF_TYPE_WRITER), NULL); + + return g_object_new (type, "name", name, NULL); } diff --git a/service/dconf-writer.h b/service/dconf-writer.h index eb00422..7783c94 100644 --- a/service/dconf-writer.h +++ b/service/dconf-writer.h @@ -64,6 +64,7 @@ struct _DConfWriter DConfWriterPrivate *priv; }; -GDBusInterfaceSkeleton *dconf_writer_new (const gchar *filename); +GDBusInterfaceSkeleton *dconf_writer_new (GType type, + const gchar *name); #endif /* __dconf_writer_h__ */ |