Skip to content

Commit

Permalink
[buteo-sync-plugins-social] Set no default reminders if required. Con…
Browse files Browse the repository at this point in the history
…tributes to MER#1383

Previously, upsyncing an event from the device to Google could result
in Google adding a default reminder for the event.  This commit ensures
that if the event does not have an alarm associated with it, that we
set reminders.useDefault=false for the upsynced event.

Contributes to MER#1383
  • Loading branch information
Chris Adams committed Oct 28, 2015
1 parent 2b7b4ab commit 0e67222
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/google/google-calendars/googlecalendarsyncadaptor.cpp
Expand Up @@ -362,7 +362,7 @@ KDateTime parseRecurrenceId(const QJsonObject &originalStartTime)
QJsonObject kCalToJson(KCalCore::Event::Ptr event, KCalCore::ICalFormat &icalFormat, bool setUidProperty = false)
{
QString eventId = gCalEventId(event);
QJsonObject start, end;
QJsonObject start, end, reminders;

// insert the date/time and timeZone information into the Json object.
// note that timeZone is required for recurring events, for some reason.
Expand Down Expand Up @@ -392,6 +392,12 @@ QJsonObject kCalToJson(KCalCore::Event::Ptr event, KCalCore::ICalFormat &icalFor
//retn.insert(QLatin1String("locked"), event->readOnly()); // only allow locking server-side.
// we may wish to support locking/readonly from local side also, in the future.

// if the event has no alarms associated with it, don't let Google add one automatically.
if (event->alarms().count() == 0) {
reminders.insert(QLatin1String("useDefault"), false);
retn.insert(QLatin1String("reminders"), reminders);
}

if (setUidProperty) {
// now we store private extended properties: local uid.
// this allows us to detect partially-upsynced artifacts during subsequent syncs.
Expand Down

0 comments on commit 0e67222

Please sign in to comment.