evolution/evolution-no-DTEND-set.patch

83 lines
2.8 KiB
Diff
Raw Normal View History

From 96fd44260970317472ea5d672c3edefaa9faec19 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Erick=20P=C3=A9rez=20Castellanos?= <erick.red@gmail.com>
Date: Tue, 9 Dec 2014 15:59:30 +0100
Subject: ECalModel: Workaround issue with no DTEND set
diff --git a/calendar/gui/e-cal-model.c b/calendar/gui/e-cal-model.c
index 05ffef5..afdec4c 100644
--- a/calendar/gui/e-cal-model.c
+++ b/calendar/gui/e-cal-model.c
@@ -4281,6 +4281,10 @@ e_cal_model_set_instance_times (ECalModelComponent *comp_data,
}
}
+ /* Some events can have missing DTEND, then use the start_time for them */
+ if (icaltime_is_null_time (end_time))
+ end_time = start_time;
+
if (start_time.zone)
zone = start_time.zone;
else {
--
cgit v0.10.1
From 012fa7ddfdf43b77d40449a28c26cb45b981a421 Mon Sep 17 00:00:00 2001
From: Milan Crha <mcrha@redhat.com>
Date: Tue, 9 Dec 2014 15:51:59 +0100
Subject: e_calendar_view_get_tooltips: Do not crash when there's no DTEND set
diff --git a/calendar/gui/e-calendar-view.c b/calendar/gui/e-calendar-view.c
index 686327a..365b63c 100644
--- a/calendar/gui/e-calendar-view.c
+++ b/calendar/gui/e-calendar-view.c
@@ -2157,24 +2157,30 @@ e_calendar_view_get_tooltips (const ECalendarViewEventData *data)
} else {
zone = NULL;
}
- t_start = icaltime_as_timet_with_zone (*dtstart.value, zone);
- t_end = icaltime_as_timet_with_zone (*dtend.value, zone);
- tmp1 = get_label (dtstart.value, zone, default_zone);
- tmp = calculate_time (t_start, t_end);
+ if (dtstart.value) {
+ t_start = icaltime_as_timet_with_zone (*dtstart.value, zone);
+ if (dtend.value)
+ t_end = icaltime_as_timet_with_zone (*dtend.value, zone);
+ else
+ t_end = t_start;
- /* To Translators: It will display "Time: ActualStartDateAndTime (DurationOfTheMeeting)"*/
- tmp2 = g_strdup_printf (_("Time: %s %s"), tmp1, tmp);
- if (zone && !cal_comp_util_compare_event_timezones (newcomp, client, default_zone)) {
- g_free (tmp);
- g_free (tmp1);
+ tmp1 = get_label (dtstart.value, zone, default_zone);
+ tmp = calculate_time (t_start, t_end);
- tmp1 = get_label (dtstart.value, zone, zone);
- tmp = g_strconcat (tmp2, "\n\t[ ", tmp1, " ", icaltimezone_get_display_name (zone), " ]", NULL);
- } else {
- g_free (tmp);
- tmp = tmp2;
- tmp2 = NULL;
+ /* To Translators: It will display "Time: ActualStartDateAndTime (DurationOfTheMeeting)"*/
+ tmp2 = g_strdup_printf (_("Time: %s %s"), tmp1, tmp);
+ if (zone && !cal_comp_util_compare_event_timezones (newcomp, client, default_zone)) {
+ g_free (tmp);
+ g_free (tmp1);
+
+ tmp1 = get_label (dtstart.value, zone, zone);
+ tmp = g_strconcat (tmp2, "\n\t[ ", tmp1, " ", icaltimezone_get_display_name (zone), " ]", NULL);
+ } else {
+ g_free (tmp);
+ tmp = tmp2;
+ tmp2 = NULL;
+ }
}
e_cal_component_free_datetime (&dtstart);
--
cgit v0.10.1