[evolution/gnome-3-8] Only use the alarm description if the client supports it
- From: Fabiano Fidêncio <ffidencio src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/gnome-3-8] Only use the alarm description if the client supports it
- Date: Wed, 24 Jul 2013 13:48:26 +0000 (UTC)
commit f81c52332e44e2b1ae1d7ef2e91c719fb207ed5c
Author: Fabiano Fidêncio <fidencio redhat com>
Date: Wed Jul 24 11:46:42 2013 +0200
Only use the alarm description if the client supports it
https://bugzilla.gnome.org/show_bug.cgi?id=386113
calendar/alarm-notify/alarm-queue.c | 23 ++++++++++++++---------
1 files changed, 14 insertions(+), 9 deletions(-)
---
diff --git a/calendar/alarm-notify/alarm-queue.c b/calendar/alarm-notify/alarm-queue.c
index 87b6e92..20bf1fd 100644
--- a/calendar/alarm-notify/alarm-queue.c
+++ b/calendar/alarm-notify/alarm-queue.c
@@ -1594,7 +1594,8 @@ tray_list_add_new (TrayIconData *data)
}
static void
-alarm_queue_get_alarm_summary (ECalComponent *comp,
+alarm_queue_get_alarm_summary (ECalClient *cal_client,
+ ECalComponent *comp,
const ECalComponentAlarmInstance *instance,
ECalComponentText *text,
ECalComponentAlarm **palarm)
@@ -1607,12 +1608,16 @@ alarm_queue_get_alarm_summary (ECalComponent *comp,
text->value = NULL;
- *palarm = e_cal_component_get_alarm (comp, instance->auid);
- if (*palarm) {
- e_cal_component_alarm_get_description (*palarm, text);
- if (!text->value || !*text->value) {
- text->value = NULL;
- e_cal_component_alarm_free (*palarm);
+ if (e_client_check_capability (E_CLIENT (cal_client), "alarm-description")) {
+ *palarm = e_cal_component_get_alarm (comp, instance->auid);
+ if (*palarm) {
+ e_cal_component_alarm_get_description (*palarm, text);
+ if (!text->value || !*text->value) {
+ text->value = NULL;
+ e_cal_component_alarm_free (*palarm);
+ *palarm = NULL;
+ }
+ } else {
*palarm = NULL;
}
}
@@ -1647,7 +1652,7 @@ display_notification (time_t trigger,
return;
/* get a sensible description for the event */
- alarm_queue_get_alarm_summary (comp, qa->instance, &text, &comp_alarm);
+ alarm_queue_get_alarm_summary (cqa->parent_client->cal_client, comp, qa->instance, &text,
&comp_alarm);
e_cal_component_get_organizer (comp, &organiser);
if (text.value)
@@ -1785,7 +1790,7 @@ popup_notification (time_t trigger,
notify_init (_("Evolution Reminders"));
/* get a sensible description for the event */
- alarm_queue_get_alarm_summary (comp, qa->instance, &text, &comp_alarm);
+ alarm_queue_get_alarm_summary (cqa->parent_client->cal_client, comp, qa->instance, &text,
&comp_alarm);
e_cal_component_get_organizer (comp, &organiser);
if (text.value)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]