summaryrefslogtreecommitdiff
path: root/src/devices/wifi
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-01-06 22:10:00 +0100
committerThomas Haller <thaller@redhat.com>2016-01-06 22:37:18 +0100
commit7a3940a027540eb26bc8597fb7898eae6570bd68 (patch)
treec477629070b7893cd70f4fbdb5429201ca61543c /src/devices/wifi
parentccd2ec7b343e1078c8b5d0cd3ee9d8cfd46ddd3f (diff)
wifi: refactor creation of NMDeviceWifi/NMDeviceOlpcMesh to initialize in constructed() method
(cherry picked from commit 1a835ad3d03ffe39a3caf4796027baaba73bf9b8)
Diffstat (limited to 'src/devices/wifi')
-rw-r--r--src/devices/wifi/nm-device-olpc-mesh.c22
-rw-r--r--src/devices/wifi/nm-device-wifi.c25
2 files changed, 13 insertions, 34 deletions
diff --git a/src/devices/wifi/nm-device-olpc-mesh.c b/src/devices/wifi/nm-device-olpc-mesh.c
index 021b385de9..49b5bfb375 100644
--- a/src/devices/wifi/nm-device-olpc-mesh.c
+++ b/src/devices/wifi/nm-device-olpc-mesh.c
@@ -438,22 +438,13 @@ nm_device_olpc_mesh_init (NMDeviceOlpcMesh * self)
{
}
-static GObject*
-constructor (GType type,
- guint n_construct_params,
- GObjectConstructParam *construct_params)
+static void
+constructed (GObject *object)
{
- GObject *object;
- GObjectClass *klass;
- NMDeviceOlpcMesh *self;
- NMDeviceOlpcMeshPrivate *priv;
-
- klass = G_OBJECT_CLASS (nm_device_olpc_mesh_parent_class);
- object = klass->constructor (type, n_construct_params, construct_params);
- g_return_val_if_fail (object, NULL);
+ NMDeviceOlpcMesh *self = NM_DEVICE_OLPC_MESH (object);
+ NMDeviceOlpcMeshPrivate *priv = NM_DEVICE_OLPC_MESH_GET_PRIVATE (self);
- self = NM_DEVICE_OLPC_MESH (object);
- priv = NM_DEVICE_OLPC_MESH_GET_PRIVATE (self);
+ G_OBJECT_CLASS (nm_device_olpc_mesh_parent_class)->constructed (object);
priv->manager = g_object_ref (nm_manager_get ());
@@ -462,7 +453,6 @@ constructor (GType type,
/* shorter timeout for mesh connectivity */
nm_device_set_dhcp_timeout (NM_DEVICE (self), 20);
- return object;
}
static void
@@ -524,7 +514,7 @@ nm_device_olpc_mesh_class_init (NMDeviceOlpcMeshClass *klass)
g_type_class_add_private (object_class, sizeof (NMDeviceOlpcMeshPrivate));
- object_class->constructor = constructor;
+ object_class->constructed = constructed;
object_class->get_property = get_property;
object_class->set_property = set_property;
object_class->dispose = dispose;
diff --git a/src/devices/wifi/nm-device-wifi.c b/src/devices/wifi/nm-device-wifi.c
index dec4e4f2ce..8ea3b6848e 100644
--- a/src/devices/wifi/nm-device-wifi.c
+++ b/src/devices/wifi/nm-device-wifi.c
@@ -189,30 +189,19 @@ static void remove_supplicant_interface_error_handler (NMDeviceWifi *self);
/*****************************************************************/
-static GObject*
-constructor (GType type,
- guint n_construct_params,
- GObjectConstructParam *construct_params)
-{
- GObject *object;
- GObjectClass *klass;
- NMDeviceWifi *self;
- NMDeviceWifiPrivate *priv;
-
- klass = G_OBJECT_CLASS (nm_device_wifi_parent_class);
- object = klass->constructor (type, n_construct_params, construct_params);
- g_return_val_if_fail (object, NULL);
+static void
+constructed (GObject *object)
+{
+ NMDeviceWifi *self = NM_DEVICE_WIFI (object);
+ NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (self);
- self = NM_DEVICE_WIFI (object);
- priv = NM_DEVICE_WIFI_GET_PRIVATE (self);
+ G_OBJECT_CLASS (nm_device_wifi_parent_class)->constructed (object);
if (priv->capabilities & NM_WIFI_DEVICE_CAP_AP)
_LOGI (LOGD_HW | LOGD_WIFI, "driver supports Access Point (AP) mode");
/* Connect to the supplicant manager */
priv->sup_mgr = g_object_ref (nm_supplicant_manager_get ());
-
- return object;
}
static gboolean
@@ -3311,7 +3300,7 @@ nm_device_wifi_class_init (NMDeviceWifiClass *klass)
g_type_class_add_private (object_class, sizeof (NMDeviceWifiPrivate));
- object_class->constructor = constructor;
+ object_class->constructed = constructed;
object_class->get_property = get_property;
object_class->set_property = set_property;
object_class->dispose = dispose;