diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2012-03-15 18:17:01 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-03-16 14:53:26 +0100 |
commit | 473c5fee4d920d723366cef1f406279e48eaf3d2 (patch) | |
tree | c5d8e630a8648c17299d0950d25fe77c5a5e1f0a /src/mm-bearer.c | |
parent | 4f06aa5106be4688a751bf34601d1a03e3c49ce6 (diff) |
bearer: properties are exposed before exporting the bearer object
And we let subclasses to specify which of the input properties need to be
exposed.
Diffstat (limited to 'src/mm-bearer.c')
-rw-r--r-- | src/mm-bearer.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/src/mm-bearer.c b/src/mm-bearer.c index 7f92677b..4a7e7b49 100644 --- a/src/mm-bearer.c +++ b/src/mm-bearer.c @@ -68,12 +68,28 @@ struct _MMBearerPrivate { /*****************************************************************************/ +static void +bearer_expose_properties (MMBearer *self) +{ + MMBearerProperties *properties; + GVariant *dictionary; + + properties = MM_BEARER_GET_CLASS (self)->expose_properties (self); + dictionary = mm_bearer_properties_get_dictionary (properties); + mm_gdbus_bearer_set_properties (MM_GDBUS_BEARER (self), dictionary); + g_variant_unref (dictionary); + g_object_unref (properties); +} + void mm_bearer_export (MMBearer *self) { static guint id = 0; gchar *path; + /* Expose properties before exporting */ + bearer_expose_properties (self); + path = g_strdup_printf (MM_DBUS_BEARER_PREFIX "/%d", id++); g_object_set (self, MM_BEARER_PATH, path, @@ -637,21 +653,6 @@ mm_bearer_cmp_properties (MMBearer *self, /*****************************************************************************/ -void -mm_bearer_expose_properties (MMBearer *bearer, - MMBearerProperties *properties) -{ - GVariant *dictionary; - - /* Keep the whole list of properties in the interface */ - dictionary = mm_bearer_properties_get_dictionary (properties); - mm_gdbus_bearer_set_properties (MM_GDBUS_BEARER (bearer), - dictionary); - g_variant_unref (dictionary); -} - -/*****************************************************************************/ - static void set_property (GObject *object, guint prop_id, |