aboutsummaryrefslogtreecommitdiff
path: root/src/engine-eds.cpp
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2015-03-24 13:42:16 -0500
committerCharles Kerr <charles.kerr@canonical.com>2015-03-24 13:42:16 -0500
commitb115811bcafc3ce5193dc75cb7929a8f3f2cba00 (patch)
tree5f70ec948bd8aa77ed158a7ef76b9f195c18ac52 /src/engine-eds.cpp
parent3c5eda144d9d83be1aef24afaa307999975ec617 (diff)
downloadayatana-indicator-datetime-b115811bcafc3ce5193dc75cb7929a8f3f2cba00.tar.gz
ayatana-indicator-datetime-b115811bcafc3ce5193dc75cb7929a8f3f2cba00.tar.bz2
ayatana-indicator-datetime-b115811bcafc3ce5193dc75cb7929a8f3f2cba00.zip
add support for an x-canonical-app-url x-prop when reading vtodos/vevents from EDS
Diffstat (limited to 'src/engine-eds.cpp')
-rw-r--r--src/engine-eds.cpp24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/engine-eds.cpp b/src/engine-eds.cpp
index 47c7a9b..8408a57 100644
--- a/src/engine-eds.cpp
+++ b/src/engine-eds.cpp
@@ -33,8 +33,10 @@ namespace unity {
namespace indicator {
namespace datetime {
-static constexpr char const * TAG_ALARM {"x-canonical-alarm"};
-static constexpr char const * TAG_DISABLED {"x-canonical-disabled"};
+static constexpr char const * TAG_ALARM {"x-canonical-alarm"};
+static constexpr char const * TAG_DISABLED {"x-canonical-disabled"};
+
+static constexpr char const * X_PROP_APP_URL {"x-canonical-app-url"};
/****
*****
@@ -469,6 +471,24 @@ private:
if (text.value)
appointment.summary = text.value;
+ auto icc = e_cal_component_get_icalcomponent(component); // component owns icc
+ if (icc)
+ {
+ auto icalprop = icalcomponent_get_first_property(icc, ICAL_X_PROPERTY);
+ while (icalprop)
+ {
+ const char * x_name = icalproperty_get_x_name(icalprop);
+ if (!g_strcmp0(x_name, X_PROP_APP_URL))
+ {
+ const char * url = icalproperty_get_value_as_string(icalprop);
+ if ((url != nullptr) && appointment.url.empty())
+ appointment.url = url;
+ }
+
+ icalprop = icalcomponent_get_next_property(icc, ICAL_X_PROPERTY);
+ }
+ }
+
appointment.begin = begin_dt;
appointment.end = end_dt;
appointment.color = subtask->color;