Commit a0e9a4bd authored by Dan Winship's avatar Dan Winship

libnm: remove _new functions from NMObject subclasses

Most NMObjects should not be manually created, they should only be
received from NMClient or NMRemoteSettings.
parent 2fc55941
......@@ -15,7 +15,6 @@ global:
nm_access_point_get_strength;
nm_access_point_get_type;
nm_access_point_get_wpa_flags;
nm_access_point_new;
nm_active_connection_get_connection;
nm_active_connection_get_connection_type;
nm_active_connection_get_default6;
......@@ -32,7 +31,6 @@ global:
nm_active_connection_get_type;
nm_active_connection_get_uuid;
nm_active_connection_get_vpn;
nm_active_connection_new;
nm_active_connection_state_get_type;
nm_bluetooth_capabilities_get_type;
nm_client_activate_connection;
......@@ -140,28 +138,24 @@ global:
nm_device_adsl_error_quark;
nm_device_adsl_get_carrier;
nm_device_adsl_get_type;
nm_device_adsl_new;
nm_device_bond_error_get_type;
nm_device_bond_error_quark;
nm_device_bond_get_carrier;
nm_device_bond_get_hw_address;
nm_device_bond_get_slaves;
nm_device_bond_get_type;
nm_device_bond_new;
nm_device_bridge_error_get_type;
nm_device_bridge_error_quark;
nm_device_bridge_get_carrier;
nm_device_bridge_get_hw_address;
nm_device_bridge_get_slaves;
nm_device_bridge_get_type;
nm_device_bridge_new;
nm_device_bt_error_get_type;
nm_device_bt_error_quark;
nm_device_bt_get_capabilities;
nm_device_bt_get_hw_address;
nm_device_bt_get_name;
nm_device_bt_get_type;
nm_device_bt_new;
nm_device_capabilities_get_type;
nm_device_connection_compatible;
nm_device_connection_valid;
......@@ -177,13 +171,11 @@ global:
nm_device_ethernet_get_permanent_hw_address;
nm_device_ethernet_get_speed;
nm_device_ethernet_get_type;
nm_device_ethernet_new;
nm_device_filter_connections;
nm_device_generic_error_get_type;
nm_device_generic_error_quark;
nm_device_generic_get_hw_address;
nm_device_generic_get_type;
nm_device_generic_new;
nm_device_get_active_connection;
nm_device_get_autoconnect;
nm_device_get_available_connections;
......@@ -217,7 +209,6 @@ global:
nm_device_infiniband_get_carrier;
nm_device_infiniband_get_hw_address;
nm_device_infiniband_get_type;
nm_device_infiniband_new;
nm_device_is_software;
nm_device_modem_capabilities_get_type;
nm_device_modem_error_get_type;
......@@ -225,14 +216,12 @@ global:
nm_device_modem_get_current_capabilities;
nm_device_modem_get_modem_capabilities;
nm_device_modem_get_type;
nm_device_new;
nm_device_olpc_mesh_error_get_type;
nm_device_olpc_mesh_error_quark;
nm_device_olpc_mesh_get_active_channel;
nm_device_olpc_mesh_get_companion;
nm_device_olpc_mesh_get_hw_address;
nm_device_olpc_mesh_get_type;
nm_device_olpc_mesh_new;
nm_device_set_autoconnect;
nm_device_state_get_type;
nm_device_state_reason_get_type;
......@@ -242,7 +231,6 @@ global:
nm_device_team_get_hw_address;
nm_device_team_get_slaves;
nm_device_team_get_type;
nm_device_team_new;
nm_device_type_get_type;
nm_device_vlan_error_get_type;
nm_device_vlan_error_quark;
......@@ -250,7 +238,6 @@ global:
nm_device_vlan_get_hw_address;
nm_device_vlan_get_type;
nm_device_vlan_get_vlan_id;
nm_device_vlan_new;
nm_device_wifi_capabilities_get_type;
nm_device_wifi_error_get_type;
nm_device_wifi_error_quark;
......@@ -263,7 +250,6 @@ global:
nm_device_wifi_get_mode;
nm_device_wifi_get_permanent_hw_address;
nm_device_wifi_get_type;
nm_device_wifi_new;
nm_device_wifi_request_scan_simple;
nm_device_wimax_error_get_type;
nm_device_wimax_error_quark;
......@@ -277,15 +263,12 @@ global:
nm_device_wimax_get_rssi;
nm_device_wimax_get_tx_power;
nm_device_wimax_get_type;
nm_device_wimax_new;
nm_dhcp4_config_get_one_option;
nm_dhcp4_config_get_options;
nm_dhcp4_config_get_type;
nm_dhcp4_config_new;
nm_dhcp6_config_get_one_option;
nm_dhcp6_config_get_options;
nm_dhcp6_config_get_type;
nm_dhcp6_config_new;
nm_ip4_address_compare;
nm_ip4_address_dup;
nm_ip4_address_get_address;
......@@ -306,7 +289,6 @@ global:
nm_ip4_config_get_searches;
nm_ip4_config_get_type;
nm_ip4_config_get_wins_servers;
nm_ip4_config_new;
nm_ip4_route_compare;
nm_ip4_route_dup;
nm_ip4_route_get_dest;
......@@ -344,7 +326,6 @@ global:
nm_ip6_config_get_routes;
nm_ip6_config_get_searches;
nm_ip6_config_get_type;
nm_ip6_config_new;
nm_ip6_route_compare;
nm_ip6_route_dup;
nm_ip6_route_get_dest;
......@@ -374,7 +355,6 @@ global:
nm_remote_connection_get_secrets;
nm_remote_connection_get_type;
nm_remote_connection_get_unsaved;
nm_remote_connection_new;
nm_remote_connection_save;
nm_remote_settings_add_connection;
nm_remote_settings_add_connection_unsaved;
......@@ -946,7 +926,6 @@ global:
nm_vpn_connection_get_banner;
nm_vpn_connection_get_type;
nm_vpn_connection_get_vpn_state;
nm_vpn_connection_new;
nm_vpn_connection_state_get_type;
nm_vpn_connection_state_reason_get_type;
nm_vpn_plugin_failure_get_type;
......@@ -959,7 +938,6 @@ global:
nm_wimax_nsp_get_signal_quality;
nm_wimax_nsp_get_type;
nm_wimax_nsp_network_type_get_type;
nm_wimax_nsp_new;
local:
*;
};
......@@ -70,27 +70,6 @@ enum {
LAST_PROP
};
/**
* nm_access_point_new:
* @connection: the #DBusGConnection
* @path: the DBusobject path of the access point
*
* Creates a new #NMAccessPoint.
*
* Returns: (transfer full): a new access point
**/
GObject *
nm_access_point_new (DBusGConnection *connection, const char *path)
{
g_return_val_if_fail (connection != NULL, NULL);
g_return_val_if_fail (path != NULL, NULL);
return (GObject *) g_object_new (NM_TYPE_ACCESS_POINT,
NM_OBJECT_DBUS_CONNECTION, connection,
NM_OBJECT_DBUS_PATH, path,
NULL);
}
/**
* nm_access_point_get_flags:
* @ap: a #NMAccessPoint
......
......@@ -64,8 +64,6 @@ typedef struct {
GType nm_access_point_get_type (void);
GObject *nm_access_point_new (DBusGConnection *connection, const char *path);
NM80211ApFlags nm_access_point_get_flags (NMAccessPoint *ap);
NM80211ApSecurityFlags nm_access_point_get_wpa_flags (NMAccessPoint *ap);
NM80211ApSecurityFlags nm_access_point_get_rsn_flags (NMAccessPoint *ap);
......
......@@ -88,27 +88,6 @@ enum {
LAST_PROP
};
/**
* nm_active_connection_new:
* @connection: the #DBusGConnection
* @path: the DBus object path of the device
*
* Creates a new #NMActiveConnection.
*
* Returns: (transfer full): a new active connection
**/
GObject *
nm_active_connection_new (DBusGConnection *connection, const char *path)
{
g_return_val_if_fail (connection != NULL, NULL);
g_return_val_if_fail (path != NULL, NULL);
return g_object_new (NM_TYPE_ACTIVE_CONNECTION,
NM_OBJECT_DBUS_CONNECTION, connection,
NM_OBJECT_DBUS_PATH, path,
NULL);
}
static GType
_nm_active_connection_type_for_path (DBusGConnection *connection,
const char *path)
......
......@@ -70,8 +70,6 @@ typedef struct {
GType nm_active_connection_get_type (void);
GObject *nm_active_connection_new (DBusGConnection *connection, const char *path);
const char * nm_active_connection_get_connection (NMActiveConnection *connection);
const char * nm_active_connection_get_id (NMActiveConnection *connection);
const char * nm_active_connection_get_uuid (NMActiveConnection *connection);
......
......@@ -62,31 +62,6 @@ nm_device_adsl_error_quark (void)
return quark;
}
/**
* nm_device_adsl_new:
* @connection: the #DBusGConnection
* @path: the DBus object path of the device
*
* Creates a new #NMDeviceAdsl.
*
* Returns: (transfer full): a new device
**/
GObject *
nm_device_adsl_new (DBusGConnection *connection, const char *path)
{
GObject *device;
g_return_val_if_fail (connection != NULL, NULL);
g_return_val_if_fail (path != NULL, NULL);
device = g_object_new (NM_TYPE_DEVICE_ADSL,
NM_OBJECT_DBUS_CONNECTION, connection,
NM_OBJECT_DBUS_PATH, path,
NULL);
_nm_object_ensure_inited (NM_OBJECT (device));
return device;
}
/**
* nm_device_adsl_get_carrier:
* @device: a #NMDeviceAdsl
......
......@@ -62,7 +62,6 @@ typedef struct {
GType nm_device_adsl_get_type (void);
GObject *nm_device_adsl_new (DBusGConnection *connection, const char *path);
gboolean nm_device_adsl_get_carrier (NMDeviceAdsl *device);
G_END_DECLS
......
......@@ -71,31 +71,6 @@ nm_device_bond_error_quark (void)
return quark;
}
/**
* nm_device_bond_new:
* @connection: the #DBusGConnection
* @path: the DBus object path of the device
*
* Creates a new #NMDeviceBond.
*
* Returns: (transfer full): a new device
**/
GObject *
nm_device_bond_new (DBusGConnection *connection, const char *path)
{
GObject *device;
g_return_val_if_fail (connection != NULL, NULL);
g_return_val_if_fail (path != NULL, NULL);
device = g_object_new (NM_TYPE_DEVICE_BOND,
NM_OBJECT_DBUS_CONNECTION, connection,
NM_OBJECT_DBUS_PATH, path,
NULL);
_nm_object_ensure_inited (NM_OBJECT (device));
return device;
}
/**
* nm_device_bond_get_hw_address:
* @device: a #NMDeviceBond
......
......@@ -66,8 +66,6 @@ typedef struct {
GType nm_device_bond_get_type (void);
GObject *nm_device_bond_new (DBusGConnection *connection, const char *path);
const char *nm_device_bond_get_hw_address (NMDeviceBond *device);
gboolean nm_device_bond_get_carrier (NMDeviceBond *device);
const GPtrArray *nm_device_bond_get_slaves (NMDeviceBond *device);
......
......@@ -71,31 +71,6 @@ nm_device_bridge_error_quark (void)
return quark;
}
/**
* nm_device_bridge_new:
* @connection: the #DBusGConnection
* @path: the DBus object path of the device
*
* Creates a new #NMDeviceBridge.
*
* Returns: (transfer full): a new device
**/
GObject *
nm_device_bridge_new (DBusGConnection *connection, const char *path)
{
GObject *device;
g_return_val_if_fail (connection != NULL, NULL);
g_return_val_if_fail (path != NULL, NULL);
device = g_object_new (NM_TYPE_DEVICE_BRIDGE,
NM_OBJECT_DBUS_CONNECTION, connection,
NM_OBJECT_DBUS_PATH, path,
NULL);
_nm_object_ensure_inited (NM_OBJECT (device));
return device;
}
/**
* nm_device_bridge_get_hw_address:
* @device: a #NMDeviceBridge
......
......@@ -70,27 +70,6 @@ nm_device_bt_error_quark (void)
return quark;
}
/**
* nm_device_bt_new:
* @connection: the #DBusGConnection
* @path: the DBus object path of the device
*
* Creates a new #NMDeviceBt.
*
* Returns: (transfer full): a new device
**/
GObject *
nm_device_bt_new (DBusGConnection *connection, const char *path)
{
g_return_val_if_fail (connection != NULL, NULL);
g_return_val_if_fail (path != NULL, NULL);
return g_object_new (NM_TYPE_DEVICE_BT,
NM_OBJECT_DBUS_CONNECTION, connection,
NM_OBJECT_DBUS_PATH, path,
NULL);
}
/**
* nm_device_bt_get_hw_address:
* @device: a #NMDeviceBt
......
......@@ -72,8 +72,6 @@ typedef struct {
GType nm_device_bt_get_type (void);
GObject *nm_device_bt_new (DBusGConnection *connection, const char *path);
const char *nm_device_bt_get_hw_address (NMDeviceBt *device);
const char *nm_device_bt_get_name (NMDeviceBt *device);
......
......@@ -73,31 +73,6 @@ nm_device_ethernet_error_quark (void)
return quark;
}
/**
* nm_device_ethernet_new:
* @connection: the #DBusGConnection
* @path: the DBus object path of the device
*
* Creates a new #NMDeviceEthernet.
*
* Returns: (transfer full): a new device
**/
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);
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;
}
/**
* nm_device_ethernet_get_hw_address:
* @device: a #NMDeviceEthernet
......
......@@ -70,8 +70,6 @@ typedef struct {
GType nm_device_ethernet_get_type (void);
GObject *nm_device_ethernet_new (DBusGConnection *connection, const char *path);
const char * nm_device_ethernet_get_hw_address (NMDeviceEthernet *device);
const char * nm_device_ethernet_get_permanent_hw_address (NMDeviceEthernet *device);
guint32 nm_device_ethernet_get_speed (NMDeviceEthernet *device);
......
......@@ -63,31 +63,6 @@ nm_device_generic_error_quark (void)
return quark;
}
/**
* nm_device_generic_new:
* @connection: the #DBusGConnection
* @path: the DBus object path of the device
*
* Creates a new #NMDeviceGeneric.
*
* Returns: (transfer full): a new device
**/
GObject *
nm_device_generic_new (DBusGConnection *connection, const char *path)
{
GObject *device;
g_return_val_if_fail (connection != NULL, NULL);
g_return_val_if_fail (path != NULL, NULL);
device = g_object_new (NM_TYPE_DEVICE_GENERIC,
NM_OBJECT_DBUS_CONNECTION, connection,
NM_OBJECT_DBUS_PATH, path,
NULL);
_nm_object_ensure_inited (NM_OBJECT (device));
return device;
}
/**
* nm_device_generic_get_hw_address:
* @device: a #NMDeviceGeneric
......
......@@ -63,8 +63,6 @@ typedef struct {
GType nm_device_generic_get_type (void);
GObject *nm_device_generic_new (DBusGConnection *connection, const char *path);
const char *nm_device_generic_get_hw_address (NMDeviceGeneric *device);
G_END_DECLS
......
......@@ -69,31 +69,6 @@ nm_device_infiniband_error_quark (void)
return quark;
}
/**
* nm_device_infiniband_new:
* @connection: the #DBusGConnection
* @path: the DBus object path of the device
*
* Creates a new #NMDeviceInfiniband.
*
* Returns: (transfer full): a new device
**/
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);
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;
}
/**
* nm_device_infiniband_get_hw_address:
* @device: a #NMDeviceInfiniband
......
......@@ -67,8 +67,6 @@ typedef struct {
GType nm_device_infiniband_get_type (void);
GObject *nm_device_infiniband_new (DBusGConnection *connection, const char *path);
const char * nm_device_infiniband_get_hw_address (NMDeviceInfiniband *device);
gboolean nm_device_infiniband_get_carrier (NMDeviceInfiniband *device);
......
......@@ -69,32 +69,6 @@ nm_device_olpc_mesh_error_quark (void)
return quark;
}
/**
* nm_device_olpc_mesh_new:
* @connection: the #DBusGConnection
* @path: the DBus object path of the device
*
* Creates a new #NMDeviceOlpcMesh.
*
* Returns: (transfer full): a new OlpcMesh device
**/
GObject *
nm_device_olpc_mesh_new (DBusGConnection *connection, const char *path)
{
GObject *device;
g_return_val_if_fail (connection != NULL, NULL);
g_return_val_if_fail (path != NULL, NULL);
device = g_object_new (NM_TYPE_DEVICE_OLPC_MESH,
NM_OBJECT_DBUS_CONNECTION, connection,
NM_OBJECT_DBUS_PATH, path,
NULL);
_nm_object_ensure_inited (NM_OBJECT (device));
return device;
}
/**
* nm_device_olpc_mesh_get_hw_address:
* @device: a #NMDeviceOlpcMesh
......
......@@ -65,8 +65,6 @@ typedef struct {
GType nm_device_olpc_mesh_get_type (void);
GObject *nm_device_olpc_mesh_new (DBusGConnection *connection, const char *path);
const char *nm_device_olpc_mesh_get_hw_address (NMDeviceOlpcMesh *device);
NMDeviceWifi *nm_device_olpc_mesh_get_companion (NMDeviceOlpcMesh *device);
guint32 nm_device_olpc_mesh_get_active_channel (NMDeviceOlpcMesh *device);
......
......@@ -71,31 +71,6 @@ nm_device_team_error_quark (void)
return quark;
}
/**
* nm_device_team_new:
* @connection: the #DBusGConnection
* @path: the DBus object path of the device
*
* Creates a new #NMDeviceTeam.
*
* Returns: (transfer full): a new device
**/
GObject *
nm_device_team_new (DBusGConnection *connection, const char *path)
{
GObject *device;
g_return_val_if_fail (connection != NULL, NULL);
g_return_val_if_fail (path != NULL, NULL);
device = g_object_new (NM_TYPE_DEVICE_TEAM,
NM_OBJECT_DBUS_CONNECTION, connection,
NM_OBJECT_DBUS_PATH, path,
NULL);
_nm_object_ensure_inited (NM_OBJECT (device));
return device;
}
/**
* nm_device_team_get_hw_address:
* @device: a #NMDeviceTeam
......
......@@ -66,8 +66,6 @@ typedef struct {
GType nm_device_team_get_type (void);
GObject *nm_device_team_new (DBusGConnection *connection, const char *path);
const char *nm_device_team_get_hw_address (NMDeviceTeam *device);
gboolean nm_device_team_get_carrier (NMDeviceTeam *device);
const GPtrArray *nm_device_team_get_slaves (NMDeviceTeam *device);
......
......@@ -70,31 +70,6 @@ nm_device_vlan_error_quark (void)
return quark;
}
/**
* nm_device_vlan_new:
* @connection: the #DBusGConnection
* @path: the DBus object path of the device
*
* Creates a new #NMDeviceVlan.
*
* Returns: (transfer full): a new device
**/
GObject *
nm_device_vlan_new (DBusGConnection *connection, const char *path)
{
GObject *device;
g_return_val_if_fail (connection != NULL, NULL);
g_return_val_if_fail (path != NULL, NULL);
device = g_object_new (NM_TYPE_DEVICE_VLAN,
NM_OBJECT_DBUS_CONNECTION, connection,
NM_OBJECT_DBUS_PATH, path,
NULL);
_nm_object_ensure_inited (NM_OBJECT (device));
return device;
}
/**
* nm_device_vlan_get_hw_address:
* @device: a #NMDeviceVlan
......
......@@ -70,8 +70,6 @@ typedef struct {
GType nm_device_vlan_get_type (void);
GObject *nm_device_vlan_new (DBusGConnection *connection, const char *path);
const char * nm_device_vlan_get_hw_address (NMDeviceVlan *device);
gboolean nm_device_vlan_get_carrier (NMDeviceVlan *device);
guint nm_device_vlan_get_vlan_id (NMDeviceVlan *device);
......
......@@ -101,31 +101,6 @@ nm_device_wifi_error_quark (void)
return quark;
}
/**
* nm_device_wifi_new:
* @connection: the #DBusGConnection
* @path: the DBus object path of the device
*
* Creates a new #NMDeviceWifi.
*
* Returns: (transfer full): a new Wi-Fi device
**/
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);
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;
}
/**
* nm_device_wifi_get_hw_address:
* @device: a #NMDeviceWifi
......
......@@ -84,8 +84,6 @@ typedef struct {
GType nm_device_wifi_get_type (void);
GObject *nm_device_wifi_new (DBusGConnection *connection, const char *path);
const char * nm_device_wifi_get_hw_address (NMDeviceWifi *device);
const char * nm_device_wifi_get_permanent_hw_address (NMDeviceWifi *device);
NM80211Mode nm_device_wifi_get_mode (NMDeviceWifi *device);
......
......@@ -94,31 +94,6 @@ nm_device_wimax_error_quark (void)
return quark;
}
/**
* nm_device_wimax_new:
* @connection: the #DBusGConnection
* @path: the D-Bus object path of the WiMAX device
*
* Creates a new #NMDeviceWimax.
*
* Returns: (transfer full): a new WiMAX device
**/
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);
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;
}
/**
* nm_device_wimax_get_hw_address:
* @wimax: a #NMDeviceWimax
......
......@@ -79,9 +79,6 @@ typedef struct {
GType nm_device_wimax_get_type (void);
GObject *nm_device_wimax_new (DBusGConnection *connection,
const char *path);
const char *nm_device_wimax_get_hw_address (NMDeviceWimax *wimax);
NMWimaxNsp *nm_device_wimax_get_active_nsp (NMDeviceWimax *wimax);
NMWimaxNsp *nm_device_wimax_get_nsp_by_path (NMDeviceWimax *wimax,
......
......@@ -900,36 +900,6 @@ _nm_device_type_for_path (DBusGConnection *connection,
return _nm_device_gtype_from_dtype (nm_dtype);
}
/**
* nm_device_new:
* @connection: the #DBusGConnection
* @path: the DBus object path of the device
*
* Creates a new #NMDevice.
*
* Returns: (transfer full): a new device
**/
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);
dtype = _nm_device_type_for_path (connection, path);
if (dtype == G_TYPE_INVALID)