aboutsummaryrefslogtreecommitdiff
path: root/src/engine-eds.cpp
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2014-07-01 09:36:47 +0000
committerCI bot <ps-jenkins@lists.canonical.com>2014-07-01 09:36:47 +0000
commit6880613bbc6535242e95e7f5c65d9a9140eaa28b (patch)
treea5302d6eaa5005ec44b6498566f00e4237e697d8 /src/engine-eds.cpp
parentf6778e1cc3e3881225e967c94de4685c732755db (diff)
parentea8bedf5ec63ca42de776de9f4c21343a8163578 (diff)
downloadayatana-indicator-datetime-6880613bbc6535242e95e7f5c65d9a9140eaa28b.tar.gz
ayatana-indicator-datetime-6880613bbc6535242e95e7f5c65d9a9140eaa28b.tar.bz2
ayatana-indicator-datetime-6880613bbc6535242e95e7f5c65d9a9140eaa28b.zip
Add the ability to have per-alarm custom sounds. Fixes: 1318997
Diffstat (limited to 'src/engine-eds.cpp')
-rw-r--r--src/engine-eds.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/engine-eds.cpp b/src/engine-eds.cpp
index 1949193..80a47da 100644
--- a/src/engine-eds.cpp
+++ b/src/engine-eds.cpp
@@ -443,8 +443,9 @@ private:
appointment.color = subtask->color;
appointment.uid = uid;
- // if the component has display alarms that have a url,
- // use the first one as our Appointment.url
+ // Look through all of this component's alarms
+ // for DISPLAY or AUDIO url attachments.
+ // If we find any, use them for appointment.url and audio_sound
auto alarm_uids = e_cal_component_get_alarm_uids(component);
appointment.has_alarms = alarm_uids != nullptr;
for(auto walk=alarm_uids; appointment.url.empty() && walk!=nullptr; walk=walk->next)
@@ -453,7 +454,7 @@ private:
ECalComponentAlarmAction action;
e_cal_component_alarm_get_action(alarm, &action);
- if (action == E_CAL_COMPONENT_ALARM_DISPLAY)
+ if ((action == E_CAL_COMPONENT_ALARM_DISPLAY) || (action == E_CAL_COMPONENT_ALARM_AUDIO))
{
icalattach* attach = nullptr;
e_cal_component_alarm_get_attach(alarm, &attach);
@@ -463,7 +464,16 @@ private:
{
const char* url = icalattach_get_url(attach);
if (url != nullptr)
- appointment.url = url;
+ {
+ if ((action == E_CAL_COMPONENT_ALARM_DISPLAY) && appointment.url.empty())
+ {
+ appointment.url = url;
+ }
+ else if ((action == E_CAL_COMPONENT_ALARM_AUDIO) && appointment.audio_url.empty())
+ {
+ appointment.audio_url = url;
+ }
+ }
}
icalattach_unref(attach);