summaryrefslogtreecommitdiff
path: root/nonprism/gnome-weather/nonprism.patch
blob: d5b728322566087fec6d66c4768e06e80d61b837 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
diff --git a/configure b/configure
index 8265089..75512ce 100755
--- a/configure
+++ b/configure
@@ -4989,7 +4989,6 @@ if test -n "$DEPS_CFLAGS"; then
                            glib-2.0
                            gobject-2.0
                            gtk+-3.0 >= 3.11.4
-                           libgeoclue-2.0 >= 2.3.1
                            gjs-1.0 >= \$GJS_MIN_VERSION
                            gweather-3.0 >= 3.17.2\""; } >&5
   ($PKG_CONFIG --exists --print-errors "gdk-3.0
@@ -4998,7 +4997,6 @@ if test -n "$DEPS_CFLAGS"; then
                            glib-2.0
                            gobject-2.0
                            gtk+-3.0 >= 3.11.4
-                           libgeoclue-2.0 >= 2.3.1
                            gjs-1.0 >= $GJS_MIN_VERSION
                            gweather-3.0 >= 3.17.2") 2>&5
   ac_status=$?
@@ -5010,7 +5008,6 @@ if test -n "$DEPS_CFLAGS"; then
                            glib-2.0
                            gobject-2.0
                            gtk+-3.0 >= 3.11.4
-                           libgeoclue-2.0 >= 2.3.1
                            gjs-1.0 >= $GJS_MIN_VERSION
                            gweather-3.0 >= 3.17.2" 2>/dev/null`
 		      test "x$?" != "x0" && pkg_failed=yes
@@ -5030,7 +5027,6 @@ if test -n "$DEPS_LIBS"; then
                            glib-2.0
                            gobject-2.0
                            gtk+-3.0 >= 3.11.4
-                           libgeoclue-2.0 >= 2.3.1
                            gjs-1.0 >= \$GJS_MIN_VERSION
                            gweather-3.0 >= 3.17.2\""; } >&5
   ($PKG_CONFIG --exists --print-errors "gdk-3.0
@@ -5039,7 +5035,6 @@ if test -n "$DEPS_LIBS"; then
                            glib-2.0
                            gobject-2.0
                            gtk+-3.0 >= 3.11.4
-                           libgeoclue-2.0 >= 2.3.1
                            gjs-1.0 >= $GJS_MIN_VERSION
                            gweather-3.0 >= 3.17.2") 2>&5
   ac_status=$?
@@ -5051,7 +5046,6 @@ if test -n "$DEPS_LIBS"; then
                            glib-2.0
                            gobject-2.0
                            gtk+-3.0 >= 3.11.4
-                           libgeoclue-2.0 >= 2.3.1
                            gjs-1.0 >= $GJS_MIN_VERSION
                            gweather-3.0 >= 3.17.2" 2>/dev/null`
 		      test "x$?" != "x0" && pkg_failed=yes
@@ -5080,7 +5074,6 @@ fi
                            glib-2.0
                            gobject-2.0
                            gtk+-3.0 >= 3.11.4
-                           libgeoclue-2.0 >= 2.3.1
                            gjs-1.0 >= $GJS_MIN_VERSION
                            gweather-3.0 >= 3.17.2" 2>&1`
         else
@@ -5090,7 +5083,6 @@ fi
                            glib-2.0
                            gobject-2.0
                            gtk+-3.0 >= 3.11.4
-                           libgeoclue-2.0 >= 2.3.1
                            gjs-1.0 >= $GJS_MIN_VERSION
                            gweather-3.0 >= 3.17.2" 2>&1`
         fi
@@ -5103,7 +5095,6 @@ fi
                            glib-2.0
                            gobject-2.0
                            gtk+-3.0 >= 3.11.4
-                           libgeoclue-2.0 >= 2.3.1
                            gjs-1.0 >= $GJS_MIN_VERSION
                            gweather-3.0 >= 3.17.2) were not met:
 
diff --git a/configure.ac b/configure.ac
index 84c17e3..c905302 100644
--- a/configure.ac
+++ b/configure.ac
@@ -33,7 +33,6 @@ PKG_CHECK_MODULES([DEPS], [gdk-3.0
                            glib-2.0
                            gobject-2.0
                            gtk+-3.0 >= 3.11.4
-                           libgeoclue-2.0 >= 2.3.1
                            gjs-1.0 >= $GJS_MIN_VERSION
                            gweather-3.0 >= 3.17.2])
 
