[gnome-clocks] world: fix GLib.TimeZone.new warnings
- From: Zander Brown <zbrown src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-clocks] world: fix GLib.TimeZone.new warnings
- Date: Sat, 3 Apr 2021 10:42:27 +0000 (UTC)
commit cc5a497c56ff6cf73355bc9eb8d7bdafa4860875
Author: Yetizone <andreii lisita gmail com>
Date: Fri Apr 2 19:55:25 2021 +0300
world: fix GLib.TimeZone.new warnings
GLib.TimeZone.new is deprecated, see https://valadoc.org/glib-2.0/GLib.TimeZone.TimeZone.html
Also bump min GLib version
meson.build | 2 +-
src/world-item.vala | 2 +-
src/world-location-dialog-row.vala | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/meson.build b/meson.build
index 91e34cd..5793c40 100644
--- a/meson.build
+++ b/meson.build
@@ -10,7 +10,7 @@ gnome = import('gnome')
i18n = import('i18n')
python3 = import('python3')
-glib = dependency('glib-2.0', version: '>= 2.58')
+glib = dependency('glib-2.0', version: '>= 2.68')
gio = dependency('gio-2.0', version: '>= 2.58')
gobject = dependency('gobject-2.0', version: '>= 2.58')
gtk = dependency('gtk+-3.0', version: '>=3.20')
diff --git a/src/world-item.vala b/src/world-item.vala
index ebc345e..c2f61b3 100644
--- a/src/world-item.vala
+++ b/src/world-item.vala
@@ -218,7 +218,7 @@ public class Item : Object, ContentItem {
var weather_time_zone = location.get_timezone_str ();
if (weather_time_zone != null) {
- time_zone = new GLib.TimeZone ((string) weather_time_zone);
+ time_zone = new GLib.TimeZone.identifier ((string) weather_time_zone);
if (time_zone == null) {
warning ("Unrecognised timezone %s",
(string) weather_time_zone);
diff --git a/src/world-location-dialog-row.vala b/src/world-location-dialog-row.vala
index e7ea7ae..0babc98 100644
--- a/src/world-location-dialog-row.vala
+++ b/src/world-location-dialog-row.vala
@@ -38,7 +38,7 @@ private class LocationDialogRow : Gtk.ListBoxRow {
var local_time = wallclock.date_time;
var weather_time_zone = data.location.get_timezone ();
if (weather_time_zone != null) {
- var time_zone = new TimeZone (((GWeather.Timezone) weather_time_zone).get_tzid ());
+ var time_zone = new TimeZone.identifier (((GWeather.Timezone) weather_time_zone).get_tzid ());
var date_time = local_time.to_timezone (time_zone);
var local_offset = local_time.get_utc_offset () - date_time.get_utc_offset ();
var time_diff_message = Utils.get_time_difference_message (local_offset);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]