diff options
author | Florian Müllner <fmuellner@gnome.org> | 2019-04-12 02:10:04 +0200 |
---|---|---|
committer | Florian Müllner <fmuellner@gnome.org> | 2019-04-12 03:17:35 +0200 |
commit | 22883f2fa200c0dcfe3b46bd9c08efcd48a69bd5 (patch) | |
tree | 5f47b1a2fad1054a6588e378977938e7d171937e | |
parent | 5d9f80bc735921089d2a5c03d84264d5df883c57 (diff) | |
download | gnome-shell-22883f2fa200c0dcfe3b46bd9c08efcd48a69bd5.tar.gz |
dateMenu: Make sure we always display a clock name
We currently use the city name for all location except named timezones.
However locations only have a city name if they are of level CITY or
DETACHED, or if they are of level WEATHER_STATION with a parent of level
CITY.
So when libgweather commit d7682676ac9 moved weather station locations from
cities to countries, it broke their names in the world clocks section.
To fix this, stop making assumptions about when we can use the city name
and simply try it first for all locations and fall back to the plain name
if its not available.
https://gitlab.gnome.org/GNOME/gnome-shell/issues/1150
-rw-r--r-- | js/ui/dateMenu.js | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/js/ui/dateMenu.js b/js/ui/dateMenu.js index 697d6fbc8..f46ed2d3a 100644 --- a/js/ui/dateMenu.js +++ b/js/ui/dateMenu.js @@ -139,8 +139,7 @@ var WorldClocksSection = class WorldClocksSection { for (let i = 0; i < this._locations.length; i++) { let l = this._locations[i].location; - let name = l.get_level() == GWeather.LocationLevel.NAMED_TIMEZONE ? l.get_name() - : l.get_city_name(); + let name = l.get_city_name() || l.get_name(); let label = new St.Label({ style_class: 'world-clocks-city', text: name, x_align: Clutter.ActorAlign.START, |