summaryrefslogtreecommitdiff
path: root/telepathy-glib/dbus.c
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2010-03-31 18:01:42 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2010-03-31 18:01:42 +0100
commite22168bca3fa95eeaa4bfd003c9a7025e1b045fe (patch)
treef2132969d1b1304b8fd60b76d777137def61b485 /telepathy-glib/dbus.c
parentc82978f14ecd833dbe60a947afd61a02e90eb1c1 (diff)
downloadtelepathy-glib-e22168bca3fa95eeaa4bfd003c9a7025e1b045fe.tar.gz
fd.o #24114: deprecate tp_get_bus() in favour of tp_dbus_daemon_dup()
Because tp_get_bus() is deprecated, and we want to fail on use of deprecated functions in general, I've essentially inlined a copy into tp_get_bus_proxy (which is itself deprecated).
Diffstat (limited to 'telepathy-glib/dbus.c')
-rw-r--r--telepathy-glib/dbus.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/telepathy-glib/dbus.c b/telepathy-glib/dbus.c
index f08e36e99..17b8ab128 100644
--- a/telepathy-glib/dbus.c
+++ b/telepathy-glib/dbus.c
@@ -121,6 +121,8 @@ _tp_dbus_starter_bus_conn (GError **error)
* Most processes should use tp_dbus_daemon_dup() instead.
*
* Returns: a connection to the starter or session D-Bus daemon.
+ *
+ * Deprecated: 0.11.UNRELEASED: Use tp_dbus_daemon_dup() in new code.
*/
DBusGConnection *
tp_get_bus (void)
@@ -140,7 +142,8 @@ tp_get_bus (void)
/**
* tp_get_bus_proxy:
*
- * Return a #DBusGProxy for the bus daemon object.
+ * Return a #DBusGProxy for the bus daemon object. The same caveats as for
+ * tp_get_bus() apply.
*
* Returns: a proxy for the bus daemon object on the starter or session bus.
*
@@ -153,7 +156,14 @@ tp_get_bus_proxy (void)
if (bus_proxy == NULL)
{
- DBusGConnection *bus = tp_get_bus ();
+ GError *error = NULL;
+ DBusGConnection *bus = _tp_dbus_starter_bus_conn (&error);
+
+ if (bus == NULL)
+ {
+ g_warning ("Failed to connect to starter bus: %s", error->message);
+ exit (1);
+ }
bus_proxy = dbus_g_proxy_new_for_name (bus,
"org.freedesktop.DBus",