summaryrefslogtreecommitdiff
path: root/demo
diff options
context:
space:
mode:
authorZeeshan Ali (Khattak) <zeeshanak@gnome.org>2014-02-24 16:43:31 +0000
committerZeeshan Ali (Khattak) <zeeshanak@gnome.org>2014-02-24 16:43:31 +0000
commit22a988d57734ebf82685b2732b0a5fa82ba5b2ab (patch)
treeccde7b11b2611da7abd0d992326e54499db818d3 /demo
parent4399bce09a4ca4582ce8c4b71ce1b5067b8db0e5 (diff)
downloadgeoclue-22a988d57734ebf82685b2732b0a5fa82ba5b2ab.tar.gz
agent: Fixed object path
There is no need for object paths to be unique on the bus and having a fixed path will allow us to use it in DBus policy.
Diffstat (limited to 'demo')
-rw-r--r--demo/gclue-service-agent.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/demo/gclue-service-agent.c b/demo/gclue-service-agent.c
index 4e12e72..fa8d1c4 100644
--- a/demo/gclue-service-agent.c
+++ b/demo/gclue-service-agent.c
@@ -29,6 +29,8 @@
#include "gclue-service-agent.h"
+#define AGENT_PATH "/org/freedesktop/GeoClue2/Agent"
+
static void
gclue_service_agent_agent_iface_init (GClueAgentIface *iface);
static void
@@ -163,6 +165,7 @@ on_manager_proxy_ready (GObject *source_object,
gpointer user_data)
{
GTask *task = G_TASK (user_data);
+ GClueAgent *agent;
GDBusProxy *proxy;
GError *error = NULL;
@@ -195,23 +198,19 @@ gclue_service_agent_init_async (GAsyncInitable *initable,
gpointer user_data)
{
GTask *task;
- char *path;
GError *error = NULL;
task = g_task_new (initable, cancellable, callback, user_data);
- path = g_strdup_printf ("/org/freedesktop/GeoClue2/Agent/%u", getuid ());
if (!g_dbus_interface_skeleton_export
(G_DBUS_INTERFACE_SKELETON (initable),
GCLUE_SERVICE_AGENT (initable)->priv->connection,
- path,
+ AGENT_PATH,
&error)) {
g_task_return_error (task, error);
g_object_unref (task);
- g_free (path);
return;
}
- g_free (path);
g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM,
G_DBUS_PROXY_FLAGS_NONE,