[gnome-shell/cherry-pick-50b77390] worldClocks: Ignore locations with unknown timezone
- From: Iain Lane <iainl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/cherry-pick-50b77390] worldClocks: Ignore locations with unknown timezone
- Date: Tue, 7 May 2019 09:26:08 +0000 (UTC)
commit a1af8b94fda59c70fa5ac0b12b956b52d2b15795
Author: Florian Müllner <fmuellner gnome org>
Date: Sun Apr 28 10:33:41 2019 +0000
worldClocks: Ignore locations with unknown timezone
We currently assume that every location has an associated timezone.
While this is sound in the real world, in practise it depends on
whether or not libgweather can find a corresponding timezone DB
entry.
This used to be a fringe case, but has become more likely when commit
https://gitlab.gnome.org/GNOME/libgweather/commit/d7682676ac9 moved
weather stations from cities to countries - the station itself is un-
likely to have a timezone entry, and the country may be part of more
than a single timezone.
It would be good for libgweather to return a timezone for those
locations again, but we should defend against the case anyway.
We cannot tell what time it is at a particular location without
knowing the timezone, so simply filter them out.
https://gitlab.gnome.org/GNOME/gnome-shell/issues/1062
(cherry picked from commit 50b77390761192b27305045f7ee4c80e60b9cff0)
js/ui/dateMenu.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/js/ui/dateMenu.js b/js/ui/dateMenu.js
index fb32fbb2f..06ea2b5a4 100644
--- a/js/ui/dateMenu.js
+++ b/js/ui/dateMenu.js
@@ -118,7 +118,7 @@ var WorldClocksSection = class WorldClocksSection {
if (!clocks[i].location)
continue;
let l = world.deserialize(clocks[i].location);
- if (l)
+ if (l && l.get_timezone() != null)
this._locations.push({ location: l });
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]