summaryrefslogtreecommitdiff
path: root/demo/gclue-service-agent.c
diff options
context:
space:
mode:
authorZeeshan Ali (Khattak) <zeeshanak@gnome.org>2014-01-17 19:08:08 +0000
committerZeeshan Ali (Khattak) <zeeshanak@gnome.org>2014-01-17 19:10:37 +0000
commit162bb3253084339d1aa391fb89a0a91f4e8b6ebd (patch)
tree6ce830fd1440c99c601614efb4a0e5299d0dce9b /demo/gclue-service-agent.c
parent9c8f3614c60f7d67f44896c4f8b81d320c59abea (diff)
downloadgeoclue-162bb3253084339d1aa391fb89a0a91f4e8b6ebd.tar.gz
agent: Let agents decide level of location accuracy
We don't know for sure how the agent UIs will look like in the end but better to already have the needed API in place if agents want to somehow let users choose the accuracy they are confirtable with.
Diffstat (limited to 'demo/gclue-service-agent.c')
-rw-r--r--demo/gclue-service-agent.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/demo/gclue-service-agent.c b/demo/gclue-service-agent.c
index c5785fe..79b7f55 100644
--- a/demo/gclue-service-agent.c
+++ b/demo/gclue-service-agent.c
@@ -25,6 +25,8 @@
#include <gio/gio.h>
#include <gio/gdesktopappinfo.h>
+#include <gclue-enums.h>
+
#include "gclue-service-agent.h"
static void
@@ -233,6 +235,7 @@ typedef struct
NotifyNotification *notification;
GAppInfo *app_info;
gboolean authorized;
+ GClueAccuracyLevel accuracy_level;
} NotificationData;
static void
@@ -274,14 +277,16 @@ on_notify_closed (NotifyNotification *notification,
g_debug ("'%s' not authorized", g_app_info_get_display_name (data->app_info));
gclue_agent_complete_authorize_app (data->agent,
data->invocation,
- data->authorized);
+ data->authorized,
+ data->accuracy_level);
notification_data_free (data);
}
static gboolean
gclue_service_agent_handle_authorize_app (GClueAgent *agent,
GDBusMethodInvocation *invocation,
- const char *desktop_id)
+ const char *desktop_id,
+ GClueAccuracyLevel accuracy_level)
{
NotifyNotification *notification;
NotificationData *data;
@@ -294,7 +299,10 @@ gclue_service_agent_handle_authorize_app (GClueAgent *agent,
app_info = G_APP_INFO (g_desktop_app_info_new (desktop_file));
if (app_info == NULL) {
g_debug ("Failed to find %s", desktop_file);
- gclue_agent_complete_authorize_app (agent, invocation, FALSE);
+ gclue_agent_complete_authorize_app (agent,
+ invocation,
+ FALSE,
+ accuracy_level);
return TRUE;
}
@@ -309,6 +317,7 @@ gclue_service_agent_handle_authorize_app (GClueAgent *agent,
data->invocation = invocation;
data->notification = notification;
data->app_info = app_info;
+ data->accuracy_level = accuracy_level;
notify_notification_add_action (notification,
ACTION_YES,