diff options
Diffstat (limited to 'src/nm-dhcp6-config.c')
-rw-r--r-- | src/nm-dhcp6-config.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/src/nm-dhcp6-config.c b/src/nm-dhcp6-config.c index e127443345..1d3168f28e 100644 --- a/src/nm-dhcp6-config.c +++ b/src/nm-dhcp6-config.c @@ -24,7 +24,6 @@ #include "nm-glib.h" #include "nm-dbus-interface.h" -#include "nm-dbus-manager.h" #include "nm-dhcp6-config.h" #include "nm-dhcp6-config-glue.h" #include "nm-dbus-glib-types.h" @@ -35,7 +34,6 @@ G_DEFINE_TYPE (NMDhcp6Config, nm_dhcp6_config, NM_TYPE_EXPORTED_OBJECT) #define NM_DHCP6_CONFIG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DHCP6_CONFIG, NMDhcp6ConfigPrivate)) typedef struct { - char *dbus_path; GHashTable *options; } NMDhcp6ConfigPrivate; @@ -110,14 +108,6 @@ nm_dhcp6_config_list_options (NMDhcp6Config *self) return list; } -const char * -nm_dhcp6_config_get_dbus_path (NMDhcp6Config *self) -{ - g_return_val_if_fail (NM_IS_DHCP6_CONFIG (self), NULL); - - return NM_DHCP6_CONFIG_GET_PRIVATE (self)->dbus_path; -} - static void nm_gvalue_destroy (gpointer data) { @@ -131,10 +121,8 @@ static void nm_dhcp6_config_init (NMDhcp6Config *self) { NMDhcp6ConfigPrivate *priv = NM_DHCP6_CONFIG_GET_PRIVATE (self); - static guint32 counter = 0; - priv->dbus_path = g_strdup_printf (NM_DBUS_PATH "/DHCP6Config/%d", counter++); - nm_dbus_manager_register_object (nm_dbus_manager_get (), priv->dbus_path, self); + nm_exported_object_export (NM_EXPORTED_OBJECT (self)); priv->options = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, nm_gvalue_destroy); } @@ -144,7 +132,6 @@ finalize (GObject *object) { NMDhcp6ConfigPrivate *priv = NM_DHCP6_CONFIG_GET_PRIVATE (object); - g_free (priv->dbus_path); g_hash_table_destroy (priv->options); G_OBJECT_CLASS (nm_dhcp6_config_parent_class)->finalize (object); @@ -170,9 +157,12 @@ static void nm_dhcp6_config_class_init (NMDhcp6ConfigClass *config_class) { GObjectClass *object_class = G_OBJECT_CLASS (config_class); + NMExportedObjectClass *exported_object_class = NM_EXPORTED_OBJECT_CLASS (config_class); g_type_class_add_private (config_class, sizeof (NMDhcp6ConfigPrivate)); + exported_object_class->export_path = NM_DBUS_PATH "/DHCP6Config/%u"; + /* virtual methods */ object_class->get_property = get_property; object_class->finalize = finalize; |