aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-meeting-store.c
diff options
context:
space:
mode:
authorChristian Hilberg <chilberg@src.gnome.org>2012-11-26 19:15:58 +0800
committerMilan Crha <mcrha@redhat.com>2012-11-26 19:15:58 +0800
commit51ca0952f4b694f25cdfe774dfd8498c916101a7 (patch)
tree67c3255316274f060676dd179372a1514525a213 /calendar/gui/e-meeting-store.c
parent629a2d6a76cc7ae225706f83bd38b353b82239da (diff)
downloadgsoc2013-evolution-51ca0952f4b694f25cdfe774dfd8498c916101a7.tar
gsoc2013-evolution-51ca0952f4b694f25cdfe774dfd8498c916101a7.tar.gz
gsoc2013-evolution-51ca0952f4b694f25cdfe774dfd8498c916101a7.tar.bz2
gsoc2013-evolution-51ca0952f4b694f25cdfe774dfd8498c916101a7.tar.lz
gsoc2013-evolution-51ca0952f4b694f25cdfe774dfd8498c916101a7.tar.xz
gsoc2013-evolution-51ca0952f4b694f25cdfe774dfd8498c916101a7.tar.zst
gsoc2013-evolution-51ca0952f4b694f25cdfe774dfd8498c916101a7.zip
Bug #687974 - No displaying of extended free/busy (XFB) information
Diffstat (limited to 'calendar/gui/e-meeting-store.c')
-rw-r--r--calendar/gui/e-meeting-store.c67
1 files changed, 54 insertions, 13 deletions
diff --git a/calendar/gui/e-meeting-store.c b/calendar/gui/e-meeting-store.c
index d215b2decc..b8e065e2dd 100644
--- a/calendar/gui/e-meeting-store.c
+++ b/calendar/gui/e-meeting-store.c
@@ -1340,6 +1340,31 @@ process_callbacks (EMeetingStoreQueueData *qdata)
}
static void
+process_free_busy_comp_get_xfb (icalproperty *ip,
+ gchar **summary,
+ gchar **location)
+{
+ const gchar *tmp = NULL;
+
+ g_return_if_fail (ip != NULL);
+ g_return_if_fail (summary != NULL && *summary == NULL);
+ g_return_if_fail (location != NULL && *location == NULL);
+
+ /* We extract extended free/busy information from the icalproperty
+ * here (X-SUMMARY and X-LOCATION). If the property carries such,
+ * it will be displayed as a tooltip for the busy period. Otherwise,
+ * nothing will happen (*summary and/or *location will be NULL)
+ */
+
+ tmp = icalproperty_get_parameter_as_string (ip, E_MEETING_FREE_BUSY_XPROP_SUMMARY);
+ *summary = e_meeting_xfb_utf8_string_new_from_ical (tmp,
+ E_MEETING_FREE_BUSY_XPROP_MAXLEN);
+ tmp = icalproperty_get_parameter_as_string (ip, E_MEETING_FREE_BUSY_XPROP_LOCATION);
+ *location = e_meeting_xfb_utf8_string_new_from_ical (tmp,
+ E_MEETING_FREE_BUSY_XPROP_MAXLEN);
+}
+
+static void
process_free_busy_comp (EMeetingAttendee *attendee,
icalcomponent *fb_comp,
icaltimezone *zone,
@@ -1422,22 +1447,38 @@ process_free_busy_comp (EMeetingAttendee *attendee,
if (busy_type != E_MEETING_FREE_BUSY_LAST) {
icaltimezone *utc_zone = icaltimezone_get_utc_timezone ();
+ gchar *summary = NULL;
+ gchar *location = NULL;
icaltimezone_convert_time (&fb.start, utc_zone, zone);
icaltimezone_convert_time (&fb.end, utc_zone, zone);
- e_meeting_attendee_add_busy_period (
- attendee,
- fb.start.year,
- fb.start.month,
- fb.start.day,
- fb.start.hour,
- fb.start.minute,
- fb.end.year,
- fb.end.month,
- fb.end.day,
- fb.end.hour,
- fb.end.minute,
- busy_type);
+
+ /* Extract extended free/busy (XFB) information from
+ * the icalproperty, if it carries such.
+ * See the comment for the EMeetingXfbData structure
+ * for a reference.
+ */
+ process_free_busy_comp_get_xfb (ip, &summary, &location);
+
+ e_meeting_attendee_add_busy_period (attendee,
+ fb.start.year,
+ fb.start.month,
+ fb.start.day,
+ fb.start.hour,
+ fb.start.minute,
+ fb.end.year,
+ fb.end.month,
+ fb.end.day,
+ fb.end.hour,
+ fb.end.minute,
+ busy_type,
+ summary,
+ location);
+
+ if (summary != NULL)
+ g_free (summary);
+ if (location != NULL)
+ g_free (location);
}
ip = icalcomponent_get_next_property (fb_comp, ICAL_FREEBUSY_PROPERTY);