diff options
| author | Michael Biebl <biebl@debian.org> | 2011-08-23 19:17:03 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2011-08-23 19:17:03 +0200 |
| commit | 72acf6b5cf8cf7df57288a5ebca56cd84d21ff62 (patch) | |
| tree | 45a40c078a86d4043a303ca0f81735daf263f175 /libnm-glib/nm-object.c | |
| parent | 232698d28a1764e179f668f480738b8c7117e70a (diff) | |
| parent | 263bf4c0c89bb88dc995acd9a6a2de9095fbd461 (diff) | |
Merge commit 'upstream/0.9.0' into experimental
Diffstat (limited to 'libnm-glib/nm-object.c')
| -rw-r--r-- | libnm-glib/nm-object.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/libnm-glib/nm-object.c b/libnm-glib/nm-object.c index 614f6afc..cbcf2919 100644 --- a/libnm-glib/nm-object.c +++ b/libnm-glib/nm-object.c @@ -79,8 +79,6 @@ constructor (GType type, if (!object) return NULL; - _nm_object_cache_add (NM_OBJECT (object)); - priv = NM_OBJECT_GET_PRIVATE (object); if (priv->connection == NULL || priv->path == NULL) { @@ -94,6 +92,8 @@ constructor (GType type, priv->path, "org.freedesktop.DBus.Properties"); + _nm_object_cache_add (NM_OBJECT (object)); + return object; } @@ -140,11 +140,15 @@ set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { NMObjectPrivate *priv = NM_OBJECT_GET_PRIVATE (object); + DBusGConnection *connection; switch (prop_id) { case PROP_CONNECTION: /* Construct only */ - priv->connection = dbus_g_connection_ref ((DBusGConnection *) g_value_get_boxed (value)); + connection = (DBusGConnection *) g_value_get_boxed (value); + if (!connection) + connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, NULL); + priv->connection = dbus_g_connection_ref (connection); break; case PROP_PATH: /* Construct only */ |