[gnome-calendar] time-zone-monitor: Use local timezone as fallback without dbus service
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] time-zone-monitor: Use local timezone as fallback without dbus service
- Date: Sun, 11 Apr 2021 00:34:31 +0000 (UTC)
commit fb242dd109eb4264d2320c6c63867d01b5c25c27
Author: Sebastian Keller <skeller gnome org>
Date: Mon Apr 5 22:49:17 2021 +0200
time-zone-monitor: Use local timezone as fallback without dbus service
On systems without anything providing the org.freedesktop.timedate1
interface, the timezone returned by the monitor would always be NULL,
because it was never set. This can lead to crashes in places that expect
the monitor to always return a valid timezone. So in that case use the
local timezone from when the monitor got initialized.
Fixes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/703
src/core/gcal-time-zone-monitor.c | 2 ++
1 file changed, 2 insertions(+)
---
diff --git a/src/core/gcal-time-zone-monitor.c b/src/core/gcal-time-zone-monitor.c
index 745a71d6..d82bf8f0 100644
--- a/src/core/gcal-time-zone-monitor.c
+++ b/src/core/gcal-time-zone-monitor.c
@@ -139,6 +139,8 @@ gcal_time_zone_monitor_init (GcalTimeZoneMonitor *self)
GCAL_ENTRY;
+ self->timezone = g_time_zone_new_local ();
+
connection = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, NULL);
if (!connection)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]