summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZeeshan Ali <zeenix@collabora.co.uk>2019-01-03 16:35:35 +0100
committerZeeshan Ali <zeenix@collabora.co.uk>2019-01-03 17:24:32 +0100
commit9ad0c5c5be1880a087f3291a21f4e4e047e5ef8c (patch)
tree524d1a8e0b13f80fb2f4625415be9bdfb7425cfd
parent89230c20d3afaf82fd5c401303754af67efdfaf7 (diff)
downloadgeoclue-9ad0c5c5be1880a087f3291a21f4e4e047e5ef8c.tar.gz
wifi: Don't schedule location refresh on BSS addition/removal
Let's wait for the scan to be complete (takes 5 seconds currently) before refreshing location to avoid spamming Mozilla Location Service. Fixes #100.
-rw-r--r--src/gclue-wifi.c25
1 files changed, 0 insertions, 25 deletions
diff --git a/src/gclue-wifi.c b/src/gclue-wifi.c
index aa7f7eb..269984b 100644
--- a/src/gclue-wifi.c
+++ b/src/gclue-wifi.c
@@ -56,7 +56,6 @@ struct _GClueWifiPrivate {
gulong bss_removed_id;
gulong scan_done_id;
- guint refresh_timeout;
guint scan_timeout;
GClueAccuracyLevel accuracy_level;
@@ -184,16 +183,6 @@ gclue_wifi_class_init (GClueWifiClass *klass)
gParamSpecs[PROP_ACCURACY_LEVEL]);
}
-static gboolean
-on_refresh_timeout (gpointer user_data)
-{
- g_debug ("Refreshing location..");
- gclue_web_source_refresh (GCLUE_WEB_SOURCE (user_data));
- GCLUE_WIFI (user_data)->priv->refresh_timeout = 0;
-
- return FALSE;
-}
-
static void
on_bss_added (WPAInterface *object,
const gchar *path,
@@ -260,15 +249,6 @@ add_bss_proxy (GClueWifi *wifi,
{
const char *path;
- /* There could be multiple devices being added/removed at the same time
- * so we don't immediately call refresh but rather wait 1 second.
- */
- if (wifi->priv->refresh_timeout != 0)
- g_source_remove (wifi->priv->refresh_timeout);
- wifi->priv->refresh_timeout = g_timeout_add_seconds (1,
- on_refresh_timeout,
- wifi);
-
path = g_dbus_proxy_get_object_path (G_DBUS_PROXY (bss));
if (g_hash_table_replace (wifi->priv->bss_proxies,
g_strdup (path),
@@ -561,11 +541,6 @@ disconnect_bss_signals (GClueWifi *wifi)
g_signal_handler_disconnect (priv->interface, priv->bss_removed_id);
priv->bss_removed_id = 0;
- if (priv->refresh_timeout != 0) {
- g_source_remove (priv->refresh_timeout);
- priv->refresh_timeout = 0;
- }
-
g_hash_table_remove_all (wifi->priv->bss_proxies);
g_hash_table_remove_all (wifi->priv->ignored_bss_proxies);
}