1
/* vim: set et ts=8 sw=8: */
4
* Copyright (C) 2013 Red Hat, Inc.
6
* This file is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU Lesser General Public
8
* License as published by the Free Software Foundation; either
9
* version 2.1 of the License, or (at your option) any later version.
11
* This file is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* Lesser General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19
* Author: Zeeshan Ali (Khattak) <zeeshanak@gnome.org>
25
#include <glib/gi18n.h>
27
#include "gclue-service-manager.h"
29
#define BUS_NAME "org.freedesktop.GeoClue2"
31
GClueServiceManager *manager;
34
on_bus_acquired (GDBusConnection *connection,
40
if (!gclue_service_manager_export (manager, connection, &error)) {
41
g_critical ("Failed to register server: %s", error->message);
42
g_error_free (&error);
48
on_name_lost (GDBusConnection *connection,
52
g_critical ("Failed to acquire name '%s' on session bus or lost it.", name);
58
main (int argc, char **argv)
63
textdomain (GETTEXT_PACKAGE);
64
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
65
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
66
g_set_application_name (_("GeoClue"));
68
manager = gclue_service_manager_new ();
70
owner_id = g_bus_own_name (G_BUS_TYPE_SESSION,
72
G_BUS_NAME_OWNER_FLAGS_NONE,
79
main_loop = g_main_loop_new (NULL, FALSE);
80
g_main_loop_run (main_loop);
82
g_object_unref (manager);
83
g_bus_unown_name (owner_id);
84
g_main_loop_unref (main_loop);