From a0e9a4bd45f25548f1fe580ddaf96ca6ff567721 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Fri, 9 May 2014 15:14:37 -0400 Subject: libnm: remove _new functions from NMObject subclasses Most NMObjects should not be manually created, they should only be received from NMClient or NMRemoteSettings. --- libnm/libnm.ver | 22 ---------------------- libnm/nm-access-point.c | 21 --------------------- libnm/nm-access-point.h | 2 -- libnm/nm-active-connection.c | 21 --------------------- libnm/nm-active-connection.h | 2 -- libnm/nm-device-adsl.c | 25 ------------------------- libnm/nm-device-adsl.h | 1 - libnm/nm-device-bond.c | 25 ------------------------- libnm/nm-device-bond.h | 2 -- libnm/nm-device-bridge.c | 25 ------------------------- libnm/nm-device-bt.c | 21 --------------------- libnm/nm-device-bt.h | 2 -- libnm/nm-device-ethernet.c | 25 ------------------------- libnm/nm-device-ethernet.h | 2 -- libnm/nm-device-generic.c | 25 ------------------------- libnm/nm-device-generic.h | 2 -- libnm/nm-device-infiniband.c | 25 ------------------------- libnm/nm-device-infiniband.h | 2 -- libnm/nm-device-olpc-mesh.c | 26 -------------------------- libnm/nm-device-olpc-mesh.h | 2 -- libnm/nm-device-team.c | 25 ------------------------- libnm/nm-device-team.h | 2 -- libnm/nm-device-vlan.c | 25 ------------------------- libnm/nm-device-vlan.h | 2 -- libnm/nm-device-wifi.c | 25 ------------------------- libnm/nm-device-wifi.h | 2 -- libnm/nm-device-wimax.c | 25 ------------------------- libnm/nm-device-wimax.h | 3 --- libnm/nm-device.c | 30 ------------------------------ libnm/nm-device.h | 2 -- libnm/nm-dhcp4-config.c | 18 ------------------ libnm/nm-dhcp4-config.h | 2 -- libnm/nm-dhcp6-config.c | 18 ------------------ libnm/nm-dhcp6-config.h | 2 -- libnm/nm-ip4-config.c | 18 ------------------ libnm/nm-ip4-config.h | 2 -- libnm/nm-ip6-config.c | 18 ------------------ libnm/nm-ip6-config.h | 2 -- libnm/nm-remote-connection.c | 23 ----------------------- libnm/nm-remote-connection.h | 4 +--- libnm/nm-remote-settings.c | 5 ++++- libnm/nm-vpn-connection.c | 21 --------------------- libnm/nm-vpn-connection.h | 2 -- libnm/nm-wimax-nsp.c | 21 --------------------- libnm/nm-wimax-nsp.h | 2 -- 45 files changed, 5 insertions(+), 572 deletions(-) diff --git a/libnm/libnm.ver b/libnm/libnm.ver index f18bbccb2a..2e3d0db250 100644 --- a/libnm/libnm.ver +++ b/libnm/libnm.ver @@ -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: *; }; diff --git a/libnm/nm-access-point.c b/libnm/nm-access-point.c index bd02fb584e..86c8def3ea 100644 --- a/libnm/nm-access-point.c +++ b/libnm/nm-access-point.c @@ -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 diff --git a/libnm/nm-access-point.h b/libnm/nm-access-point.h index f483cb33e3..cc1e8f95ff 100644 --- a/libnm/nm-access-point.h +++ b/libnm/nm-access-point.h @@ -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); diff --git a/libnm/nm-active-connection.c b/libnm/nm-active-connection.c index b1a06a4abd..a694f28706 100644 --- a/libnm/nm-active-connection.c +++ b/libnm/nm-active-connection.c @@ -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) diff --git a/libnm/nm-active-connection.h b/libnm/nm-active-connection.h index 3c389d8492..49b5d183d1 100644 --- a/libnm/nm-active-connection.h +++ b/libnm/nm-active-connection.h @@ -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); diff --git a/libnm/nm-device-adsl.c b/libnm/nm-device-adsl.c index eb54957413..22ce1d2b9c 100644 --- a/libnm/nm-device-adsl.c +++ b/libnm/nm-device-adsl.c @@ -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 diff --git a/libnm/nm-device-adsl.h b/libnm/nm-device-adsl.h index 109c667e7b..34ec822e71 100644 --- a/libnm/nm-device-adsl.h +++ b/libnm/nm-device-adsl.h @@ -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 diff --git a/libnm/nm-device-bond.c b/libnm/nm-device-bond.c index 113aac0dd4..d609a9b32c 100644 --- a/libnm/nm-device-bond.c +++ b/libnm/nm-device-bond.c @@ -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 diff --git a/libnm/nm-device-bond.h b/libnm/nm-device-bond.h index 8893430103..0655c31f59 100644 --- a/libnm/nm-device-bond.h +++ b/libnm/nm-device-bond.h @@ -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); diff --git a/libnm/nm-device-bridge.c b/libnm/nm-device-bridge.c index c651be0d71..c3d096e8c0 100644 --- a/libnm/nm-device-bridge.c +++ b/libnm/nm-device-bridge.c @@ -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 diff --git a/libnm/nm-device-bt.c b/libnm/nm-device-bt.c index 00616a95a8..74117fb98b 100644 --- a/libnm/nm-device-bt.c +++ b/libnm/nm-device-bt.c @@ -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 diff --git a/libnm/nm-device-bt.h b/libnm/nm-device-bt.h index 6ed7b55ba6..631cec8d7b 100644 --- a/libnm/nm-device-bt.h +++ b/libnm/nm-device-bt.h @@ -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); diff --git a/libnm/nm-device-ethernet.c b/libnm/nm-device-ethernet.c index 690041a515..1ecdd7481e 100644 --- a/libnm/nm-device-ethernet.c +++ b/libnm/nm-device-ethernet.c @@ -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 diff --git a/libnm/nm-device-ethernet.h b/libnm/nm-device-ethernet.h index 5fcff108e9..d1ce3ce46c 100644 --- a/libnm/nm-device-ethernet.h +++ b/libnm/nm-device-ethernet.h @@ -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); diff --git a/libnm/nm-device-generic.c b/libnm/nm-device-generic.c index 7bf54d16db..81b21b1cc0 100644 --- a/libnm/nm-device-generic.c +++ b/libnm/nm-device-generic.c @@ -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 diff --git a/libnm/nm-device-generic.h b/libnm/nm-device-generic.h index 7d4b28a26f..96899ee712 100644 --- a/libnm/nm-device-generic.h +++ b/libnm/nm-device-generic.h @@ -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 diff --git a/libnm/nm-device-infiniband.c b/libnm/nm-device-infiniband.c index d740ed006e..bfdf753b9a 100644 --- a/libnm/nm-device-infiniband.c +++ b/libnm/nm-device-infiniband.c @@ -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 diff --git a/libnm/nm-device-infiniband.h b/libnm/nm-device-infiniband.h index 9c131380b9..22b9b7a72b 100644 --- a/libnm/nm-device-infiniband.h +++ b/libnm/nm-device-infiniband.h @@ -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); diff --git a/libnm/nm-device-olpc-mesh.c b/libnm/nm-device-olpc-mesh.c index 666ddc2636..b51d656a3a 100644 --- a/libnm/nm-device-olpc-mesh.c +++ b/libnm/nm-device-olpc-mesh.c @@ -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 diff --git a/libnm/nm-device-olpc-mesh.h b/libnm/nm-device-olpc-mesh.h index d24468f8b2..1b12b46ffc 100644 --- a/libnm/nm-device-olpc-mesh.h +++ b/libnm/nm-device-olpc-mesh.h @@ -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); diff --git a/libnm/nm-device-team.c b/libnm/nm-device-team.c index a131992f97..f1682e2786 100644 --- a/libnm/nm-device-team.c +++ b/libnm/nm-device-team.c @@ -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 diff --git a/libnm/nm-device-team.h b/libnm/nm-device-team.h index e88ab89057..2c63c8743f 100644 --- a/libnm/nm-device-team.h +++ b/libnm/nm-device-team.h @@ -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); diff --git a/libnm/nm-device-vlan.c b/libnm/nm-device-vlan.c index 8df3025ebb..9f44370bb2 100644 --- a/libnm/nm-device-vlan.c +++ b/libnm/nm-device-vlan.c @@ -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 diff --git a/libnm/nm-device-vlan.h b/libnm/nm-device-vlan.h index e4a7ac2b46..628a6d5cfe 100644 --- a/libnm/nm-device-vlan.h +++ b/libnm/nm-device-vlan.h @@ -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); diff --git a/libnm/nm-device-wifi.c b/libnm/nm-device-wifi.c index d504700604..f581d06684 100644 --- a/libnm/nm-device-wifi.c +++ b/libnm/nm-device-wifi.c @@ -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 diff --git a/libnm/nm-device-wifi.h b/libnm/nm-device-wifi.h index a57430ace0..651a43c2f9 100644 --- a/libnm/nm-device-wifi.h +++ b/libnm/nm-device-wifi.h @@ -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); diff --git a/libnm/nm-device-wimax.c b/libnm/nm-device-wimax.c index 66c4bbc24e..471c1434f8 100644 --- a/libnm/nm-device-wimax.c +++ b/libnm/nm-device-wimax.c @@ -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 diff --git a/libnm/nm-device-wimax.h b/libnm/nm-device-wimax.h index 0726d81aca..cf368232d2 100644 --- a/libnm/nm-device-wimax.h +++ b/libnm/nm-device-wimax.h @@ -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, diff --git a/libnm/nm-device.c b/libnm/nm-device.c index e65d8e60e4..f83742f190 100644 --- a/libnm/nm-device.c +++ b/libnm/nm-device.c @@ -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) - return 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 { DBusGConnection *connection; NMObjectTypeCallbackFunc callback; diff --git a/libnm/nm-device.h b/libnm/nm-device.h index 8bffd0bb50..d686115053 100644 --- a/libnm/nm-device.h +++ b/libnm/nm-device.h @@ -110,8 +110,6 @@ typedef struct { GType nm_device_get_type (void); -GObject * nm_device_new (DBusGConnection *connection, const char *path); - const char * nm_device_get_iface (NMDevice *device); const char * nm_device_get_ip_iface (NMDevice *device); NMDeviceType nm_device_get_device_type (NMDevice *device); diff --git a/libnm/nm-dhcp4-config.c b/libnm/nm-dhcp4-config.c index 96144b3b08..dc8367942e 100644 --- a/libnm/nm-dhcp4-config.c +++ b/libnm/nm-dhcp4-config.c @@ -160,24 +160,6 @@ nm_dhcp4_config_class_init (NMDhcp4ConfigClass *config_class) G_PARAM_STATIC_STRINGS)); } -/** - * nm_dhcp4_config_new: - * @connection: the #DBusGConnection - * @object_path: the DBus object path of the device - * - * Creates a new #NMDhcp4Config. - * - * Returns: (transfer full): a new configuration - **/ -GObject * -nm_dhcp4_config_new (DBusGConnection *connection, const char *object_path) -{ - return (GObject *) g_object_new (NM_TYPE_DHCP4_CONFIG, - NM_OBJECT_DBUS_CONNECTION, connection, - NM_OBJECT_DBUS_PATH, object_path, - NULL); -} - /** * nm_dhcp4_config_get_options: * @config: a #NMDhcp4Config diff --git a/libnm/nm-dhcp4-config.h b/libnm/nm-dhcp4-config.h index 52eeb6bc66..1055e9e892 100644 --- a/libnm/nm-dhcp4-config.h +++ b/libnm/nm-dhcp4-config.h @@ -50,8 +50,6 @@ typedef struct { GType nm_dhcp4_config_get_type (void); -GObject *nm_dhcp4_config_new (DBusGConnection *connection, const char *object_path); - GHashTable * nm_dhcp4_config_get_options (NMDhcp4Config *config); const char * nm_dhcp4_config_get_one_option (NMDhcp4Config *config, const char *option); diff --git a/libnm/nm-dhcp6-config.c b/libnm/nm-dhcp6-config.c index 2f85186b48..bea41d4e4a 100644 --- a/libnm/nm-dhcp6-config.c +++ b/libnm/nm-dhcp6-config.c @@ -160,24 +160,6 @@ nm_dhcp6_config_class_init (NMDhcp6ConfigClass *config_class) G_PARAM_STATIC_STRINGS)); } -/** - * nm_dhcp6_config_new: - * @connection: the #DBusGConnection - * @object_path: the DBus object path of the device - * - * Creates a new #NMDhcp6Config. - * - * Returns: (transfer full): a new configuration - **/ -GObject * -nm_dhcp6_config_new (DBusGConnection *connection, const char *object_path) -{ - return (GObject *) g_object_new (NM_TYPE_DHCP6_CONFIG, - NM_OBJECT_DBUS_CONNECTION, connection, - NM_OBJECT_DBUS_PATH, object_path, - NULL); -} - /** * nm_dhcp6_config_get_options: * @config: a #NMDhcp6Config diff --git a/libnm/nm-dhcp6-config.h b/libnm/nm-dhcp6-config.h index e9753bcad8..bc08b0aaf5 100644 --- a/libnm/nm-dhcp6-config.h +++ b/libnm/nm-dhcp6-config.h @@ -50,8 +50,6 @@ typedef struct { GType nm_dhcp6_config_get_type (void); -GObject *nm_dhcp6_config_new (DBusGConnection *connection, const char *object_path); - GHashTable * nm_dhcp6_config_get_options (NMDhcp6Config *config); const char * nm_dhcp6_config_get_one_option (NMDhcp6Config *config, const char *option); diff --git a/libnm/nm-ip4-config.c b/libnm/nm-ip4-config.c index 186e4fb43f..205a590438 100644 --- a/libnm/nm-ip4-config.c +++ b/libnm/nm-ip4-config.c @@ -312,24 +312,6 @@ nm_ip4_config_class_init (NMIP4ConfigClass *config_class) G_PARAM_STATIC_STRINGS)); } -/** - * nm_ip4_config_new: - * @connection: the #DBusGConnection - * @object_path: the DBus object path of the device - * - * Creates a new #NMIP4Config. - * - * Returns: (transfer full): a new IP4 configuration - **/ -GObject * -nm_ip4_config_new (DBusGConnection *connection, const char *object_path) -{ - return (GObject *) g_object_new (NM_TYPE_IP4_CONFIG, - NM_OBJECT_DBUS_CONNECTION, connection, - NM_OBJECT_DBUS_PATH, object_path, - NULL); -} - /** * nm_ip4_config_get_gateway: * @config: a #NMIP4Config diff --git a/libnm/nm-ip4-config.h b/libnm/nm-ip4-config.h index 7e5732320f..4ded985534 100644 --- a/libnm/nm-ip4-config.h +++ b/libnm/nm-ip4-config.h @@ -57,8 +57,6 @@ typedef struct { GType nm_ip4_config_get_type (void); -GObject *nm_ip4_config_new (DBusGConnection *connection, const char *object_path); - const char * nm_ip4_config_get_gateway (NMIP4Config *config); const GSList * nm_ip4_config_get_addresses (NMIP4Config *config); const GSList * nm_ip4_config_get_routes (NMIP4Config *config); diff --git a/libnm/nm-ip6-config.c b/libnm/nm-ip6-config.c index 1102f44d16..dd5807d9fc 100644 --- a/libnm/nm-ip6-config.c +++ b/libnm/nm-ip6-config.c @@ -55,24 +55,6 @@ enum { LAST_PROP }; -/** - * nm_ip6_config_new: - * @connection: the #DBusGConnection - * @object_path: the DBus object path of the device - * - * Creates a new #NMIP6Config. - * - * Returns: (transfer full): a new IP6 configuration - **/ -GObject * -nm_ip6_config_new (DBusGConnection *connection, const char *object_path) -{ - return (GObject *) g_object_new (NM_TYPE_IP6_CONFIG, - NM_OBJECT_DBUS_CONNECTION, connection, - NM_OBJECT_DBUS_PATH, object_path, - NULL); -} - static gboolean demarshal_ip6_address_array (NMObject *object, GParamSpec *pspec, GValue *value, gpointer field) { diff --git a/libnm/nm-ip6-config.h b/libnm/nm-ip6-config.h index 47d082b1e3..00b77421a9 100644 --- a/libnm/nm-ip6-config.h +++ b/libnm/nm-ip6-config.h @@ -56,8 +56,6 @@ typedef struct { GType nm_ip6_config_get_type (void); -GObject *nm_ip6_config_new (DBusGConnection *connection, const char *object_path); - const char * nm_ip6_config_get_gateway (NMIP6Config *config); const GSList * nm_ip6_config_get_addresses (NMIP6Config *config); const GSList * nm_ip6_config_get_routes (NMIP6Config *config); diff --git a/libnm/nm-remote-connection.c b/libnm/nm-remote-connection.c index f5ee0de1ea..7498fff082 100644 --- a/libnm/nm-remote-connection.c +++ b/libnm/nm-remote-connection.c @@ -33,7 +33,6 @@ #include "nm-glib-compat.h" #include "nm-dbus-helpers-private.h" -#define NM_REMOTE_CONNECTION_BUS "bus" #define NM_REMOTE_CONNECTION_DBUS_CONNECTION "dbus-connection" #define NM_REMOTE_CONNECTION_DBUS_PATH "dbus-path" @@ -542,28 +541,6 @@ properties_changed_cb (DBusGProxy *proxy, /****************************************************************/ -/** - * nm_remote_connection_new: - * @bus: a valid and connected D-Bus connection - * @path: the D-Bus path of the connection as exported by the settings service - * - * Creates a new object representing the remote connection. - * - * Returns: the new remote connection object on success, or %NULL on failure - **/ -NMRemoteConnection * -nm_remote_connection_new (DBusGConnection *bus, - const char *path) -{ - g_return_val_if_fail (bus != NULL, NULL); - g_return_val_if_fail (path != NULL, NULL); - - return (NMRemoteConnection *) g_object_new (NM_TYPE_REMOTE_CONNECTION, - NM_REMOTE_CONNECTION_BUS, bus, - NM_CONNECTION_PATH, path, - NULL); -} - static void constructed (GObject *object) { diff --git a/libnm/nm-remote-connection.h b/libnm/nm-remote-connection.h index e437ab554b..c5912e44f8 100644 --- a/libnm/nm-remote-connection.h +++ b/libnm/nm-remote-connection.h @@ -51,6 +51,7 @@ typedef enum { GQuark nm_remote_connection_error_quark (void); /* Properties */ +#define NM_REMOTE_CONNECTION_BUS "bus" #define NM_REMOTE_CONNECTION_UNSAVED "unsaved" /* Signals */ @@ -110,9 +111,6 @@ typedef void (*NMRemoteConnectionGetSecretsFunc) (NMRemoteConnection *connection GType nm_remote_connection_get_type (void); -NMRemoteConnection *nm_remote_connection_new (DBusGConnection *bus, - const char *path); - void nm_remote_connection_commit_changes (NMRemoteConnection *connection, NMRemoteConnectionResultFunc callback, gpointer user_data); diff --git a/libnm/nm-remote-settings.c b/libnm/nm-remote-settings.c index 8c03693324..5e35d1429c 100644 --- a/libnm/nm-remote-settings.c +++ b/libnm/nm-remote-settings.c @@ -525,7 +525,10 @@ new_connection_cb (DBusGProxy *proxy, const char *path, gpointer user_data) return connection; /* Create a new connection object for it */ - connection = nm_remote_connection_new (priv->bus, path); + connection = g_object_new (NM_TYPE_REMOTE_CONNECTION, + NM_REMOTE_CONNECTION_BUS, priv->bus, + NM_CONNECTION_PATH, path, + NULL); if (connection) { g_async_initable_init_async (G_ASYNC_INITABLE (connection), G_PRIORITY_DEFAULT, NULL, diff --git a/libnm/nm-vpn-connection.c b/libnm/nm-vpn-connection.c index 9bde7de299..d50fb74f35 100644 --- a/libnm/nm-vpn-connection.c +++ b/libnm/nm-vpn-connection.c @@ -53,27 +53,6 @@ enum { static guint signals[LAST_SIGNAL] = { 0 }; -/** - * nm_vpn_connection_new: - * @connection: the #DBusGConnection - * @path: the DBus object path of the new connection - * - * Creates a new #NMVpnConnection. - * - * Returns: (transfer full): a new connection object - **/ -GObject * -nm_vpn_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_VPN_CONNECTION, - NM_OBJECT_DBUS_CONNECTION, connection, - NM_OBJECT_DBUS_PATH, path, - NULL); -} - /** * nm_vpn_connection_get_banner: * @vpn: a #NMVpnConnection diff --git a/libnm/nm-vpn-connection.h b/libnm/nm-vpn-connection.h index c38d902860..3aac48c943 100644 --- a/libnm/nm-vpn-connection.h +++ b/libnm/nm-vpn-connection.h @@ -58,8 +58,6 @@ typedef struct { GType nm_vpn_connection_get_type (void); -GObject * nm_vpn_connection_new (DBusGConnection *connection, const char *path); - NMVpnConnectionState nm_vpn_connection_get_vpn_state (NMVpnConnection *vpn); const char * nm_vpn_connection_get_banner (NMVpnConnection *vpn); diff --git a/libnm/nm-wimax-nsp.c b/libnm/nm-wimax-nsp.c index 1cbd3eefd0..106f5bd2f0 100644 --- a/libnm/nm-wimax-nsp.c +++ b/libnm/nm-wimax-nsp.c @@ -53,27 +53,6 @@ enum { LAST_PROP }; -/** - * nm_wimax_nsp_new: - * @connection: the #DBusGConnection - * @path: the D-Bus object path of the WiMAX NSP - * - * Creates a new #NMWimaxNsp. - * - * Returns: (transfer full): a new WiMAX NSP - **/ -GObject * -nm_wimax_nsp_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_WIMAX_NSP, - NM_OBJECT_DBUS_CONNECTION, connection, - NM_OBJECT_DBUS_PATH, path, - NULL); -} - /** * nm_wimax_nsp_get_name: * @nsp: a #NMWimaxNsp diff --git a/libnm/nm-wimax-nsp.h b/libnm/nm-wimax-nsp.h index 57a915991c..9858ae3da8 100644 --- a/libnm/nm-wimax-nsp.h +++ b/libnm/nm-wimax-nsp.h @@ -60,8 +60,6 @@ typedef struct { GType nm_wimax_nsp_get_type (void); -GObject *nm_wimax_nsp_new (DBusGConnection *connection, const char *path); - const char * nm_wimax_nsp_get_name (NMWimaxNsp *nsp); guint32 nm_wimax_nsp_get_signal_quality (NMWimaxNsp *nsp); NMWimaxNspNetworkType nm_wimax_nsp_get_network_type (NMWimaxNsp *nsp); -- cgit v1.2.1