Commit 9fd98ef9 authored by Dan Winship's avatar Dan Winship Committed by Dan Williams

libnm-glib: implement GInitable/GAsyncInitable in NMObject

Implement GInitable and GAsyncInitable in NMObject, with
implementations that synchronously or asynchonously load all
properties, and change _nm_object_ensure_inited() to run
g_initable_init().

Update the object/object-array property handling to initialize the
objects after creating them (synchronously or asynchronously,
according to the situation), so that they will have all of their
properties preloaded before they are ever visible to the caller.

Move the non-blocking/non-failable parts of various objects'
constructor() methods to constructed(), and move the blocking/failable
parts to init(), and implement init_async() methods with non-blocking
versions of the blocking methods.

Make nm_device_new() and nm_client_new() call
_nm_object_ensure_inited(), to preserve the behaviour formerly
enforced by their construct() methods, that properties are guaranteed
to be initialized before any signals involving them are emitted.
parent ad5daa09
......@@ -43,7 +43,7 @@ libdeprecated_HEADERS = libnm_glib.h
lib_LTLIBRARIES = libnm-glib.la libnm-glib-vpn.la
libnm_glib_la_CFLAGS = \
$(GLIB_CFLAGS) \
$(GIO_CFLAGS) \
$(DBUS_CFLAGS) \
$(GUDEV_CFLAGS)
......@@ -117,7 +117,7 @@ libnm_glib_la_LIBADD = \
$(top_builddir)/libnm-util/libnm-util.la \
$(top_builddir)/marshallers/libmarshallers.la \
$(builddir)/libdeprecated-nm-glib.la \
$(GLIB_LIBS) \
$(GIO_LIBS) \
$(DBUS_LIBS) \
$(GUDEV_LIBS)
......@@ -129,16 +129,16 @@ libnm_glib_la_LDFLAGS = -Wl,--version-script=$(SYMBOL_VIS_FILE) \
noinst_PROGRAMS = libnm-glib-test
libnm_glib_test_SOURCES = libnm-glib-test.c
libnm_glib_test_CFLAGS = $(GLIB_CFLAGS) $(DBUS_CFLAGS)
libnm_glib_test_LDADD = libnm-glib.la $(top_builddir)/libnm-util/libnm-util.la $(GLIB_LIBS) $(DBUS_LIBS)
libnm_glib_test_CFLAGS = $(GIO_CFLAGS) $(DBUS_CFLAGS)
libnm_glib_test_LDADD = libnm-glib.la $(top_builddir)/libnm-util/libnm-util.la $(GIO_LIBS) $(DBUS_LIBS)
libnm_glib_vpn_la_SOURCES = \
nm-vpn-plugin.c \
nm-vpn-plugin-ui-interface.c \
nm-vpn-plugin-utils.c
libnm_glib_vpn_la_CFLAGS = $(GLIB_CFLAGS) $(DBUS_CFLAGS)
libnm_glib_vpn_la_LIBADD = $(top_builddir)/libnm-util/libnm-util.la $(GLIB_LIBS) $(DBUS_LIBS)
libnm_glib_vpn_la_CFLAGS = $(GIO_CFLAGS) $(DBUS_CFLAGS)
libnm_glib_vpn_la_LIBADD = $(top_builddir)/libnm-util/libnm-util.la $(GIO_LIBS) $(DBUS_LIBS)
libnm_glib_vpn_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libnm-glib-vpn.ver \
-version-info "2:0:1"
......@@ -147,7 +147,7 @@ libnm_glib_vpn_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libnm-glib-vpn.ver \
#####################################################
libnm_glib_test_la_CFLAGS = \
$(GLIB_CFLAGS) \
$(GIO_CFLAGS) \
$(DBUS_CFLAGS) \
$(GUDEV_CFLAGS) \
-DLIBNM_GLIB_TEST
......@@ -159,7 +159,7 @@ libnm_glib_test_la_SOURCES = \
libnm_glib_test_la_LIBADD = \
$(top_builddir)/libnm-util/libnm-util.la \
$(top_builddir)/marshallers/libmarshallers.la \
$(GLIB_LIBS) \
$(GIO_LIBS) \
$(DBUS_LIBS) \
$(GUDEV_LIBS)
......
......@@ -533,30 +533,21 @@ register_properties (NMAccessPoint *ap)
property_info);
}
static GObject*
constructor (GType type,
guint n_construct_params,
GObjectConstructParam *construct_params)
static void
constructed (GObject *object)
{
NMObject *object;
NMAccessPointPrivate *priv;
object = (NMObject *) G_OBJECT_CLASS (nm_access_point_parent_class)->constructor (type,
n_construct_params,
construct_params);
if (!object)
return NULL;
G_OBJECT_CLASS (nm_access_point_parent_class)->constructed (object);
priv = NM_ACCESS_POINT_GET_PRIVATE (object);
priv->proxy = dbus_g_proxy_new_for_name (nm_object_get_connection (object),
priv->proxy = dbus_g_proxy_new_for_name (nm_object_get_connection (NM_OBJECT (object)),
NM_DBUS_SERVICE,
nm_object_get_path (object),
nm_object_get_path (NM_OBJECT (object)),
NM_DBUS_INTERFACE_ACCESS_POINT);
register_properties (NM_ACCESS_POINT (object));
return G_OBJECT (object);
}
......@@ -568,7 +559,7 @@ nm_access_point_class_init (NMAccessPointClass *ap_class)
g_type_class_add_private (ap_class, sizeof (NMAccessPointPrivate));
/* virtual methods */
object_class->constructor = constructor;
object_class->constructed = constructed;
object_class->get_property = get_property;
object_class->dispose = dispose;
object_class->finalize = finalize;
......
......@@ -445,30 +445,21 @@ register_properties (NMActiveConnection *connection)
property_info);
}
static GObject*
constructor (GType type,
guint n_construct_params,
GObjectConstructParam *construct_params)
static void
constructed (GObject *object)
{
NMObject *object;
NMActiveConnectionPrivate *priv;
object = (NMObject *) G_OBJECT_CLASS (nm_active_connection_parent_class)->constructor (type,
n_construct_params,
construct_params);
if (!object)
return NULL;
G_OBJECT_CLASS (nm_active_connection_parent_class)->constructed (object);
priv = NM_ACTIVE_CONNECTION_GET_PRIVATE (object);
priv->proxy = dbus_g_proxy_new_for_name (nm_object_get_connection (object),
priv->proxy = dbus_g_proxy_new_for_name (nm_object_get_connection (NM_OBJECT (object)),
NM_DBUS_SERVICE,
nm_object_get_path (object),
nm_object_get_path (NM_OBJECT (object)),
NM_DBUS_INTERFACE_ACTIVE_CONNECTION);
register_properties (NM_ACTIVE_CONNECTION (object));
return G_OBJECT (object);
}
......@@ -480,7 +471,7 @@ nm_active_connection_class_init (NMActiveConnectionClass *ap_class)
g_type_class_add_private (ap_class, sizeof (NMActiveConnectionPrivate));
/* virtual methods */
object_class->constructor = constructor;
object_class->constructed = constructed;
object_class->get_property = get_property;
object_class->dispose = dispose;
object_class->finalize = finalize;
......
This diff is collapsed.
......@@ -216,28 +216,19 @@ register_properties (NMDeviceBt *device)
property_info);
}
static GObject*
constructor (GType type,
guint n_construct_params,
GObjectConstructParam *construct_params)
static void
constructed (GObject *object)
{
GObject *object;
object = G_OBJECT_CLASS (nm_device_bt_parent_class)->constructor (type,
n_construct_params,
construct_params);
if (object) {
NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (object);
NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (object);
priv->proxy = dbus_g_proxy_new_for_name (nm_object_get_connection (NM_OBJECT (object)),
NM_DBUS_SERVICE,
nm_object_get_path (NM_OBJECT (object)),
NM_DBUS_INTERFACE_DEVICE_BLUETOOTH);
G_OBJECT_CLASS (nm_device_bt_parent_class)->constructed (object);
register_properties (NM_DEVICE_BT (object));
}
priv->proxy = dbus_g_proxy_new_for_name (nm_object_get_connection (NM_OBJECT (object)),
NM_DBUS_SERVICE,
nm_object_get_path (NM_OBJECT (object)),
NM_DBUS_INTERFACE_DEVICE_BLUETOOTH);
return object;
register_properties (NM_DEVICE_BT (object));
}
static void
......@@ -300,7 +291,7 @@ nm_device_bt_class_init (NMDeviceBtClass *bt_class)
g_type_class_add_private (bt_class, sizeof (NMDeviceBtPrivate));
/* virtual methods */
object_class->constructor = constructor;
object_class->constructed = constructed;
object_class->dispose = dispose;
object_class->finalize = finalize;
object_class->get_property = get_property;
......
......@@ -75,13 +75,17 @@ enum {
GObject *
nm_device_ethernet_new (DBusGConnection *connection, const char *path)
{
GObject *device;
g_return_val_if_fail (connection != NULL, NULL);
g_return_val_if_fail (path != NULL, NULL);
return g_object_new (NM_TYPE_DEVICE_ETHERNET,
NM_OBJECT_DBUS_CONNECTION, connection,
NM_OBJECT_DBUS_PATH, path,
NULL);
device = g_object_new (NM_TYPE_DEVICE_ETHERNET,
NM_OBJECT_DBUS_CONNECTION, connection,
NM_OBJECT_DBUS_PATH, path,
NULL);
_nm_object_ensure_inited (NM_OBJECT (device));
return device;
}
/**
......@@ -224,19 +228,12 @@ register_properties (NMDeviceEthernet *device)
property_info);
}
static GObject*
constructor (GType type,
guint n_construct_params,
GObjectConstructParam *construct_params)
static void
constructed (GObject *object)
{
GObject *object;
NMDeviceEthernetPrivate *priv;
object = G_OBJECT_CLASS (nm_device_ethernet_parent_class)->constructor (type,
n_construct_params,
construct_params);
if (!object)
return NULL;
G_OBJECT_CLASS (nm_device_ethernet_parent_class)->constructed (object);
priv = NM_DEVICE_ETHERNET_GET_PRIVATE (object);
......@@ -246,8 +243,6 @@ constructor (GType type,
NM_DBUS_INTERFACE_DEVICE_WIRED);
register_properties (NM_DEVICE_ETHERNET (object));
return object;
}
static void
......@@ -314,7 +309,7 @@ nm_device_ethernet_class_init (NMDeviceEthernetClass *eth_class)
g_type_class_add_private (eth_class, sizeof (NMDeviceEthernetPrivate));
/* virtual methods */
object_class->constructor = constructor;
object_class->constructed = constructed;
object_class->dispose = dispose;
object_class->finalize = finalize;
object_class->get_property = get_property;
......
......@@ -68,13 +68,17 @@ enum {
GObject *
nm_device_infiniband_new (DBusGConnection *connection, const char *path)
{
GObject *device;
g_return_val_if_fail (connection != NULL, NULL);
g_return_val_if_fail (path != NULL, NULL);
return g_object_new (NM_TYPE_DEVICE_INFINIBAND,
NM_OBJECT_DBUS_CONNECTION, connection,
NM_OBJECT_DBUS_PATH, path,
NULL);
device = g_object_new (NM_TYPE_DEVICE_INFINIBAND,
NM_OBJECT_DBUS_CONNECTION, connection,
NM_OBJECT_DBUS_PATH, path,
NULL);
_nm_object_ensure_inited (NM_OBJECT (device));
return device;
}
/**
......@@ -168,19 +172,12 @@ register_properties (NMDeviceInfiniband *device)
property_info);
}
static GObject*
constructor (GType type,
guint n_construct_params,
GObjectConstructParam *construct_params)
static void
constructed (GObject *object)
{
GObject *object;
NMDeviceInfinibandPrivate *priv;
object = G_OBJECT_CLASS (nm_device_infiniband_parent_class)->constructor (type,
n_construct_params,
construct_params);
if (!object)
return NULL;
G_OBJECT_CLASS (nm_device_infiniband_parent_class)->constructed (object);
priv = NM_DEVICE_INFINIBAND_GET_PRIVATE (object);
......@@ -190,8 +187,6 @@ constructor (GType type,
NM_DBUS_INTERFACE_DEVICE_INFINIBAND);
register_properties (NM_DEVICE_INFINIBAND (object));
return object;
}
static void
......@@ -247,7 +242,7 @@ nm_device_infiniband_class_init (NMDeviceInfinibandClass *eth_class)
g_type_class_add_private (eth_class, sizeof (NMDeviceInfinibandPrivate));
/* virtual methods */
object_class->constructor = constructor;
object_class->constructed = constructed;
object_class->dispose = dispose;
object_class->finalize = finalize;
object_class->get_property = get_property;
......
......@@ -147,29 +147,21 @@ register_properties (NMDeviceModem *device)
property_info);
}
static GObject*
constructor (GType type,
guint n_construct_params,
GObjectConstructParam *construct_params)
static void
constructed (GObject *object)
{
GObject *object;
NMDeviceModemPrivate *priv;
object = G_OBJECT_CLASS (nm_device_modem_parent_class)->constructor (type,
n_construct_params,
construct_params);
if (object) {
priv = NM_DEVICE_MODEM_GET_PRIVATE (object);
G_OBJECT_CLASS (nm_device_modem_parent_class)->constructed (object);
priv->proxy = dbus_g_proxy_new_for_name (nm_object_get_connection (NM_OBJECT (object)),
NM_DBUS_SERVICE,
nm_object_get_path (NM_OBJECT (object)),
NM_DBUS_INTERFACE_DEVICE_MODEM);
priv = NM_DEVICE_MODEM_GET_PRIVATE (object);
register_properties (NM_DEVICE_MODEM (object));
}
priv->proxy = dbus_g_proxy_new_for_name (nm_object_get_connection (NM_OBJECT (object)),
NM_DBUS_SERVICE,
nm_object_get_path (NM_OBJECT (object)),
NM_DBUS_INTERFACE_DEVICE_MODEM);
return object;
register_properties (NM_DEVICE_MODEM (object));
}
static void
......@@ -224,7 +216,7 @@ nm_device_modem_class_init (NMDeviceModemClass *modem_class)
g_type_class_add_private (modem_class, sizeof (NMDeviceModemPrivate));
/* virtual methods */
object_class->constructor = constructor;
object_class->constructed = constructed;
object_class->get_property = get_property;
object_class->dispose = dispose;
device_class->connection_valid = connection_valid;
......
......@@ -97,13 +97,17 @@ static guint signals[LAST_SIGNAL] = { 0 };
GObject *
nm_device_wifi_new (DBusGConnection *connection, const char *path)
{
GObject *device;
g_return_val_if_fail (connection != NULL, NULL);
g_return_val_if_fail (path != NULL, NULL);
return g_object_new (NM_TYPE_DEVICE_WIFI,
NM_OBJECT_DBUS_CONNECTION, connection,
NM_OBJECT_DBUS_PATH, path,
NULL);
device = g_object_new (NM_TYPE_DEVICE_WIFI,
NM_OBJECT_DBUS_CONNECTION, connection,
NM_OBJECT_DBUS_PATH, path,
NULL);
_nm_object_ensure_inited (NM_OBJECT (device));
return device;
}
/**
......@@ -538,19 +542,12 @@ register_properties (NMDeviceWifi *device)
access_point_removed);
}
static GObject*
constructor (GType type,
guint n_construct_params,
GObjectConstructParam *construct_params)
static void
constructed (GObject *object)
{
GObject *object;
NMDeviceWifiPrivate *priv;
object = G_OBJECT_CLASS (nm_device_wifi_parent_class)->constructor (type,
n_construct_params,
construct_params);
if (!object)
return NULL;
G_OBJECT_CLASS (nm_device_wifi_parent_class)->constructed (object);
priv = NM_DEVICE_WIFI_GET_PRIVATE (object);
......@@ -565,15 +562,6 @@ constructor (GType type,
"notify::" NM_DEVICE_STATE,
G_CALLBACK (state_changed_cb),
NULL);
/* Get initial access points to prevent possible errors on
* AccessPointRemoved signal processing. We could make D-Bus
* GetAccessPoints() call on a removed WiFi device object (when
* AccessPointRemoved was triggered by removing the device).
*/
nm_device_wifi_get_access_points (NM_DEVICE_WIFI (object));
return object;
}
static void
......@@ -614,7 +602,7 @@ nm_device_wifi_class_init (NMDeviceWifiClass *wifi_class)
g_type_class_add_private (wifi_class, sizeof (NMDeviceWifiPrivate));
/* virtual methods */
object_class->constructor = constructor;
object_class->constructed = constructed;
object_class->get_property = get_property;
object_class->dispose = dispose;
object_class->finalize = finalize;
......
......@@ -97,13 +97,17 @@ static guint signals[LAST_SIGNAL] = { 0 };
GObject *
nm_device_wimax_new (DBusGConnection *connection, const char *path)
{
GObject *device;
g_return_val_if_fail (connection != NULL, NULL);
g_return_val_if_fail (path != NULL, NULL);
return g_object_new (NM_TYPE_DEVICE_WIMAX,
NM_OBJECT_DBUS_CONNECTION, connection,
NM_OBJECT_DBUS_PATH, path,
NULL);
device = g_object_new (NM_TYPE_DEVICE_WIMAX,
NM_OBJECT_DBUS_CONNECTION, connection,
NM_OBJECT_DBUS_PATH, path,
NULL);
_nm_object_ensure_inited (NM_OBJECT (device));
return device;
}
/**
......@@ -525,19 +529,12 @@ register_properties (NMDeviceWimax *wimax)
nsp_removed);
}
static GObject*
constructor (GType type,
guint n_construct_params,
GObjectConstructParam *construct_params)
static void
constructed (GObject *object)
{
GObject *object;
NMDeviceWimaxPrivate *priv;
object = G_OBJECT_CLASS (nm_device_wimax_parent_class)->constructor (type,
n_construct_params,
construct_params);
if (!object)
return NULL;
G_OBJECT_CLASS (nm_device_wimax_parent_class)->constructed (object);
priv = NM_DEVICE_WIMAX_GET_PRIVATE (object);
......@@ -552,8 +549,6 @@ constructor (GType type,
"notify::" NM_DEVICE_STATE,
G_CALLBACK (state_changed_cb),
NULL);
return object;
}
static void
......@@ -586,7 +581,7 @@ nm_device_wimax_class_init (NMDeviceWimaxClass *wimax_class)
g_type_class_add_private (wimax_class, sizeof (NMDeviceWimaxPrivate));
/* virtual methods */
object_class->constructor = constructor;
object_class->constructed = constructed;
object_class->get_property = get_property;
object_class->dispose = dispose;
device_class->connection_valid = connection_valid;
......
......@@ -163,83 +163,21 @@ device_state_changed (DBusGProxy *proxy,
}
static void
get_all_cb (DBusGProxy *proxy, DBusGProxyCall *call, gpointer user_data)
constructed (GObject *object)
{
NMObject *self = NM_OBJECT (user_data);
GHashTable *props = NULL;
GError *error = NULL;
if (!dbus_g_proxy_end_call (proxy, call, &error,
DBUS_TYPE_G_MAP_OF_VARIANT, &props,
G_TYPE_INVALID)) {
if (!(error->domain == DBUS_GERROR && error->code == DBUS_GERROR_NO_REPLY)) {
g_warning ("%s: couldn't retrieve device properties: (%d) %s.",
__func__,
error ? error->code : -1,
(error && error->message) ? error->message : "(unknown)");
}
g_clear_error (&error);
g_object_unref (proxy);
return;
}
g_object_unref (proxy);
_nm_object_process_properties_changed (NM_OBJECT (self), props);
g_hash_table_destroy (props);
}
static void
initialize_properties (NMObject *object)
{
DBusGProxy *props_proxy;
/* D-Bus properties proxy */
props_proxy = dbus_g_proxy_new_for_name (nm_object_get_connection (object),
NM_DBUS_SERVICE,
nm_object_get_path (object),
"org.freedesktop.DBus.Properties");
g_assert (props_proxy);
/* Get properties */
dbus_g_proxy_begin_call (props_proxy, "GetAll",
get_all_cb,
object,
NULL,
G_TYPE_STRING, NM_DBUS_INTERFACE_DEVICE,
G_TYPE_INVALID);
}
static GObject*
constructor (GType type,
guint n_construct_params,
GObjectConstructParam *construct_params)
{
NMObject *object;
NMDevicePrivate *priv;
object = (NMObject *) G_OBJECT_CLASS (nm_device_parent_class)->constructor (type,
n_construct_params,
construct_params);
if (!object)
return NULL;
G_OBJECT_CLASS (nm_device_parent_class)->constructed (object);
priv = NM_DEVICE_GET_PRIVATE (object);
priv->proxy = dbus_g_proxy_new_for_name (nm_object_get_connection (object),
priv->proxy = dbus_g_proxy_new_for_name (nm_object_get_connection (NM_OBJECT (object)),
NM_DBUS_SERVICE,
nm_object_get_path (object),
nm_object_get_path (NM_OBJECT (object)),
NM_DBUS_INTERFACE_DEVICE);
register_properties (NM_DEVICE (object));
/* Get initial properties, so that we have all properties set even if
* no PropertiesChanged signal is received.
* It has to be called after register_for_property_changed().
*/
initialize_properties (object);
dbus_g_object_register_marshaller (_nm_marshal_VOID__UINT_UINT_UINT,
G_TYPE_NONE,
G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT,
......@@ -254,8 +192,6 @@ constructor (GType type,
G_CALLBACK (device_state_changed),
NM_DEVICE (object),
NULL);
return G_OBJECT (object);
}
static void
......@@ -393,7 +329,7 @@ nm_device_class_init (NMDeviceClass *device_class)
g_type_class_add_private (device_class, sizeof (NMDevicePrivate));
/* virtual methods */
object_class->constructor = constructor;
object_class->constructed = constructed;
object_class->get_property = get_property;
object_class->set_property = set_property;
object_class->dispose = dispose;
......@@ -704,6 +640,7 @@ GObject *
nm_device_new (DBusGConnection *connection, const char *path)
{
GType dtype;
NMDevice *device = NULL;
g_return_val_if_fail (connection != NULL, NULL);
g_return_val_if_fail (path != NULL, NULL);
......@@ -712,10 +649,12 @@ nm_device_new (DBusGConnection *connection, const char *path)
if (dtype == G_TYPE_INVALID)
return NULL;
return g_object_new (dtype,
NM_OBJECT_DBUS_CONNECTION, connection,
NM_OBJECT_DBUS_PATH, path,
NULL);
device = (NMDevice *) g_object_new (dtype,
NM_OBJECT_DBUS_CONNECTION, connection,
NM_OBJECT_DBUS_PATH, path,
NULL);
_nm_object_ensure_inited (NM_OBJECT (device));
return G_OBJECT (device);
}
typedef struct {
......
......@@ -90,34 +90,25 @@ register_properties (NMDHCP4Config *config)
property_info);
}
static GObject*
constructor (GType type,
guint n_construct_params,
GObjectConstructParam *construct_params)
static void
constructed (GObject *object)
{
NMObject *object;
DBusGConnection *connection;
NMDHCP4ConfigPrivate *priv;
object = (NMObject *) G_OBJECT_CLASS (nm_dhcp4_config_parent_class)->constructor (type,
n_construct_params,
construct_params);
if (!object)
return NULL;
G_OBJECT_CLASS (nm_dhcp4_config_parent_class)->constructed (object);
priv = NM_DHCP4_CONFIG_GET_PRIVATE (object);
priv->options = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
connection = nm_object_get_connection (object);
connection = nm_object_get_connection (NM_OBJECT (object));
priv->proxy = dbus_g_proxy_new_for_name (connection,
NM_DBUS_SERVICE,
nm_object_get_path (object),
nm_object_get_path (NM_OBJECT (object)),
NM_DBUS_INTERFACE_DHCP4_CONFIG);
register_properties (NM_DHCP4_CONFIG (object));
return G_OBJECT (object);
}
static void
......@@ -159,7 +150,7 @@ nm_dhcp4_config_class_init (NMDHCP4ConfigClass *config_class)
g_type_class_add_private (config_class, sizeof (NMDHCP4ConfigPrivate));
/* virtual methods */
object_class->constructor = constructor;
object_class->constructed = constructed;
object_class->get_property = get_property;
object_class->finalize = finalize;
......
......@@ -90,34 +90,25 @@ register_properties (NMDHCP6Config *config)
property_info);
}
static GObject*
constructor (GType type,
guint n_construct_params,
GObjectConstructParam *construct_params)
static void
constructed (GObject *object)
{
NMObject *object;
DBusGConnection *connection;
NMDHCP6ConfigPrivate *priv;
object = (NMObject *) G_OBJECT_CLASS (nm_dhcp6_config_parent_class)->constructor (type,
n_construct_params,
construct_params);
if (!object)
return NULL;
G_OBJECT_CLASS (nm_dhcp6_config_parent_class)->constructed (object);
priv = NM_DHCP6_CONFIG_GET_PRIVATE (object);
priv->options = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
connection = nm_object_get_connection (object);
connection = nm_object_get_connection (NM_OBJECT (object));
priv->proxy = dbus_g_proxy_new_for_name (connection,
NM_DBUS_SERVICE,
nm_object_get_path (object),
nm_object_get_path (NM_OBJECT (object)),
NM_DBUS_INTERFACE_DHCP6_CONFIG);
register_properties (NM_DHCP6_CONFIG (object));
return G_OBJECT (object);
}
static void
......@@ -159,7 +150,7 @@ nm_dhcp6_config_class_init (NMDHCP6ConfigClass *config_class)
g_type_class_add_private (config_class, sizeof (NMDHCP6ConfigPrivate));
/* virtual methods */
object_class->constructor = constructor;
object_class->constructed = constructed;
object_class->get_property = get_property;
object_class->finalize = finalize;
......
......@@ -132,32 +132,23 @@ register_properties (NMIP4Config *config)
property_info);
}
static GObject*
constructor (GType type,
guint n_construct_params,
GObjectConstructParam *construct_params)
static void
constructed (GObject *object)