diff options
author | Ted Gould <ted@canonical.com> | 2009-05-27 10:44:37 +0200 |
---|---|---|
committer | Ted Gould <ted@canonical.com> | 2009-05-27 10:44:37 +0200 |
commit | d2bd9a0a70bbcb73997561baa7a61ddbe7e4780a (patch) | |
tree | a7e97ef151a03ebf3d477a84404eb47d5a27d856 /src/indicator-service.c | |
parent | a472a2b401abb7b108260b6d62a25bb130083dd2 (diff) | |
download | ayatana-indicator-messages-d2bd9a0a70bbcb73997561baa7a61ddbe7e4780a.tar.gz ayatana-indicator-messages-d2bd9a0a70bbcb73997561baa7a61ddbe7e4780a.tar.bz2 ayatana-indicator-messages-d2bd9a0a70bbcb73997561baa7a61ddbe7e4780a.zip |
Getting a name, and grabbing it, and loving it...
Diffstat (limited to 'src/indicator-service.c')
-rw-r--r-- | src/indicator-service.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/indicator-service.c b/src/indicator-service.c index 467ef3a..77d42e6 100644 --- a/src/indicator-service.c +++ b/src/indicator-service.c @@ -21,6 +21,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <string.h> +#include <dbus/dbus-glib-bindings.h> #include <libindicate/listener.h> #include <libdbusmenu-glib/server.h> @@ -469,6 +470,21 @@ main (int argc, char ** argv) { g_type_init(); + DBusGConnection * connection = dbus_g_bus_get(DBUS_BUS_SESSION, NULL); + DBusGProxy * bus_proxy = dbus_g_proxy_new_for_name(connection, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS); + GError * error = NULL; + guint nameret = 0; + + if (!org_freedesktop_DBus_request_name(bus_proxy, INDICATOR_MESSAGES_DBUS_NAME, 0, &nameret, &error)) { + g_error("Unable to call to request name"); + return 1; + } + + if (nameret != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) { + g_error("Unable to get name"); + return 1; + } + listener = indicate_listener_ref_default(); serverList = NULL; |