[evolution-data-server] Prefer built-in timezone component in e_cal_util_copy_timezone()
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Prefer built-in timezone component in e_cal_util_copy_timezone()
- Date: Wed, 26 Jun 2019 16:35:35 +0000 (UTC)
commit d73d74bc4ce58d71f7bb4fa494ad695931638f6e
Author: Milan Crha <mcrha redhat com>
Date: Wed Jun 26 18:35:55 2019 +0200
Prefer built-in timezone component in e_cal_util_copy_timezone()
This way also latitude and longitude properties are provided. It also
makes the copied timezone more accurate to the built-in.
src/calendar/libecal/e-cal-util.c | 9 +++++++++
1 file changed, 9 insertions(+)
---
diff --git a/src/calendar/libecal/e-cal-util.c b/src/calendar/libecal/e-cal-util.c
index ce0f60164..2a91f7e46 100644
--- a/src/calendar/libecal/e-cal-util.c
+++ b/src/calendar/libecal/e-cal-util.c
@@ -120,6 +120,15 @@ e_cal_util_copy_timezone (const ICalTimezone *zone)
if (!zone_copy)
return NULL;
+ /* If the original component is one of the built-in, then libcal
+ loads it during the i_cal_timezone_get_component() call and
+ assigns a component to it. */
+ comp = i_cal_timezone_get_component (zone_copy);
+ if (comp) {
+ g_object_unref (comp);
+ return zone_copy;
+ }
+
comp = i_cal_timezone_get_component (zone);
if (comp) {
ICalComponent *comp_copy;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]