From 1fb98cded4f34135dfa99b0b6ce8eb7c1c8152e0 Mon Sep 17 00:00:00 2001 From: rbuj Date: Thu, 25 Mar 2021 09:34:10 +0100 Subject: time-admin: g_time_zone_new is deprecated from glib 2.68 --- capplets/time-admin/src/time-zone.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'capplets/time-admin/src') 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); -- cgit v1.2.1