diff options
author | Ken VanDine <ken.vandine@canonical.com> | 2010-07-08 17:18:49 -0400 |
---|---|---|
committer | Ken VanDine <ken.vandine@canonical.com> | 2010-07-08 17:18:49 -0400 |
commit | 271f62baede153472711c3dcf2388df3acffa006 (patch) | |
tree | 0432b0802a7b35beaac76d51d797219a4b586d80 /libdbusmenu-glib/server.c | |
parent | 1231c20212abb9c09b9eaec0c8619d126e3e2779 (diff) | |
parent | 78b810a93fbccde56192efa7cc6b4a520f03e35a (diff) | |
download | libdbusmenu-271f62baede153472711c3dcf2388df3acffa006.tar.gz libdbusmenu-271f62baede153472711c3dcf2388df3acffa006.tar.bz2 libdbusmenu-271f62baede153472711c3dcf2388df3acffa006.zip |
releasing version 0.3.5-0ubuntu1
Diffstat (limited to 'libdbusmenu-glib/server.c')
-rw-r--r-- | libdbusmenu-glib/server.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c index 0da66cc..13c2843 100644 --- a/libdbusmenu-glib/server.c +++ b/libdbusmenu-glib/server.c @@ -225,15 +225,22 @@ static void set_property (GObject * obj, guint id, const GValue * value, GParamSpec * pspec) { DbusmenuServerPrivate * priv = DBUSMENU_SERVER_GET_PRIVATE(obj); + GError * error = NULL; switch (id) { case PROP_DBUS_OBJECT: g_return_if_fail(priv->dbusobject == NULL); priv->dbusobject = g_value_dup_string(value); - DBusGConnection * connection = dbus_g_bus_get(DBUS_BUS_SESSION, NULL); - dbus_g_connection_register_g_object(connection, - priv->dbusobject, - obj); + DBusGConnection * connection = dbus_g_bus_get(DBUS_BUS_SESSION, &error); + + if (connection == NULL || error != NULL) { + g_warning("Unable to get session bus: %s", error == NULL ? "No message" : error->message); + if (error != NULL) { g_error_free(error); } + } else { + dbus_g_connection_register_g_object(connection, + priv->dbusobject, + obj); + } break; case PROP_ROOT_NODE: if (priv->root != NULL) { |