summaryrefslogtreecommitdiff
path: root/nonprism/gnome-weather/nonprism.patch
diff options
context:
space:
mode:
Diffstat (limited to 'nonprism/gnome-weather/nonprism.patch')
-rw-r--r--nonprism/gnome-weather/nonprism.patch156
1 files changed, 78 insertions, 78 deletions
diff --git a/nonprism/gnome-weather/nonprism.patch b/nonprism/gnome-weather/nonprism.patch
index df6da2e9e..985a4bd35 100644
--- a/nonprism/gnome-weather/nonprism.patch
+++ b/nonprism/gnome-weather/nonprism.patch
@@ -1,69 +1,77 @@
-diff --git a/configure.ac b/configure.ac
-index f5810bd5d..d3d20a540 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 3cd54ba2e..9d59b4699 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
+diff --git a/data/org.gnome.Weather.desktop.in.in b/data/org.gnome.Weather.desktop.in.in
+index 021e0d5..3f5c4a4 100644
+--- a/data/org.gnome.Weather.desktop.in.in
++++ b/data/org.gnome.Weather.desktop.in.in
+@@ -10,6 +10,5 @@ StartupNotify=true
Categories=GNOME;GTK;Utility;Core;
- _Keywords=Weather;Forecast;
--_X-Geoclue-Reason=Allows weather information to be displayed for your location.
+ # Translators: Search terms to find this application. Do NOT translate or localize the semicolons! The list MUST also end with a semicolon!
+ Keywords=Weather;Forecast;
+-X-Geoclue-Reason=Allows weather information to be displayed for your location.
+ # Translators: Do NOT translate or transliterate this text (these are enum types)!
+ X-Purism-FormFactor=Workstation;Mobile;
+
+diff --git a/meson.build b/meson.build
+index 62d6594..f17fabe 100644
+--- a/meson.build
++++ b/meson.build
+@@ -11,7 +11,6 @@ dependency('glib-2.0')
+ dependency('gobject-introspection-1.0', version: '>=1.35.9')
+ dependency('gtk4', version :'>=4.5')
+ gjs = dependency('gjs-1.0', version: '>= 1.71.0')
+-dependency('libgeoclue-2.0', version: '>= 0.12.99')
+ dependency('libadwaita-1', version: '>= 1.4.alpha')
+ dependency('gweather4', version: '>= 3.90.0')
+
diff --git a/src/app/currentLocationController.js b/src/app/currentLocationController.js
-index c070598b3..10b436d54 100644
+index 772b9b5..2332157 100644
--- a/src/app/currentLocationController.js
+++ b/src/app/currentLocationController.js
-@@ -20,104 +20,14 @@ const GLib = imports.gi.GLib;
- const Gio = imports.gi.Gio;
- const Lang = imports.lang;
- const GWeather = imports.gi.GWeather;
--const Geoclue = imports.gi.Geoclue;
+@@ -18,7 +18,6 @@
- const Util = imports.misc.util;
+ import GLib from 'gi://GLib';
+ import GWeather from 'gi://GWeather';
+-import Geoclue from 'gi://Geoclue';
--var AutoLocation = {
-- DISABLED: 0,
-- ENABLED: 1,
-- NOT_AVAILABLE: 2
--};
--
- var CurrentLocationController = class CurrentLocationController {
- constructor(world) {
- this._world = world;
+ import * as Util from '../misc/util.js';
+ export class CurrentLocationController {
+@@ -27,92 +26,12 @@ export class CurrentLocationController {
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._settings = Util.getSettings('org.gnome.Weather');
+
+- this.autoLocationAvailable = false;
+- this._startGeolocationService();
this.currentLocation = null;
- }
--
+- }
+
- _startGeolocationService() {
- this._processStarted = true;
-- Geoclue.Simple.new(pkg.name,
-- Geoclue.AccuracyLevel.CITY,
-- null,
-- this._onSimpleReady.bind(this));
+- if (Geoclue.Simple.new_with_thresholds) {
+- Geoclue.Simple.new_with_thresholds(pkg.name,
+- Geoclue.AccuracyLevel.CITY,
+- 0, /* time threshold */
+- 100, /* distance threshold */
+- null,
+- (object, result) => {
+- this._onSimpleReady(object, result)
+- });
+- } else {
+- Geoclue.Simple.new(pkg.name,
+- Geoclue.AccuracyLevel.CITY,
+- null,
+- (object, result) => {
+- this._onSimpleReady(object, result)
+- });
+- }
- }
-
- _geoLocationFailed(e) {
- log ("Failed to connect to GeoClue2 service: " + e.message);
-- this.autoLocation = AutoLocation.NOT_AVAILABLE;
-- GLib.idle_add(GLib.PRIORITY_DEFAULT, () => {
-- this._world.currentLocationChanged(null);
-- });
-- }
++ log ("GeoClue2 service disabled");
+ this.autoLocationAvailable = false;
+ GLib.idle_add(GLib.PRIORITY_DEFAULT, () => {
+ this._world.currentLocationChanged(null);
+ });
+ }
-
- _onSimpleReady(object, result) {
- try {
@@ -74,16 +82,22 @@ index c070598b3..10b436d54 100644
- return;
- }
-
-- let client = this._simple.get_client();
-- client.distance_threshold = 100;
+- // geoclue doesn't use a client proxy inside a flatpak sandbox
+- if (this._simple.client && !Geoclue.Simple.new_with_thresholds) {
+- let client = this._simple.get_client();
+- client.distance_threshold = 100;
+- }
-
- this._findLocation();
+-
+- this.autoLocationAvailable = true;
- }
-
- _findLocation() {
- this._locationUpdatedId =
-- this._simple.connect("notify::location",
-- this._onLocationUpdated.bind(this));
+- this._simple.connect("notify::location", (simple) => {
+- this._onLocationUpdated(simple);
+- });
-
- this._onLocationUpdated(this._simple);
- }
@@ -91,37 +105,23 @@ index c070598b3..10b436d54 100644
- _onLocationUpdated(simple) {
- let geoclueLocation = simple.get_location();
-
-- this.currentLocation = GWeather.Location.new_detached(geoclueLocation.description,
-- null,
-- geoclueLocation.latitude,
-- geoclueLocation.longitude);
+- this.currentLocation = GWeather.Location.get_world()
+- .find_nearest_city(
+- geoclueLocation.latitude,
+- geoclueLocation.longitude
+- );
- this._world.currentLocationChanged(this.currentLocation);
- }
-
-- setAutoLocation(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(autoLocation) {
-- if (autoLocation)
-- this.autoLocation = AutoLocation.ENABLED;
-- else
-- this.autoLocation = AutoLocation.DISABLED;
-- }
--
- _autoLocationChanged(active) {
- if (active) {
- if (!this._processStarted) {
- this._startGeolocationService();
- } else {
- this._locationUpdatedId =
-- this._simple.connect("notify::location",
-- this._onLocationUpdated.bind(this));
+- this._simple.connect("notify::location", (simple) => {
+- this._onLocationUpdated(simple);
+- });
- }
- } else {
- this._simple.disconnect(this._locationUpdatedId);