[gnome-shell] dateMenu: Make sure we always display a clock name



commit 22883f2fa200c0dcfe3b46bd9c08efcd48a69bd5
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Apr 12 02:10:04 2019 +0200

    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

 js/ui/dateMenu.js | 3 +--
 1 file changed, 1 insertion(+), 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,


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