Changeset View
Changeset View
Standalone View
Standalone View
akonadi/calendar/incidencechanger.cpp
Show First 20 Lines • Show All 67 Lines • ▼ Show 20 Lines | bool weAreOrganizer(Incidence::Ptr incidence) | ||||
const QString email = incidence->organizer()->email(); | const QString email = incidence->organizer()->email(); | ||||
return Akonadi::CalendarUtils::thatIsMe(email); | return Akonadi::CalendarUtils::thatIsMe(email); | ||||
} | } | ||||
bool allowedModificationsWithoutRevisionUpdate(Incidence::Ptr incidence) | bool allowedModificationsWithoutRevisionUpdate(Incidence::Ptr incidence) | ||||
{ | { | ||||
// Modifications that are per user allowd without getting outofsync with organisator | // Modifications that are per user allowd without getting outofsync with organisator | ||||
// * if only alarm settings are modified. | // * if only alarm settings are modified. | ||||
// * if we add/modify the SchedulingId | |||||
const QSet<KCalCore::IncidenceBase::Field> dirtyFields = incidence->dirtyFields(); | const QSet<KCalCore::IncidenceBase::Field> dirtyFields = incidence->dirtyFields(); | ||||
QSet<KCalCore::IncidenceBase::Field> alarmOnlyModify; | QSet<KCalCore::IncidenceBase::Field> allowedModifications; | ||||
alarmOnlyModify << IncidenceBase::FieldAlarms << IncidenceBase::FieldLastModified; | allowedModifications << IncidenceBase::FieldAlarms << IncidenceBase::FieldLastModified << IncidenceBase::FieldSchedulingId; | ||||
if (dirtyFields == alarmOnlyModify) { | if ((dirtyFields - allowedModifications).isEmpty()) { | ||||
return true; | return true; | ||||
} | } | ||||
return false; | return false; | ||||
} | } | ||||
namespace Akonadi { | namespace Akonadi { | ||||
// Does a queued emit, with QMetaObject::invokeMethod | // Does a queued emit, with QMetaObject::invokeMethod | ||||
▲ Show 20 Lines • Show All 575 Lines • ▼ Show 20 Lines | if (change->useGroupwareCommunication) { | ||||
if (me->status() == KCalCore::Attendee::Accepted || | if (me->status() == KCalCore::Attendee::Accepted || | ||||
me->status() == KCalCore::Attendee::Delegated) { | me->status() == KCalCore::Attendee::Delegated) { | ||||
notifyOrganizer = true; | notifyOrganizer = true; | ||||
} | } | ||||
KCalCore::Attendee::Ptr newMe(new KCalCore::Attendee(*me)); | KCalCore::Attendee::Ptr newMe(new KCalCore::Attendee(*me)); | ||||
newMe->setStatus(KCalCore::Attendee::Declined); | newMe->setStatus(KCalCore::Attendee::Declined); | ||||
incidence->clearAttendees(); | incidence->clearAttendees(); | ||||
incidence->addAttendee(newMe); | incidence->addAttendee(newMe); | ||||
break; | |||||
} | } | ||||
if (notifyOrganizer) { | if (notifyOrganizer) { | ||||
MailScheduler scheduler(mFactory, change->parentWidget); // TODO make async | MailScheduler scheduler(mFactory, change->parentWidget); // TODO make async | ||||
scheduler.performTransaction(incidence, KCalCore::iTIPReply); | scheduler.performTransaction(incidence, KCalCore::iTIPReply); | ||||
knauss: The end of the mailschedular is not connected to anything, so it is completly async. This… | |||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } | ||||
break; | break; | ||||
case IncidenceChanger::ChangeTypeModify: | case IncidenceChanger::ChangeTypeModify: | ||||
{ | { | ||||
if (change->originalItems.isEmpty()) { | if (change->originalItems.isEmpty()) { | ||||
▲ Show 20 Lines • Show All 763 Lines • Show Last 20 Lines |
The end of the mailschedular is not connected to anything, so it is completly async. This reluts for the test in a QWARN QCoreApplication::postEvent: Unexpected null receiver, because the MailSchedular is deleted with the end of the method.