Commit 661d0985 authored by Dan Williams's avatar Dan Williams

libnm-glib: use helpers to create dbus proxies

When using a private connection, we need to use dbus_g_proxy_new_for_peer()
because the bus isn't involved.  Since many parts of libnm-glib create a
proxy for their corresponding remote object, consolidate the proxy creation
logic.

A later patch will add logic to use a private connection versus a bus-based
one.
parent 44f350c9
......@@ -540,12 +540,7 @@ constructed (GObject *object)
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 (NM_OBJECT (object)),
NM_DBUS_SERVICE,
nm_object_get_path (NM_OBJECT (object)),
NM_DBUS_INTERFACE_ACCESS_POINT);
priv->proxy = _nm_object_new_proxy (NM_OBJECT (object), NULL, NM_DBUS_INTERFACE_ACCESS_POINT);
register_properties (NM_ACCESS_POINT (object));
}
......
......@@ -32,6 +32,7 @@
#include "nm-connection.h"
#include "nm-vpn-connection.h"
#include "nm-glib-compat.h"
#include "nm-dbus-helpers-private.h"
static GType _nm_active_connection_type_for_path (DBusGConnection *connection,
const char *path);
......@@ -114,10 +115,7 @@ _nm_active_connection_type_for_path (DBusGConnection *connection,
GValue value = G_VALUE_INIT;
GType type;
proxy = dbus_g_proxy_new_for_name (connection,
NM_DBUS_SERVICE,
path,
"org.freedesktop.DBus.Properties");
proxy = _nm_dbus_new_proxy_for_connection (connection, path, "org.freedesktop.DBus.Properties");
if (!proxy) {
g_warning ("%s: couldn't create D-Bus object proxy.", __func__);
return G_TYPE_INVALID;
......@@ -194,8 +192,7 @@ _nm_active_connection_type_for_path_async (DBusGConnection *connection,
async_data->callback = callback;
async_data->user_data = user_data;
proxy = dbus_g_proxy_new_for_name (connection, NM_DBUS_SERVICE, path,
"org.freedesktop.DBus.Properties");
proxy = _nm_dbus_new_proxy_for_connection (connection, path, "org.freedesktop.DBus.Properties");
dbus_g_proxy_begin_call (proxy, "Get",
async_got_type, async_data, NULL,
G_TYPE_STRING, NM_DBUS_INTERFACE_ACTIVE_CONNECTION,
......@@ -449,17 +446,11 @@ register_properties (NMActiveConnection *connection)
static void
constructed (GObject *object)
{
NMActiveConnectionPrivate *priv;
NMActiveConnectionPrivate *priv = NM_ACTIVE_CONNECTION_GET_PRIVATE (object);
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 (NM_OBJECT (object)),
NM_DBUS_SERVICE,
nm_object_get_path (NM_OBJECT (object)),
NM_DBUS_INTERFACE_ACTIVE_CONNECTION);
priv->proxy = _nm_object_new_proxy (NM_OBJECT (object), NULL, NM_DBUS_INTERFACE_ACTIVE_CONNECTION);
register_properties (NM_ACTIVE_CONNECTION (object));
}
......
......@@ -1477,20 +1477,13 @@ constructor (GType type,
static void
constructed (GObject *object)
{
DBusGConnection *connection;
NMClientPrivate *priv;
NMClientPrivate *priv = NM_CLIENT_GET_PRIVATE (object);
nm_utils_init (NULL);
G_OBJECT_CLASS (nm_client_parent_class)->constructed (object);
priv = NM_CLIENT_GET_PRIVATE (object);
connection = nm_object_get_connection (NM_OBJECT (object));
priv->client_proxy = dbus_g_proxy_new_for_name (connection,
NM_DBUS_SERVICE,
nm_object_get_path (NM_OBJECT (object)),
NM_DBUS_INTERFACE);
priv->client_proxy = _nm_object_new_proxy (NM_OBJECT (object), NULL, NM_DBUS_INTERFACE);
register_properties (NM_CLIENT (object));
......@@ -1502,7 +1495,7 @@ constructed (GObject *object)
object,
NULL);
priv->bus_proxy = dbus_g_proxy_new_for_name (connection,
priv->bus_proxy = dbus_g_proxy_new_for_name (nm_object_get_connection (NM_OBJECT (object)),
DBUS_SERVICE_DBUS,
DBUS_PATH_DBUS,
DBUS_INTERFACE_DBUS);
......
......@@ -159,17 +159,11 @@ register_properties (NMDeviceAdsl *device)
static void
constructed (GObject *object)
{
NMDeviceAdslPrivate *priv;
NMDeviceAdslPrivate *priv = NM_DEVICE_ADSL_GET_PRIVATE (object);
G_OBJECT_CLASS (nm_device_adsl_parent_class)->constructed (object);
priv = NM_DEVICE_ADSL_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_ADSL);
priv->proxy = _nm_object_new_proxy (NM_OBJECT (object), NULL, NM_DBUS_INTERFACE_DEVICE_ADSL);
register_properties (NM_DEVICE_ADSL (object));
}
......
......@@ -222,17 +222,11 @@ register_properties (NMDeviceBond *device)
static void
constructed (GObject *object)
{
NMDeviceBondPrivate *priv;
NMDeviceBondPrivate *priv = NM_DEVICE_BOND_GET_PRIVATE (object);
G_OBJECT_CLASS (nm_device_bond_parent_class)->constructed (object);
priv = NM_DEVICE_BOND_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_BOND);
priv->proxy = _nm_object_new_proxy (NM_OBJECT (object), NULL, NM_DBUS_INTERFACE_DEVICE_BOND);
register_properties (NM_DEVICE_BOND (object));
}
......
......@@ -230,17 +230,11 @@ register_properties (NMDeviceBridge *device)
static void
constructed (GObject *object)
{
NMDeviceBridgePrivate *priv;
NMDeviceBridgePrivate *priv = NM_DEVICE_BRIDGE_GET_PRIVATE (object);
G_OBJECT_CLASS (nm_device_bridge_parent_class)->constructed (object);
priv = NM_DEVICE_BRIDGE_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_BRIDGE);
priv->proxy = _nm_object_new_proxy (NM_OBJECT (object), NULL, NM_DBUS_INTERFACE_DEVICE_BRIDGE);
register_properties (NM_DEVICE_BRIDGE (object));
}
......
......@@ -258,11 +258,7 @@ constructed (GObject *object)
G_OBJECT_CLASS (nm_device_bt_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_BLUETOOTH);
priv->proxy = _nm_object_new_proxy (NM_OBJECT (object), NULL, NM_DBUS_INTERFACE_DEVICE_BLUETOOTH);
register_properties (NM_DEVICE_BT (object));
}
......
......@@ -259,17 +259,11 @@ register_properties (NMDeviceEthernet *device)
static void
constructed (GObject *object)
{
NMDeviceEthernetPrivate *priv;
NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (object);
G_OBJECT_CLASS (nm_device_ethernet_parent_class)->constructed (object);
priv = NM_DEVICE_ETHERNET_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_WIRED);
priv->proxy = _nm_object_new_proxy (NM_OBJECT (object), NULL, NM_DBUS_INTERFACE_DEVICE_WIRED);
register_properties (NM_DEVICE_ETHERNET (object));
}
......
......@@ -205,17 +205,11 @@ register_properties (NMDeviceInfiniband *device)
static void
constructed (GObject *object)
{
NMDeviceInfinibandPrivate *priv;
NMDeviceInfinibandPrivate *priv = NM_DEVICE_INFINIBAND_GET_PRIVATE (object);
G_OBJECT_CLASS (nm_device_infiniband_parent_class)->constructed (object);
priv = NM_DEVICE_INFINIBAND_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_INFINIBAND);
priv->proxy = _nm_object_new_proxy (NM_OBJECT (object), NULL, NM_DBUS_INTERFACE_DEVICE_INFINIBAND);
register_properties (NM_DEVICE_INFINIBAND (object));
}
......
......@@ -179,17 +179,11 @@ register_properties (NMDeviceModem *device)
static void
constructed (GObject *object)
{
NMDeviceModemPrivate *priv;
NMDeviceModemPrivate *priv = NM_DEVICE_MODEM_GET_PRIVATE (object);
G_OBJECT_CLASS (nm_device_modem_parent_class)->constructed (object);
priv = NM_DEVICE_MODEM_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_MODEM);
priv->proxy = _nm_object_new_proxy (NM_OBJECT (object), NULL, NM_DBUS_INTERFACE_DEVICE_MODEM);
register_properties (NM_DEVICE_MODEM (object));
}
......
......@@ -208,17 +208,11 @@ register_properties (NMDeviceOlpcMesh *device)
static void
constructed (GObject *object)
{
NMDeviceOlpcMeshPrivate *priv;
NMDeviceOlpcMeshPrivate *priv = NM_DEVICE_OLPC_MESH_GET_PRIVATE (object);
G_OBJECT_CLASS (nm_device_olpc_mesh_parent_class)->constructed (object);
priv = NM_DEVICE_OLPC_MESH_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_OLPC_MESH);
priv->proxy = _nm_object_new_proxy (NM_OBJECT (object), NULL, NM_DBUS_INTERFACE_DEVICE_OLPC_MESH);
register_properties (NM_DEVICE_OLPC_MESH (object));
}
......
......@@ -219,17 +219,11 @@ register_properties (NMDeviceVlan *device)
static void
constructed (GObject *object)
{
NMDeviceVlanPrivate *priv;
NMDeviceVlanPrivate *priv = NM_DEVICE_VLAN_GET_PRIVATE (object);
G_OBJECT_CLASS (nm_device_vlan_parent_class)->constructed (object);
priv = NM_DEVICE_VLAN_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_VLAN);
priv->proxy = _nm_object_new_proxy (NM_OBJECT (object), NULL, NM_DBUS_INTERFACE_DEVICE_VLAN);
register_properties (NM_DEVICE_VLAN (object));
}
......
......@@ -654,17 +654,11 @@ register_properties (NMDeviceWifi *device)
static void
constructed (GObject *object)
{
NMDeviceWifiPrivate *priv;
NMDeviceWifiPrivate *priv = NM_DEVICE_WIFI_GET_PRIVATE (object);
G_OBJECT_CLASS (nm_device_wifi_parent_class)->constructed (object);
priv = NM_DEVICE_WIFI_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_WIRELESS);
priv->proxy = _nm_object_new_proxy (NM_OBJECT (object), NULL, NM_DBUS_INTERFACE_DEVICE_WIRELESS);
register_properties (NM_DEVICE_WIFI (object));
g_signal_connect (NM_DEVICE (object),
......
......@@ -568,17 +568,11 @@ register_properties (NMDeviceWimax *wimax)
static void
constructed (GObject *object)
{
NMDeviceWimaxPrivate *priv;
NMDeviceWimaxPrivate *priv = NM_DEVICE_WIMAX_GET_PRIVATE (object);
G_OBJECT_CLASS (nm_device_wimax_parent_class)->constructed (object);
priv = NM_DEVICE_WIMAX_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_WIMAX);
priv->proxy = _nm_object_new_proxy (NM_OBJECT (object), NULL, NM_DBUS_INTERFACE_DEVICE_WIMAX);
register_properties (NM_DEVICE_WIMAX (object));
g_signal_connect (object,
......
......@@ -47,6 +47,7 @@
#include "nm-dbus-glib-types.h"
#include "nm-glib-compat.h"
#include "nm-utils.h"
#include "nm-dbus-helpers-private.h"
static GType _nm_device_type_for_path (DBusGConnection *connection,
const char *path);
......@@ -319,10 +320,7 @@ constructed (GObject *object)
/* Catch a subclass setting the wrong type */
g_warn_if_fail (G_OBJECT_TYPE (object) == _nm_device_gtype_from_dtype (priv->device_type));
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);
priv->proxy = _nm_object_new_proxy (NM_OBJECT (object), NULL, NM_DBUS_INTERFACE_DEVICE);
register_properties (NM_DEVICE (object));
......@@ -849,10 +847,7 @@ _nm_device_type_for_path (DBusGConnection *connection,
GValue value = G_VALUE_INIT;
NMDeviceType nm_dtype;
proxy = dbus_g_proxy_new_for_name (connection,
NM_DBUS_SERVICE,
path,
"org.freedesktop.DBus.Properties");
proxy = _nm_dbus_new_proxy_for_connection (connection, path, "org.freedesktop.DBus.Properties");
if (!proxy) {
g_warning ("%s: couldn't create D-Bus object proxy.", __func__);
return G_TYPE_INVALID;
......@@ -951,8 +946,7 @@ _nm_device_type_for_path_async (DBusGConnection *connection,
async_data->callback = callback;
async_data->user_data = user_data;
proxy = dbus_g_proxy_new_for_name (connection, NM_DBUS_SERVICE, path,
"org.freedesktop.DBus.Properties");
proxy = _nm_dbus_new_proxy_for_connection (connection, path, "org.freedesktop.DBus.Properties");
dbus_g_proxy_begin_call (proxy, "Get",
async_got_type, async_data, NULL,
G_TYPE_STRING, NM_DBUS_INTERFACE_DEVICE,
......
......@@ -90,21 +90,13 @@ register_properties (NMDHCP4Config *config)
static void
constructed (GObject *object)
{
DBusGConnection *connection;
NMDHCP4ConfigPrivate *priv;
NMDHCP4ConfigPrivate *priv = NM_DHCP4_CONFIG_GET_PRIVATE (object);
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 (NM_OBJECT (object));
priv->proxy = dbus_g_proxy_new_for_name (connection,
NM_DBUS_SERVICE,
nm_object_get_path (NM_OBJECT (object)),
NM_DBUS_INTERFACE_DHCP4_CONFIG);
priv->proxy = _nm_object_new_proxy (NM_OBJECT (object), NULL, NM_DBUS_INTERFACE_DHCP4_CONFIG);
register_properties (NM_DHCP4_CONFIG (object));
}
......
......@@ -90,21 +90,13 @@ register_properties (NMDHCP6Config *config)
static void
constructed (GObject *object)
{
DBusGConnection *connection;
NMDHCP6ConfigPrivate *priv;
NMDHCP6ConfigPrivate *priv = NM_DHCP6_CONFIG_GET_PRIVATE (object);
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 (NM_OBJECT (object));
priv->proxy = dbus_g_proxy_new_for_name (connection,
NM_DBUS_SERVICE,
nm_object_get_path (NM_OBJECT (object)),
NM_DBUS_INTERFACE_DHCP6_CONFIG);
priv->proxy = _nm_object_new_proxy (NM_OBJECT (object), NULL, NM_DBUS_INTERFACE_DHCP6_CONFIG);
register_properties (NM_DHCP6_CONFIG (object));
}
......
......@@ -135,19 +135,11 @@ register_properties (NMIP4Config *config)
static void
constructed (GObject *object)
{
DBusGConnection *connection;
NMIP4ConfigPrivate *priv;
NMIP4ConfigPrivate *priv = NM_IP4_CONFIG_GET_PRIVATE (object);
G_OBJECT_CLASS (nm_ip4_config_parent_class)->constructed (object);
priv = NM_IP4_CONFIG_GET_PRIVATE (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 (NM_OBJECT (object)),
NM_DBUS_INTERFACE_IP4_CONFIG);
priv->proxy = _nm_object_new_proxy (NM_OBJECT (object), NULL, NM_DBUS_INTERFACE_IP4_CONFIG);
register_properties (NM_IP4_CONFIG (object));
}
......
......@@ -219,19 +219,11 @@ nm_ip6_config_get_routes (NMIP6Config *config)
static void
constructed (GObject *object)
{
DBusGConnection *connection;
NMIP6ConfigPrivate *priv;
NMIP6ConfigPrivate *priv = NM_IP6_CONFIG_GET_PRIVATE (object);
G_OBJECT_CLASS (nm_ip6_config_parent_class)->constructed (object);
priv = NM_IP6_CONFIG_GET_PRIVATE (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 (NM_OBJECT (object)),
NM_DBUS_INTERFACE_IP6_CONFIG);
priv->proxy = _nm_object_new_proxy (NM_OBJECT (object), NULL, NM_DBUS_INTERFACE_IP6_CONFIG);
register_properties (NM_IP6_CONFIG (object));
}
......
......@@ -39,6 +39,9 @@ typedef struct {
GType object_type;
} NMPropertiesInfo;
DBusGProxy *_nm_object_new_proxy (NMObject *self,
const char *path,
const char *interface);
void _nm_object_register_properties (NMObject *object,
DBusGProxy *proxy,
......
......@@ -32,6 +32,7 @@
#include "nm-glib-compat.h"
#include "nm-types.h"
#include "nm-glib-marshal.h"
#include "nm-dbus-helpers-private.h"
#define DEBUG 0
......@@ -157,10 +158,9 @@ constructed (GObject *object)
if (G_OBJECT_CLASS (nm_object_parent_class)->constructed)
G_OBJECT_CLASS (nm_object_parent_class)->constructed (object);
priv->properties_proxy = dbus_g_proxy_new_for_name (priv->connection,
NM_DBUS_SERVICE,
priv->path,
"org.freedesktop.DBus.Properties");
priv->properties_proxy = _nm_object_new_proxy (NM_OBJECT (object),
NULL,
"org.freedesktop.DBus.Properties");
}
static gboolean
......@@ -1450,3 +1450,12 @@ _nm_object_reload_properties_finish (NMObject *object, GAsyncResult *result, GEr
return g_simple_async_result_get_op_res_gboolean (simple);
}
DBusGProxy *
_nm_object_new_proxy (NMObject *self, const char *path, const char *interface)
{
NMObjectPrivate *priv = NM_OBJECT_GET_PRIVATE (self);
return _nm_dbus_new_proxy_for_connection (priv->connection, path ? path : priv->path, interface);
}
......@@ -29,8 +29,10 @@
#include <nm-setting-connection.h>
#include "nm-remote-connection.h"
#include "nm-remote-connection-private.h"
#include "nm-object-private.h"
#include "nm-dbus-glib-types.h"
#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"
......@@ -359,16 +361,14 @@ nm_remote_connection_new (DBusGConnection *bus,
static void
constructed (GObject *object)
{
NMRemoteConnectionPrivate *priv;
NMRemoteConnectionPrivate *priv = NM_REMOTE_CONNECTION_GET_PRIVATE (object);
priv = NM_REMOTE_CONNECTION_GET_PRIVATE (object);
g_assert (priv->bus);
g_assert (nm_connection_get_path (NM_CONNECTION (object)));
priv->proxy = dbus_g_proxy_new_for_name (priv->bus,
NM_DBUS_SERVICE,
nm_connection_get_path (NM_CONNECTION (object)),
NM_DBUS_IFACE_SETTINGS_CONNECTION);
priv->proxy = _nm_dbus_new_proxy_for_connection (priv->bus,
nm_connection_get_path (NM_CONNECTION (object)),
NM_DBUS_IFACE_SETTINGS_CONNECTION);
g_assert (priv->proxy);
dbus_g_proxy_set_default_timeout (priv->proxy, G_MAXINT);
......
......@@ -29,6 +29,8 @@
#include "nm-dbus-glib-types.h"
#include "nm-remote-settings.h"
#include "nm-remote-connection-private.h"
#include "nm-object-private.h"
#include "nm-dbus-helpers-private.h"
#include "nm-glib-compat.h"
static void nm_remote_settings_initable_iface_init (GInitableIface *iface);
......@@ -893,10 +895,9 @@ constructed (GObject *object)
G_CALLBACK (name_owner_changed),
object, NULL);
priv->proxy = dbus_g_proxy_new_for_name (priv->bus,
NM_DBUS_SERVICE,
NM_DBUS_PATH_SETTINGS,
NM_DBUS_IFACE_SETTINGS);
priv->proxy = _nm_dbus_new_proxy_for_connection (priv->bus,
NM_DBUS_PATH_SETTINGS,
NM_DBUS_IFACE_SETTINGS);
g_assert (priv->proxy);
dbus_g_proxy_set_default_timeout (priv->proxy, G_MAXINT);
......@@ -913,10 +914,9 @@ constructed (GObject *object)
/* D-Bus properties proxy */
priv->props_proxy = dbus_g_proxy_new_for_name (priv->bus,
NM_DBUS_SERVICE,
NM_DBUS_PATH_SETTINGS,
"org.freedesktop.DBus.Properties");
priv->props_proxy = _nm_dbus_new_proxy_for_connection (priv->bus,
NM_DBUS_PATH_SETTINGS,
"org.freedesktop.DBus.Properties");
g_assert (priv->props_proxy);
/* Monitor properties */
......
......@@ -23,13 +23,11 @@
#include <dbus/dbus-glib-lowlevel.h>
#include "nm-glib-compat.h"
#include <NetworkManager.h>
#include "NetworkManager.h"
#include "nm-secret-agent.h"
#include "nm-glib-enum-types.h"
#include "nm-glib-marshal.h"
#include "NetworkManager.h"
#include "nm-dbus-helpers-private.h"
static void impl_secret_agent_get_secrets (NMSecretAgent *self,
GHashTable *connection_hash,
......@@ -826,10 +824,9 @@ nm_secret_agent_init (NMSecretAgent *self)
G_CALLBACK (name_owner_changed),
self, NULL);
priv->manager_proxy = dbus_g_proxy_new_for_name (priv->bus,
NM_DBUS_SERVICE,
NM_DBUS_PATH_AGENT_MANAGER,
NM_DBUS_INTERFACE_AGENT_MANAGER);
priv->manager_proxy = _nm_dbus_new_proxy_for_connection (priv->bus,
NM_DBUS_PATH_AGENT_MANAGER,
NM_DBUS_INTERFACE_AGENT_MANAGER);
if (!priv->manager_proxy) {
g_warning ("Couldn't create NM agent manager proxy.");
return;
......
......@@ -167,16 +167,11 @@ register_properties (NMVPNConnection *connection)
static void
constructed (GObject *object)
{
NMVPNConnectionPrivate *priv;
NMVPNConnectionPrivate *priv = NM_VPN_CONNECTION_GET_PRIVATE (object);
G_OBJECT_CLASS (nm_vpn_connection_parent_class)->constructed (object);
priv = NM_VPN_CONNECTION_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_VPN_CONNECTION);
priv->proxy = _nm_object_new_proxy (NM_OBJECT (object), NULL, NM_DBUS_INTERFACE_VPN_CONNECTION);
dbus_g_object_register_marshaller (_nm_glib_marshal_VOID__UINT_UINT,
G_TYPE_NONE,
......
......@@ -278,17 +278,11 @@ register_properties (NMWimaxNsp *nsp)
static void
constructed (GObject *object)
{
NMWimaxNspPrivate *priv;
NMWimaxNspPrivate *priv = NM_WIMAX_NSP_GET_PRIVATE (object);
G_OBJECT_CLASS (nm_wimax_nsp_parent_class)->constructed (object);
priv = NM_WIMAX_NSP_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_WIMAX_NSP);
priv->proxy = _nm_object_new_proxy (NM_OBJECT (object), NULL, NM_DBUS_INTERFACE_WIMAX_NSP);
register_properties (NM_WIMAX_NSP (object));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment