Changeset View
Changeset View
Standalone View
Standalone View
akonadi/calendar/scheduler_p.cpp
Show First 20 Lines • Show All 466 Lines • ▼ Show 20 Lines | void Scheduler::acceptReply(const IncidenceBase::Ptr &incidenceBase, | ||||
if (incidenceBase->type() == IncidenceBase::TypeFreeBusy) { | if (incidenceBase->type() == IncidenceBase::TypeFreeBusy) { | ||||
acceptFreeBusy(incidenceBase, method); | acceptFreeBusy(incidenceBase, method); | ||||
return; | return; | ||||
} | } | ||||
Result result = ResultGenericError; | Result result = ResultGenericError; | ||||
QString errorString = i18n("Generic Error"); | QString errorString = i18n("Generic Error"); | ||||
Incidence::Ptr incidence = calendar->incidence(incidenceBase->uid()); | Incidence::Ptr incidence = calendar->incidence(incidenceBase->uid(), incidenceBase->recurrenceId()); | ||||
// try harder to find the correct incidence | // try harder to find the correct incidence | ||||
if (!incidence) { | if (!incidence) { | ||||
const Incidence::List list = calendar->incidences(); | const Incidence::List list = calendar->incidences(); | ||||
for (Incidence::List::ConstIterator it=list.constBegin(), end=list.constEnd(); | for (Incidence::List::ConstIterator it=list.constBegin(), end=list.constEnd(); | ||||
it != end; ++it) { | it != end; ++it) { | ||||
if ((*it)->schedulingID() == incidenceBase->uid()) { | if ((*it)->schedulingID() == incidenceBase->uid() && | ||||
(*it)->recurrenceId() == incidenceBase->recurrenceId()) { | |||||
incidence = (*it).dynamicCast<Incidence>(); | incidence = (*it).dynamicCast<Incidence>(); | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
} | } | ||||
if (incidence) { | if (incidence) { | ||||
//get matching attendee in calendar | //get matching attendee in calendar | ||||
▲ Show 20 Lines • Show All 97 Lines • ▼ Show 20 Lines | if (incidence) { | ||||
} | } | ||||
return; | return; | ||||
} | } | ||||
} | } | ||||
if (result == ResultSuccess) { | if (result == ResultSuccess) { | ||||
// We set at least one of the attendees, so the incidence changed | // We set at least one of the attendees, so the incidence changed | ||||
// Note: This should not result in a sequence number bump | // Note: This should not result in a sequence number bump | ||||
incidence->updated(); | |||||
const bool success = calendar->modifyIncidence(incidence); | const bool success = calendar->modifyIncidence(incidence); | ||||
if (!success) { | if (!success) { | ||||
emit transactionFinished(ResultModifyingError, i18n("Error modifying incidence")); | emit transactionFinished(ResultModifyingError, i18n("Error modifying incidence")); | ||||
} else { | } else { | ||||
// success will be emitted in the handleModifyFinished() slot | // success will be emitted in the handleModifyFinished() slot | ||||
} | } | ||||
▲ Show 20 Lines • Show All 83 Lines • Show Last 20 Lines |