Commit d64ffa43 authored by Zeeshan Ali's avatar Zeeshan Ali

agent,dbus: MaxAccuracyLevel property now read-only

Let agents handle the persistence of this setting. Geoclue is a system
service and therefore is not the appropriate entity to keep this info.
parent 20e66c1e
......@@ -42,11 +42,8 @@
The global maximum level of accuracy allowed for all clients. Since
agents are per-user, this can be different for each user. See
<link linkend="GClueAccuracyLevel">GClueAccuracyLevel</link> for
possible values. Geoclue will set this value on agent upon agent
registering itself and will listen to changes to it by agent. Its done
this way so that geoclue is the entity that keeps this information on
disk and agent is just providing UI to control it.
possible values.
<property name="MaxAccuracyLevel" type="u" access="readwrite"/>
<property name="MaxAccuracyLevel" type="u" access="read"/>
......@@ -29,7 +29,6 @@
#include "geoclue-agent-interface.h"
#include "gclue-enums.h"
#include "gclue-config.h"
#include "gclue-user-config.h"
#define AGENT_WAIT_TIMEOUT 100 /* milliseconds */
#define AGENT_WAIT_TIMEOUT_USEC 100000 /* microseconds */
......@@ -248,24 +247,6 @@ on_agent_vanished (GClueClientInfo *info,
g_object_unref (info);
static void
on_agent_max_accuracy_changed (GClueAgent *agent,
GParamSpec *pspec,
gpointer user_data)
GClueClientInfo *info = GCLUE_CLIENT_INFO (user_data);;
GClueAccuracyLevel max_accuracy;
GClueUserConfig *user_config;
guint32 user_id;
user_id = gclue_client_info_get_user_id (info);
max_accuracy = gclue_agent_get_max_accuracy_level (agent);
user_config = gclue_user_config_new (user_id);
gclue_user_config_set_max_accuracy (user_config, max_accuracy);
g_object_unref (user_config);
static void
on_agent_proxy_ready (GObject *source_object,
GAsyncResult *res,
......@@ -274,9 +255,7 @@ on_agent_proxy_ready (GObject *source_object,
AddAgentData *data = (AddAgentData *) user_data;
GClueServiceManagerPrivate *priv = GCLUE_SERVICE_MANAGER (data->manager)->priv;
guint32 user_id;
GClueUserConfig *user_config;
GClueAgent *agent;
GClueAccuracyLevel max_accuracy;
GError *error = NULL;
agent = gclue_agent_proxy_new_for_bus_finish (res, &error);
......@@ -292,16 +271,6 @@ on_agent_proxy_ready (GObject *source_object,
G_CALLBACK (on_agent_vanished),
user_config = gclue_user_config_new (user_id);
max_accuracy = gclue_user_config_get_max_accuracy (user_config);
g_object_unref (user_config);
gclue_agent_set_max_accuracy_level (agent, max_accuracy);
g_signal_connect (agent,
G_CALLBACK (on_agent_max_accuracy_changed),
gclue_manager_complete_add_agent (data->manager, data->invocation);
goto out;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment