summaryrefslogtreecommitdiff
path: root/capplets/time-admin/src/time-zone.c
diff options
context:
space:
mode:
authorrbuj <[email protected]>2021-03-25 09:34:10 +0100
committerraveit65 <[email protected]>2021-04-04 22:22:39 +0200
commit1fb98cded4f34135dfa99b0b6ce8eb7c1c8152e0 (patch)
treeed18de16216ab2156d19fa6bf03f4603232c5a21 /capplets/time-admin/src/time-zone.c
parent491939a5b29cd8b3d243de0524d0e1116a1ee540 (diff)
downloadmate-control-center-1fb98cded4f34135dfa99b0b6ce8eb7c1c8152e0.tar.bz2
mate-control-center-1fb98cded4f34135dfa99b0b6ce8eb7c1c8152e0.tar.xz
time-admin: g_time_zone_new is deprecated from glib 2.68
Diffstat (limited to 'capplets/time-admin/src/time-zone.c')
-rw-r--r--capplets/time-admin/src/time-zone.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/capplets/time-admin/src/time-zone.c b/capplets/time-admin/src/time-zone.c
index e359cbe0..08e89e8e 100644
--- a/capplets/time-admin/src/time-zone.c
+++ b/capplets/time-admin/src/time-zone.c
@@ -296,7 +296,16 @@ update_timezone (TimezoneMap *map)
current_location = timezone_map_get_location (TIMEZONEMAP (map));
city_country = translated_city_name (current_location);
+#if GLIB_CHECK_VERSION (2, 68, 0)
+ if ((timezone = g_time_zone_new_identifier (current_location->zone)) == NULL) {
+ timezone_map_set_bubble_text (TIMEZONEMAP (map),
+ _("Error: timezone identifier cannot be parsed or loaded"));
+ return;
+ }
+#else
timezone = g_time_zone_new (current_location->zone);
+#endif
+
current_date = g_date_time_new_now_local ();
date = g_date_time_to_timezone (current_date, timezone);