[gnome-clocks] world: Fix named timezones appearing with no name
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-clocks] world: Fix named timezones appearing with no name
- Date: Wed, 6 Dec 2017 14:23:51 +0000 (UTC)
commit 9a356755e890362262fcdc6b30c137195c8feb4b
Author: Bastien Nocera <hadess hadess net>
Date: Wed Dec 6 15:19:30 2017 +0100
world: Fix named timezones appearing with no name
Named timezones don't have city names, as they're not cities. Fall back
to the timezone name in that case.
See https://bugzilla.gnome.org/show_bug.cgi?id=692243
https://bugzilla.gnome.org/show_bug.cgi?id=791308
src/world.vala | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/world.vala b/src/world.vala
index 432de2c..c1d1eb9 100644
--- a/src/world.vala
+++ b/src/world.vala
@@ -51,7 +51,12 @@ public class Item : Object, ContentItem {
public string city_name {
owned get {
- return location.get_city_name ();
+ var city_name = location.get_city_name ();
+ /* Named Timezones don't have city names */
+ if (city_name == null) {
+ city_name = location.get_name ();
+ }
+ return city_name;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]