diff options
author | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2009-06-18 05:53:10 +0800 |
---|---|---|
committer | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2009-06-18 06:47:11 +0800 |
commit | 21ed0c9812b89d41518397ff4ee08c3eeebe0712 (patch) | |
tree | 67dfd5fbbbe5d817fbfab139b1d2d1f2c0ce486e /src | |
parent | 8b126ca039f7d4a5a93e695682dc975d1254c49e (diff) | |
download | gsoc2013-empathy-21ed0c9812b89d41518397ff4ee08c3eeebe0712.tar gsoc2013-empathy-21ed0c9812b89d41518397ff4ee08c3eeebe0712.tar.gz gsoc2013-empathy-21ed0c9812b89d41518397ff4ee08c3eeebe0712.tar.bz2 gsoc2013-empathy-21ed0c9812b89d41518397ff4ee08c3eeebe0712.tar.lz gsoc2013-empathy-21ed0c9812b89d41518397ff4ee08c3eeebe0712.tar.xz gsoc2013-empathy-21ed0c9812b89d41518397ff4ee08c3eeebe0712.tar.zst gsoc2013-empathy-21ed0c9812b89d41518397ff4ee08c3eeebe0712.zip |
Take org.gnome.Empathy as a well-known name on startup. (Fixes #560159)
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
Diffstat (limited to 'src')
-rw-r--r-- | src/empathy.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/empathy.c b/src/empathy.c index d5be4df8d..f23ce9145 100644 --- a/src/empathy.c +++ b/src/empathy.c @@ -38,6 +38,7 @@ #include <libebook/e-book.h> #include <libnotify/notify.h> +#include <telepathy-glib/dbus.h> #include <telepathy-glib/util.h> #include <libmissioncontrol/mc-account.h> #include <libmissioncontrol/mission-control.h> @@ -470,6 +471,7 @@ main (int argc, char *argv[]) gboolean hide_contact_list = FALSE; gboolean accounts_dialog = FALSE; GError *error = NULL; + TpDBusDaemon *dbus_daemon; GOptionEntry options[] = { { "no-connect", 'n', 0, G_OPTION_ARG_NONE, &no_connect, @@ -547,6 +549,23 @@ main (int argc, char *argv[]) g_warning ("Cannot create the 'empathy' bacon connection."); } + /* Take well-known name */ + dbus_daemon = tp_dbus_daemon_dup (&error); + if (error == NULL) { + if (!tp_dbus_daemon_request_name (dbus_daemon, + "org.gnome.Empathy", + TRUE, &error)) { + DEBUG ("Failed to request well-known name: %s", + error ? error->message : "no message"); + g_clear_error (&error); + } + g_object_unref (dbus_daemon); + } else { + DEBUG ("Failed to dup dbus daemon: %s", + error ? error->message : "no message"); + g_clear_error (&error); + } + /* Setting up MC */ mc = empathy_mission_control_dup_singleton (); g_signal_connect (mc, "ServiceEnded", |