aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2015-01-27 00:23:49 +0000
committerCI Train Bot <ci-train-bot@canonical.com>2015-01-27 00:23:49 +0000
commit9753b2703d08abe494411f4e406de6c23ed7a34a (patch)
tree582a30d00ad955e21cc017fe99392048e40ebf33 /src
parentf926c6711feb56d831f5a09d6be6d62bf87cd87b (diff)
parent16fe6ab02517d420f3debcc83f626362ad962067 (diff)
downloadayatana-indicator-datetime-9753b2703d08abe494411f4e406de6c23ed7a34a.tar.gz
ayatana-indicator-datetime-9753b2703d08abe494411f4e406de6c23ed7a34a.tar.bz2
ayatana-indicator-datetime-9753b2703d08abe494411f4e406de6c23ed7a34a.zip
Fix bug that misidentified repeating alarms as one-time alarms, causing them to be disabled after triggering. Fixes: #1411171
Approved by: PS Jenkins bot, Rodney Dawes
Diffstat (limited to 'src')
-rw-r--r--src/engine-eds.cpp7
-rw-r--r--src/main.cpp1
2 files changed, 6 insertions, 2 deletions
diff --git a/src/engine-eds.cpp b/src/engine-eds.cpp
index 210ef42..47c7a9b 100644
--- a/src/engine-eds.cpp
+++ b/src/engine-eds.cpp
@@ -534,8 +534,11 @@ private:
icalcomponent * icc = nullptr;
if (e_cal_client_get_object_finish (E_CAL_CLIENT(client), result, &icc, nullptr))
{
- struct icaltimetype itt = icalcomponent_get_recurrenceid(icc);
- if (icaltime_is_null_time(itt))
+ auto rrule_property = icalcomponent_get_first_property (icc, ICAL_RRULE_PROPERTY); // transfer none
+ auto rdate_property = icalcomponent_get_first_property (icc, ICAL_RDATE_PROPERTY); // transfer none
+ const bool is_nonrepeating = (rrule_property == nullptr) && (rdate_property == nullptr);
+
+ if (is_nonrepeating)
{
g_debug("'%s' appears to be a one-time alarm... adding 'disabled' tag.",
icalcomponent_as_ical_string(icc));
diff --git a/src/main.cpp b/src/main.cpp
index 1761f84..85a414f 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -46,6 +46,7 @@ namespace uin = unity::indicator::notifications;
using namespace unity::indicator::datetime;
+
namespace
{
std::shared_ptr<Engine> create_engine()