Commit b728d1fb authored by Dan Winship's avatar Dan Winship

libnm: let NMObject create all D-Bus proxies

Add _nm_object_class_add_interface(), for declaring that a class
implements a particular interface, and then have NMObject create the
corresponding proxies itself. (The subclass can get a copy with
_nm_object_get_proxy() if it needs it for something).

(In GDBus, creating a proxy is a heavier operation than in dbus-glib,
so we'll need to create the proxies asynchronously. Moving the
creation to NMObject makes that easier since we can do it as part
of the existing init/init_async.)
parent aa18b88a
......@@ -39,8 +39,6 @@ G_DEFINE_TYPE (NMAccessPoint, nm_access_point, NM_TYPE_OBJECT)
#define NM_ACCESS_POINT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_ACCESS_POINT, NMAccessPointPrivate))
typedef struct {
DBusGProxy *proxy;
NM80211ApFlags flags;
NM80211ApSecurityFlags wpa_flags;
NM80211ApSecurityFlags rsn_flags;
......@@ -361,16 +359,6 @@ nm_access_point_init (NMAccessPoint *ap)
{
}
static void
dispose (GObject *object)
{
NMAccessPointPrivate *priv = NM_ACCESS_POINT_GET_PRIVATE (object);
g_clear_object (&priv->proxy);
G_OBJECT_CLASS (nm_access_point_parent_class)->dispose (object);
}
static void
finalize (GObject *object)
{
......@@ -449,9 +437,8 @@ init_dbus (NMObject *object)
NM_OBJECT_CLASS (nm_access_point_parent_class)->init_dbus (object);
priv->proxy = _nm_object_new_proxy (object, NULL, NM_DBUS_INTERFACE_ACCESS_POINT);
_nm_object_register_properties (object,
priv->proxy,
NM_DBUS_INTERFACE_ACCESS_POINT,
property_info);
}
......@@ -464,9 +451,10 @@ nm_access_point_class_init (NMAccessPointClass *ap_class)
g_type_class_add_private (ap_class, sizeof (NMAccessPointPrivate));
_nm_object_class_add_interface (nm_object_class, NM_DBUS_INTERFACE_ACCESS_POINT);
/* virtual methods */
object_class->get_property = get_property;
object_class->dispose = dispose;
object_class->finalize = finalize;
nm_object_class->init_dbus = init_dbus;
......
......@@ -48,8 +48,6 @@ G_DEFINE_TYPE_WITH_CODE (NMActiveConnection, nm_active_connection, NM_TYPE_OBJEC
#define NM_ACTIVE_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_ACTIVE_CONNECTION, NMActiveConnectionPrivate))
typedef struct {
DBusGProxy *proxy;
char *connection;
char *id;
char *uuid;
......@@ -461,8 +459,6 @@ dispose (GObject *object)
g_clear_object (&priv->ip6_config);
g_clear_object (&priv->dhcp6_config);
g_clear_object (&priv->proxy);
G_OBJECT_CLASS (nm_active_connection_parent_class)->dispose (object);
}
......@@ -567,9 +563,8 @@ init_dbus (NMObject *object)
NM_OBJECT_CLASS (nm_active_connection_parent_class)->init_dbus (object);
priv->proxy = _nm_object_new_proxy (object, NULL, NM_DBUS_INTERFACE_ACTIVE_CONNECTION);
_nm_object_register_properties (object,
priv->proxy,
NM_DBUS_INTERFACE_ACTIVE_CONNECTION,
property_info);
}
......@@ -582,6 +577,8 @@ nm_active_connection_class_init (NMActiveConnectionClass *ap_class)
g_type_class_add_private (ap_class, sizeof (NMActiveConnectionPrivate));
_nm_object_class_add_interface (nm_object_class, NM_DBUS_INTERFACE_ACTIVE_CONNECTION);
/* virtual methods */
object_class->get_property = get_property;
object_class->dispose = dispose;
......
......@@ -195,9 +195,9 @@ init_dbus (NMObject *object)
NM_OBJECT_CLASS (nm_client_parent_class)->init_dbus (object);
priv->client_proxy = _nm_object_new_proxy (object, NULL, NM_DBUS_INTERFACE);
priv->client_proxy = _nm_object_get_proxy (object, NM_DBUS_INTERFACE);
_nm_object_register_properties (object,
priv->client_proxy,
NM_DBUS_INTERFACE,
property_info);
/* Permissions */
......@@ -1822,8 +1822,6 @@ dispose (GObject *object)
priv->perm_call = NULL;
}
g_clear_object (&priv->client_proxy);
free_devices (client, TRUE);
free_active_connections (client, TRUE);
g_clear_object (&priv->primary_connection);
......@@ -1962,6 +1960,8 @@ nm_client_class_init (NMClientClass *client_class)
g_type_class_add_private (client_class, sizeof (NMClientPrivate));
_nm_object_class_add_interface (nm_object_class, NM_DBUS_INTERFACE);
/* virtual methods */
object_class->constructor = constructor;
object_class->constructed = constructed;
......
......@@ -32,11 +32,8 @@ G_DEFINE_TYPE (NMDeviceAdsl, nm_device_adsl, NM_TYPE_DEVICE)
#define NM_DEVICE_ADSL_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_ADSL, NMDeviceAdslPrivate))
typedef struct {
DBusGProxy *proxy;
gboolean carrier;
gboolean disposed;
} NMDeviceAdslPrivate;
enum {
......@@ -130,35 +127,11 @@ init_dbus (NMObject *object)
NM_OBJECT_CLASS (nm_device_adsl_parent_class)->init_dbus (object);
priv->proxy = _nm_object_new_proxy (object, NULL, NM_DBUS_INTERFACE_DEVICE_ADSL);
_nm_object_register_properties (object,
priv->proxy,
NM_DBUS_INTERFACE_DEVICE_ADSL,
property_info);
}
static void
dispose (GObject *object)
{
NMDeviceAdslPrivate *priv = NM_DEVICE_ADSL_GET_PRIVATE (object);
if (priv->disposed) {
G_OBJECT_CLASS (nm_device_adsl_parent_class)->dispose (object);
return;
}
priv->disposed = TRUE;
g_object_unref (priv->proxy);
G_OBJECT_CLASS (nm_device_adsl_parent_class)->dispose (object);
}
static void
finalize (GObject *object)
{
G_OBJECT_CLASS (nm_device_adsl_parent_class)->finalize (object);
}
static void
get_property (GObject *object,
guint prop_id,
......@@ -186,9 +159,9 @@ nm_device_adsl_class_init (NMDeviceAdslClass *adsl_class)
g_type_class_add_private (object_class, sizeof (NMDeviceAdslPrivate));
_nm_object_class_add_interface (nm_object_class, NM_DBUS_INTERFACE_DEVICE_ADSL);
/* virtual methods */
object_class->dispose = dispose;
object_class->finalize = finalize;
object_class->get_property = get_property;
nm_object_class->init_dbus = init_dbus;
......
......@@ -37,8 +37,6 @@ G_DEFINE_TYPE (NMDeviceBond, nm_device_bond, NM_TYPE_DEVICE)
#define NM_DEVICE_BOND_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_BOND, NMDeviceBondPrivate))
typedef struct {
DBusGProxy *proxy;
char *hw_address;
gboolean carrier;
GPtrArray *slaves;
......@@ -191,9 +189,8 @@ init_dbus (NMObject *object)
NM_OBJECT_CLASS (nm_device_bond_parent_class)->init_dbus (object);
priv->proxy = _nm_object_new_proxy (object, NULL, NM_DBUS_INTERFACE_DEVICE_BOND);
_nm_object_register_properties (object,
priv->proxy,
NM_DBUS_INTERFACE_DEVICE_BOND,
property_info);
}
......@@ -202,8 +199,6 @@ dispose (GObject *object)
{
NMDeviceBondPrivate *priv = NM_DEVICE_BOND_GET_PRIVATE (object);
g_clear_object (&priv->proxy);
g_clear_pointer (&priv->slaves, g_ptr_array_unref);
G_OBJECT_CLASS (nm_device_bond_parent_class)->dispose (object);
......@@ -252,6 +247,8 @@ nm_device_bond_class_init (NMDeviceBondClass *bond_class)
g_type_class_add_private (bond_class, sizeof (NMDeviceBondPrivate));
_nm_object_class_add_interface (nm_object_class, NM_DBUS_INTERFACE_DEVICE_BOND);
/* virtual methods */
object_class->dispose = dispose;
object_class->finalize = finalize;
......
......@@ -37,8 +37,6 @@ G_DEFINE_TYPE (NMDeviceBridge, nm_device_bridge, NM_TYPE_DEVICE)
#define NM_DEVICE_BRIDGE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_BRIDGE, NMDeviceBridgePrivate))
typedef struct {
DBusGProxy *proxy;
char *hw_address;
gboolean carrier;
GPtrArray *slaves;
......@@ -191,9 +189,8 @@ init_dbus (NMObject *object)
NM_OBJECT_CLASS (nm_device_bridge_parent_class)->init_dbus (object);
priv->proxy = _nm_object_new_proxy (object, NULL, NM_DBUS_INTERFACE_DEVICE_BRIDGE);
_nm_object_register_properties (object,
priv->proxy,
NM_DBUS_INTERFACE_DEVICE_BRIDGE,
property_info);
}
......@@ -202,8 +199,6 @@ dispose (GObject *object)
{
NMDeviceBridgePrivate *priv = NM_DEVICE_BRIDGE_GET_PRIVATE (object);
g_clear_object (&priv->proxy);
g_clear_pointer (&priv->slaves, g_ptr_array_unref);
G_OBJECT_CLASS (nm_device_bridge_parent_class)->dispose (object);
......@@ -252,6 +247,8 @@ nm_device_bridge_class_init (NMDeviceBridgeClass *bridge_class)
g_type_class_add_private (bridge_class, sizeof (NMDeviceBridgePrivate));
_nm_object_class_add_interface (nm_object_class, NM_DBUS_INTERFACE_DEVICE_BRIDGE);
/* virtual methods */
object_class->dispose = dispose;
object_class->finalize = finalize;
......
......@@ -37,8 +37,6 @@ G_DEFINE_TYPE (NMDeviceBt, nm_device_bt, NM_TYPE_DEVICE)
#define NM_DEVICE_BT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_BT, NMDeviceBtPrivate))
typedef struct {
DBusGProxy *proxy;
char *hw_address;
char *name;
guint32 bt_capabilities;
......@@ -227,22 +225,11 @@ init_dbus (NMObject *object)
NM_OBJECT_CLASS (nm_device_bt_parent_class)->init_dbus (object);
priv->proxy = _nm_object_new_proxy (object, NULL, NM_DBUS_INTERFACE_DEVICE_BLUETOOTH);
_nm_object_register_properties (object,
priv->proxy,
NM_DBUS_INTERFACE_DEVICE_BLUETOOTH,
property_info);
}
static void
dispose (GObject *object)
{
NMDeviceBtPrivate *priv = NM_DEVICE_BT_GET_PRIVATE (object);
g_clear_object (&priv->proxy);
G_OBJECT_CLASS (nm_device_bt_parent_class)->dispose (object);
}
static void
finalize (GObject *object)
{
......@@ -287,8 +274,9 @@ nm_device_bt_class_init (NMDeviceBtClass *bt_class)
g_type_class_add_private (bt_class, sizeof (NMDeviceBtPrivate));
_nm_object_class_add_interface (nm_object_class, NM_DBUS_INTERFACE_DEVICE_BLUETOOTH);
/* virtual methods */
object_class->dispose = dispose;
object_class->finalize = finalize;
object_class->get_property = get_property;
......
......@@ -38,8 +38,6 @@ G_DEFINE_TYPE (NMDeviceEthernet, nm_device_ethernet, NM_TYPE_DEVICE)
#define NM_DEVICE_ETHERNET_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_ETHERNET, NMDeviceEthernetPrivate))
typedef struct {
DBusGProxy *proxy;
char *hw_address;
char *perm_hw_address;
guint32 speed;
......@@ -226,22 +224,11 @@ init_dbus (NMObject *object)
NM_OBJECT_CLASS (nm_device_ethernet_parent_class)->init_dbus (object);
priv->proxy = _nm_object_new_proxy (object, NULL, NM_DBUS_INTERFACE_DEVICE_WIRED);
_nm_object_register_properties (object,
priv->proxy,
NM_DBUS_INTERFACE_DEVICE_WIRED,
property_info);
}
static void
dispose (GObject *object)
{
NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (object);
g_clear_object (&priv->proxy);
G_OBJECT_CLASS (nm_device_ethernet_parent_class)->dispose (object);
}
static void
finalize (GObject *object)
{
......@@ -289,8 +276,9 @@ nm_device_ethernet_class_init (NMDeviceEthernetClass *eth_class)
g_type_class_add_private (eth_class, sizeof (NMDeviceEthernetPrivate));
_nm_object_class_add_interface (nm_object_class, NM_DBUS_INTERFACE_DEVICE_WIRED);
/* virtual methods */
object_class->dispose = dispose;
object_class->finalize = finalize;
object_class->get_property = get_property;
......
......@@ -32,8 +32,6 @@ G_DEFINE_TYPE (NMDeviceGeneric, nm_device_generic, NM_TYPE_DEVICE)
#define NM_DEVICE_GENERIC_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_GENERIC, NMDeviceGenericPrivate))
typedef struct {
DBusGProxy *proxy;
char *hw_address;
char *type_description;
} NMDeviceGenericPrivate;
......@@ -148,22 +146,11 @@ init_dbus (NMObject *object)
NM_OBJECT_CLASS (nm_device_generic_parent_class)->init_dbus (object);
priv->proxy = _nm_object_new_proxy (object, NULL, NM_DBUS_INTERFACE_DEVICE_GENERIC);
_nm_object_register_properties (object,
priv->proxy,
NM_DBUS_INTERFACE_DEVICE_GENERIC,
property_info);
}
static void
dispose (GObject *object)
{
NMDeviceGenericPrivate *priv = NM_DEVICE_GENERIC_GET_PRIVATE (object);
g_clear_object (&priv->proxy);
G_OBJECT_CLASS (nm_device_generic_parent_class)->dispose (object);
}
static void
finalize (GObject *object)
{
......@@ -205,7 +192,8 @@ nm_device_generic_class_init (NMDeviceGenericClass *klass)
g_type_class_add_private (klass, sizeof (NMDeviceGenericPrivate));
object_class->dispose = dispose;
_nm_object_class_add_interface (nm_object_class, NM_DBUS_INTERFACE_DEVICE_GENERIC);
object_class->finalize = finalize;
object_class->get_property = get_property;
......
......@@ -36,8 +36,6 @@ G_DEFINE_TYPE (NMDeviceInfiniband, nm_device_infiniband, NM_TYPE_DEVICE)
#define NM_DEVICE_INFINIBAND_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_INFINIBAND, NMDeviceInfinibandPrivate))
typedef struct {
DBusGProxy *proxy;
char *hw_address;
gboolean carrier;
} NMDeviceInfinibandPrivate;
......@@ -175,22 +173,11 @@ init_dbus (NMObject *object)
NM_OBJECT_CLASS (nm_device_infiniband_parent_class)->init_dbus (object);
priv->proxy = _nm_object_new_proxy (object, NULL, NM_DBUS_INTERFACE_DEVICE_INFINIBAND);
_nm_object_register_properties (object,
priv->proxy,
NM_DBUS_INTERFACE_DEVICE_INFINIBAND,
property_info);
}
static void
dispose (GObject *object)
{
NMDeviceInfinibandPrivate *priv = NM_DEVICE_INFINIBAND_GET_PRIVATE (object);
g_clear_object (&priv->proxy);
G_OBJECT_CLASS (nm_device_infiniband_parent_class)->dispose (object);
}
static void
finalize (GObject *object)
{
......@@ -231,8 +218,9 @@ nm_device_infiniband_class_init (NMDeviceInfinibandClass *ib_class)
g_type_class_add_private (ib_class, sizeof (NMDeviceInfinibandPrivate));
_nm_object_class_add_interface (nm_object_class, NM_DBUS_INTERFACE_DEVICE_INFINIBAND);
/* virtual methods */
object_class->dispose = dispose;
object_class->finalize = finalize;
object_class->get_property = get_property;
......
......@@ -37,8 +37,6 @@ G_DEFINE_TYPE (NMDeviceModem, nm_device_modem, NM_TYPE_DEVICE)
#define NM_DEVICE_MODEM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_MODEM, NMDeviceModemPrivate))
typedef struct {
DBusGProxy *proxy;
NMDeviceModemCapabilities caps;
NMDeviceModemCapabilities current_caps;
} NMDeviceModemPrivate;
......@@ -195,9 +193,8 @@ init_dbus (NMObject *object)
NM_OBJECT_CLASS (nm_device_modem_parent_class)->init_dbus (object);
priv->proxy = _nm_object_new_proxy (object, NULL, NM_DBUS_INTERFACE_DEVICE_MODEM);
_nm_object_register_properties (object,
priv->proxy,
NM_DBUS_INTERFACE_DEVICE_MODEM,
property_info);
}
......@@ -222,16 +219,6 @@ get_property (GObject *object,
}
}
static void
dispose (GObject *object)
{
NMDeviceModemPrivate *priv = NM_DEVICE_MODEM_GET_PRIVATE (object);
g_clear_object (&priv->proxy);
G_OBJECT_CLASS (nm_device_modem_parent_class)->dispose (object);
}
static void
nm_device_modem_class_init (NMDeviceModemClass *modem_class)
{
......@@ -241,9 +228,10 @@ nm_device_modem_class_init (NMDeviceModemClass *modem_class)
g_type_class_add_private (modem_class, sizeof (NMDeviceModemPrivate));
_nm_object_class_add_interface (nm_object_class, NM_DBUS_INTERFACE_DEVICE_MODEM);
/* virtual methods */
object_class->get_property = get_property;
object_class->dispose = dispose;
nm_object_class->init_dbus = init_dbus;
......
......@@ -36,8 +36,6 @@ G_DEFINE_TYPE (NMDeviceOlpcMesh, nm_device_olpc_mesh, NM_TYPE_DEVICE)
#define NM_DEVICE_OLPC_MESH_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_OLPC_MESH, NMDeviceOlpcMeshPrivate))
typedef struct {
DBusGProxy *proxy;
char *hw_address;
NMDeviceWifi *companion;
guint32 active_channel;
......@@ -178,9 +176,8 @@ init_dbus (NMObject *object)
NM_OBJECT_CLASS (nm_device_olpc_mesh_parent_class)->init_dbus (object);
priv->proxy = _nm_object_new_proxy (object, NULL, NM_DBUS_INTERFACE_DEVICE_OLPC_MESH);
_nm_object_register_properties (object,
priv->proxy,
NM_DBUS_INTERFACE_DEVICE_OLPC_MESH,
property_info);
}
......@@ -190,7 +187,6 @@ dispose (GObject *object)
NMDeviceOlpcMeshPrivate *priv = NM_DEVICE_OLPC_MESH_GET_PRIVATE (object);
g_clear_object (&priv->companion);
g_clear_object (&priv->proxy);
G_OBJECT_CLASS (nm_device_olpc_mesh_parent_class)->dispose (object);
}
......@@ -238,6 +234,8 @@ nm_device_olpc_mesh_class_init (NMDeviceOlpcMeshClass *olpc_mesh_class)
g_type_class_add_private (olpc_mesh_class, sizeof (NMDeviceOlpcMeshPrivate));
_nm_object_class_add_interface (nm_object_class, NM_DBUS_INTERFACE_DEVICE_OLPC_MESH);
/* virtual methods */
object_class->dispose = dispose;
object_class->finalize = finalize;
......
......@@ -37,8 +37,6 @@ G_DEFINE_TYPE (NMDeviceTeam, nm_device_team, NM_TYPE_DEVICE)
#define NM_DEVICE_TEAM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_TEAM, NMDeviceTeamPrivate))
typedef struct {
DBusGProxy *proxy;
char *hw_address;
gboolean carrier;
GPtrArray *slaves;
......@@ -191,9 +189,8 @@ init_dbus (NMObject *object)
NM_OBJECT_CLASS (nm_device_team_parent_class)->init_dbus (object);
priv->proxy = _nm_object_new_proxy (object, NULL, NM_DBUS_INTERFACE_DEVICE_TEAM);
_nm_object_register_properties (object,
priv->proxy,
NM_DBUS_INTERFACE_DEVICE_TEAM,
property_info);
}
......@@ -202,8 +199,6 @@ dispose (GObject *object)
{
NMDeviceTeamPrivate *priv = NM_DEVICE_TEAM_GET_PRIVATE (object);
g_clear_object (&priv->proxy);
g_clear_pointer (&priv->slaves, g_ptr_array_unref);
G_OBJECT_CLASS (nm_device_team_parent_class)->dispose (object);
......@@ -252,6 +247,8 @@ nm_device_team_class_init (NMDeviceTeamClass *team_class)
g_type_class_add_private (team_class, sizeof (NMDeviceTeamPrivate));
_nm_object_class_add_interface (nm_object_class, NM_DBUS_INTERFACE_DEVICE_TEAM);
/* virtual methods */
object_class->dispose = dispose;
object_class->finalize = finalize;
......
......@@ -36,8 +36,6 @@ G_DEFINE_TYPE (NMDeviceVlan, nm_device_vlan, NM_TYPE_DEVICE)
#define NM_DEVICE_VLAN_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DEVICE_VLAN, NMDeviceVlanPrivate))
typedef struct {
DBusGProxy *proxy;
char *hw_address;
gboolean carrier;
guint vlan_id;
......@@ -205,22 +203,11 @@ init_dbus (NMObject *object)
NM_OBJECT_CLASS (nm_device_vlan_parent_class)->init_dbus (object);
priv->proxy = _nm_object_new_proxy (object, NULL, NM_DBUS_INTERFACE_DEVICE_VLAN);
_nm_object_register_properties (object,
priv->proxy,
NM_DBUS_INTERFACE_DEVICE_VLAN,
property_info);
}
static void
dispose (GObject *object)
{
NMDeviceVlanPrivate *priv = NM_DEVICE_VLAN_GET_PRIVATE (object);
g_clear_object (&priv->proxy);
G_OBJECT_CLASS (nm_device_vlan_parent_class)->dispose (object);
}
static void
finalize (GObject *object)
{
......@@ -264,8 +251,9 @@ nm_device_vlan_class_init (NMDeviceVlanClass *vlan_class)
g_type_class_add_private (vlan_class, sizeof (NMDeviceVlanPrivate));
_nm_object_class_add_interface (nm_object_class, NM_DBUS_INTERFACE_DEVICE_VLAN);
/* virtual methods */
object_class->dispose = dispose;
object_class->finalize = finalize;
object_class->get_property = get_property;
......
......@@ -594,9 +594,9 @@ init_dbus (NMObject *object)
NM_OBJECT_CLASS (nm_device_wifi_parent_class)->init_dbus (object);
priv->proxy = _nm_object_new_proxy (object, NULL, NM_DBUS_INTERFACE_DEVICE_WIRELESS);
priv->proxy = _nm_object_get_proxy (object, NM_DBUS_INTERFACE_DEVICE_WIRELESS);
_nm_object_register_properties (object,
priv->proxy,
NM_DBUS_INTERFACE_DEVICE_WIRELESS,
property_info);
}
......@@ -638,7 +638,6 @@ dispose (GObject *object)
if (priv->aps)
clean_up_aps (NM_DEVICE_WIFI (object), TRUE);
g_clear_object (&priv->proxy);
G_OBJECT_CLASS (nm_device_wifi_parent_class)->dispose (object);
}
......@@ -663,6 +662,8 @@ nm_device_wifi_class_init (NMDeviceWifiClass *wifi_class)
g_type_class_add_private (wifi_class, sizeof (NMDeviceWifiPrivate));
_nm_object_class_add_interface (nm_object_class, NM_DBUS_INTERFACE_DEVICE_WIRELESS);
/* virtual methods */
object_class->get_property = get_property;
object_class->dispose = dispose;
......
......@@ -43,8 +43,6 @@ void _nm_device_wimax_set_wireless_enabled (NMDeviceWimax *wimax, gboolean enabl
static void state_changed_cb (NMDevice *device, GParamSpec *pspec, gpointer user_data);
typedef struct {
DBusGProxy *proxy;
char *hw_address;
NMWimaxNsp *active_nsp;
GPtrArray *nsps;
......@@ -495,9 +493,8 @@ init_dbus (NMObject *object)
NM_OBJECT_CLASS (nm_device_wimax_parent_class)->init_dbus (object);
priv->proxy = _nm_object_new_proxy (object, NULL, NM_DBUS_INTERFACE_DEVICE_WIMAX);
_nm_object_register_properties (object,
priv->proxy,
NM_DBUS_INTERFACE_DEVICE_WIMAX,
property_info);
}
......@@ -530,7 +527,6 @@ dispose (GObject *object)
if (priv->nsps)
clean_up_nsps (NM_DEVICE_WIMAX (object));
g_clear_object (&priv->proxy);
G_OBJECT_CLASS (nm_device_wimax_parent_class)->dispose (object);
}
......@@ -544,6 +540,8 @@ nm_device_wimax_class_init (NMDeviceWimaxClass *wimax_class)
g_type_class_add_private (wimax_class, sizeof (NMDeviceWimaxPrivate));
_nm_object_class_add_interface (nm_object_class, NM_DBUS_INTERFACE_DEVICE_WIMAX);
/* virtual methods */
object_class->get_property = get_property;
object_class->dispose = dispose;
......
......@@ -222,9 +222,9 @@ init_dbus (NMObject *object)
NM_OBJECT_CLASS (nm_device_parent_class)->init_dbus (object);
priv->proxy = _nm_object_new_proxy (object, NULL, NM_DBUS_INTERFACE_DEVICE);
priv->proxy = _nm_object_get_proxy (object, NM_DBUS_INTERFACE_DEVICE);
_nm_object_register_properties (object,
priv->proxy,
NM_DBUS_INTERFACE_DEVICE,
property_info);
dbus_g_object_register_marshaller (g_cclosure_marshal_generic,
......@@ -367,7 +367,6 @@ dispose (GObject *object)
{
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (object);
g_clear_object (&priv->proxy);
g_clear_object (&priv->ip4_config);
g_clear_object (&priv->dhcp4_config);
g_clear_object (&priv->ip6_config);
......@@ -521,6 +520,8 @@ nm_device_class_init (NMDeviceClass *device_class)
g_type_class_add_private (device_class, sizeof (NMDevicePrivate));
_nm_object_class_add_interface (nm_object_class, NM_DBUS_INTERFACE_DEVICE);
/* virtual methods */
object_class->constructed = constructed;
object_class->get_property = get_property;
......
......@@ -31,8 +31,6 @@ G_DEFINE_TYPE (NMDhcp4Config, nm_dhcp4_config, NM_TYPE_OBJECT)
#define NM_DHCP4_CONFIG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DHCP4_CONFIG, NMDhcp4ConfigPrivate))
typedef struct {
DBusGProxy *proxy;
GHashTable *options;
} NMDhcp4ConfigPrivate;
......@@ -84,9 +82,8 @@ init_dbus (NMObject *object)
NM_OBJECT_CLASS (nm_dhcp4_config_parent_class)->init_dbus (object);
priv->proxy = _nm_object_new_proxy (object, NULL, NM_DBUS_INTERFACE_DHCP4_CONFIG);
_nm_object_register_properties (object,
priv->proxy,
NM_DBUS_INTERFACE_DHCP4_CONFIG,
property_info);
}
......@@ -98,8 +95,6 @@ finalize (GObject *object)
if (priv->options)
g_hash_table_destroy (priv->options);
g_object_unref (priv->proxy);
G_OBJECT_CLASS (nm_dhcp4_config_parent_class)->finalize (object);
}
......@@ -129,6 +124,8 @@ nm_dhcp4_config_class_init (NMDhcp4ConfigClass *config_class)
g_type_class_add_private (config_class, sizeof (NMDhcp4ConfigPrivate));
_nm_object_class_add_interface (nm_object_class, NM_DBUS_INTERFACE_DHCP4_CONFIG);
/* virtual methods */
object_class->get_property = get_property;
object_class->finalize = finalize;
......
......@@ -31,8 +31,6 @@ G_DEFINE_TYPE (NMDhcp6Config, nm_dhcp6_config, NM_TYPE_OBJECT)
#define NM_DHCP6_CONFIG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_DHCP6_CONFIG, NMDhcp6ConfigPrivate))
typedef struct {
DBusGProxy *proxy;
GHashTable *options;
} NMDhcp6ConfigPrivate;
......@@ -84,9 +82,8 @@ init_dbus (NMObject *object)
NM_OBJECT_CLASS (nm_dhcp6_config_parent_class)->init_dbus (object);
priv->proxy = _nm_object_new_proxy (object, NULL, NM_DBUS_INTERFACE_DHCP6_CONFIG);
_nm_object_register_properties (object,
priv->proxy,
NM_DBUS_INTERFACE_DHCP6_CONFIG,
property_info);
}
......@@ -98,8 +95,6 @@ finalize (GObject *object)
if (priv->options)
g_hash_table_destroy (priv->options);
g_object_unref (priv->proxy);
G_OBJECT_CLASS (nm_dhcp6_config_parent_class)->finalize (object);
}
......@@ -129,6 +124,8 @@ nm_dhcp6_config_class_init (NMDhcp6ConfigClass *config_class)
g_type_class_add_private (config_class, sizeof (NMDhcp6ConfigPrivate));
_nm_object_class_add_interface (nm_object_class, NM_DBUS_INTERFACE_DHCP6_CONFIG);
/* virtual methods */
object_class->get_property =