diff --git a/data/org.gnome.Weather.Application.desktop.in b/data/org.gnome.Weather.Application.desktop.in
index a0cf3b5..cc3b5af 100644
--- a/data/org.gnome.Weather.Application.desktop.in
+++ b/data/org.gnome.Weather.Application.desktop.in
@@ -8,4 +8,3 @@ DBusActivatable=true
 StartupNotify=true
 Categories=GNOME;GTK;Utility;Core;
 _Keywords=Weather;Forecast;
-_X-Geoclue-Reason=Allows weather information to be displayed for your location.
diff --git a/src/app/currentLocationController.js b/src/app/currentLocationController.js
index c070598..10b436d 100644
--- a/src/app/currentLocationController.js
+++ b/src/app/currentLocationController.js
@@ -20,16 +20,9 @@ const GLib = imports.gi.GLib;
 const Gio = imports.gi.Gio;
 const Lang = imports.lang;
 const GWeather = imports.gi.GWeather;
-const Geoclue = imports.gi.Geoclue;
 
 const Util = imports.misc.util;
 
-const AutoLocation = {
-    DISABLED: 0,
-    ENABLED: 1,
-    NOT_AVAILABLE: 2
-};
-
 const CurrentLocationController = new Lang.Class({
     Name: 'CurrentLocationController',
 
@@ -37,89 +30,6 @@ const CurrentLocationController = new Lang.Class({
         this._world = world;
         this._processStarted = false;
         this._settings = Util.getSettings('org.gnome.Weather.Application');
-        let autoLocation = this._settings.get_value('automatic-location').deep_unpack();
-        this._syncAutoLocation(autoLocation);
-        if (this.autoLocation == AutoLocation.ENABLED)
-            this._startGeolocationService();
         this.currentLocation = null;
     },
-
-    _startGeolocationService: function() {
-        this._processStarted = true;
-        Geoclue.Simple.new(pkg.name,
-                           Geoclue.AccuracyLevel.CITY,
-                           null,
-                           Lang.bind (this, this._onSimpleReady));
-    },
-
-    _geoLocationFailed: function(e) {
-        log ("Failed to connect to GeoClue2 service: " + e.message);
-        this.autoLocation = AutoLocation.NOT_AVAILABLE;
-        GLib.idle_add(GLib.PRIORITY_DEFAULT, Lang.bind(this, function() {
-            this._world.currentLocationChanged(null);
-        }));
-    },
-
-    _onSimpleReady: function(object, result) {
-        try {
-            this._simple = Geoclue.Simple.new_finish(result);
-        }
-        catch (e) {
-            this._geoLocationFailed(e);
-            return;
-        }
-
-        let client = this._simple.get_client();
-        client.distance_threshold = 100;
-
-        this._findLocation();
-    },
-
-    _findLocation: function() {
-        this._locationUpdatedId =
-                    this._simple.connect("notify::location",
-                                         this._onLocationUpdated.bind(this));
-
-        this._onLocationUpdated(this._simple);
-    },
-
-    _onLocationUpdated: function(simple) {
-        let geoclueLocation = simple.get_location();
-
-        this.currentLocation = GWeather.Location.new_detached(geoclueLocation.description,
-                                                              null,
-                                                              geoclueLocation.latitude,
-                                                              geoclueLocation.longitude);
-        this._world.currentLocationChanged(this.currentLocation);
-    },
-
-    setAutoLocation: function(active) {
-        this._settings.set_value('automatic-location', new GLib.Variant('b', active));
-
-        if (this.autoLocation == AutoLocation.NOT_AVAILABLE)
-            return;
-        this._autoLocationChanged(active);
-        this._syncAutoLocation(active);
-    },
-
-    _syncAutoLocation: function(autoLocation) {
-        if (autoLocation)
-            this.autoLocation = AutoLocation.ENABLED;
-        else
-            this.autoLocation = AutoLocation.DISABLED;
-    },
-
-    _autoLocationChanged: function(active) {
-        if (active) {
-            if (!this._processStarted) {
-                this._startGeolocationService();
-            } else {
-                this._locationUpdatedId =
-                    this._simple.connect("notify::location",
-                                         this._onLocationUpdated.bind(this));
-            }
-        } else {
-            this._simple.disconnect(this._locationUpdatedId);
-        }
-    }
 });