commit 3e5706b06316238b3ab16a34bb3f1a8de3304b74
parent 9d73c50d6dcfb578bf8d65d066c867dea85a7a85
Author: Jonathan Boeing <jonathan@claws-mail.org>
Date: Sun, 12 Sep 2021 03:09:55 -0700
Fix messageview_date_format on Windows
Bug 4535 'Setting msgview_date_format=1 does not work'
Call procheader_date_get_localtime() for Windows as well.
Also fix deprecation warning for g_time_zone_new()
Diffstat:
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/procheader.c b/src/procheader.c
@@ -1130,7 +1130,13 @@ time_t procheader_date_parse(gchar *dest, const gchar *src, gint len)
GTimeZone *tz;
GDateTime *dt, *dt2;
+#if GLIB_CHECK_VERSION(2,68,0)
+ tz = g_time_zone_new_identifier(zone);
+ if (tz == NULL)
+ tz = g_time_zone_new_utc();
+#else
tz = g_time_zone_new(zone); // can't return NULL no need to check for it
+#endif
dt = g_date_time_new(tz, 1, 1, 1, 0, 0, 0);
g_time_zone_unref(tz);
dt2 = g_date_time_add_full(dt, year-1, dmonth-1, day-1, hh, mm, ss);
@@ -1166,9 +1172,9 @@ time_t procheader_date_parse(gchar *dest, const gchar *src, gint len)
if (tz_offset != -1)
timer += tzoffset_sec(&timer) - tz_offset;
+#endif
if (dest)
procheader_date_get_localtime(dest, len, timer);
-#endif
return timer;
}