[gnome-clocks/wip/geoinfo] Add gsetting to toggle geolocation support



commit 5c4c357707c7956c8400df03082e87140b402559
Author: Evgeny Bobkin <evgen ibqn gmail com>
Date:   Wed Sep 11 10:10:22 2013 +0200

    Add gsetting to toggle geolocation support

 data/org.gnome.clocks.gschema.xml.in.in |    7 +++++++
 src/world.vala                          |    8 +++++---
 2 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/data/org.gnome.clocks.gschema.xml.in.in b/data/org.gnome.clocks.gschema.xml.in.in
index b7b24e0..7261b14 100644
--- a/data/org.gnome.clocks.gschema.xml.in.in
+++ b/data/org.gnome.clocks.gschema.xml.in.in
@@ -21,6 +21,13 @@
         Configured timer duration in seconds.
       </_description>
     </key>
+    <key name="geolocation" type="b">
+      <default>true</default>
+      <_summary>Geolocation support</_summary>
+      <_description>
+        Turn geolocation support on and off.
+      </_description>
+    </key>
   </schema>
   <enum id="org.gnome.clocks.panelid">
     <value nick="world" value="0"/>
diff --git a/src/world.vala b/src/world.vala
index 39ca2c9..c7e708f 100644
--- a/src/world.vala
+++ b/src/world.vala
@@ -321,9 +321,11 @@ public class MainPanel : Gtk.Stack, Clocks.Clock {
 
         load ();
 
-        use_geolocation.begin ((obj, res) => {
-            use_geolocation.end (res);
-        });
+        if (settings.get_boolean ("geolocation")) {
+            use_geolocation.begin ((obj, res) => {
+                use_geolocation.end (res);
+            });
+        }
 
         notify["visible-child"].connect (() => {
             if (visible_child == content_view) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]