2
* Copyright 2013 Canonical Ltd.
5
* Charles Kerr <charles.kerr@canonical.com>
7
* This program is free software: you can redistribute it and/or modify it
8
* under the terms of the GNU General Public License version 3, as published
9
* by the Free Software Foundation.
11
* This program is distributed in the hope that it will be useful, but
12
* WITHOUT ANY WARRANTY; without even the implied warranties of
13
* MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
14
* PURPOSE. See the GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License along
17
* with this program. If not, see <http://www.gnu.org/licenses/>.
21
#include <stdlib.h> /* exit() */
23
#include <glib/gi18n.h>
33
on_name_lost (gpointer instance G_GNUC_UNUSED, gpointer loop)
35
g_warning ("exiting: service couldn't acquire, or lost ownership of, busname");
37
g_main_loop_quit (loop);
41
main (int argc G_GNUC_UNUSED, char ** argv G_GNUC_UNUSED)
44
IndicatorSessionService * service;
46
/* Work around a deadlock in glib's type initialization. It can be
47
* removed when https://bugzilla.gnome.org/show_bug.cgi?id=674885 is
50
g_type_ensure (G_TYPE_DBUS_CONNECTION);
52
/* boilerplate i18n */
53
setlocale (LC_ALL, "");
54
bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
55
textdomain (GETTEXT_PACKAGE);
58
service = indicator_session_service_new ();
59
loop = g_main_loop_new (NULL, FALSE);
60
g_signal_connect (service, INDICATOR_SESSION_SERVICE_SIGNAL_NAME_LOST,
61
G_CALLBACK(on_name_lost), loop);
62
g_main_loop_run (loop);
65
g_clear_object (&service);
66
g_main_loop_unref (loop);