28 #include <kalarmcal/alarmtext.h>
29 #include <kalarmcal/kaevent.h>
31 #include <kapplication.h>
40 #undef DELETE // conflicting Windows macro
45 #define RESOURCE_PARAM_TYPE const Collection&
46 #define EVENT_RESOURCE collection
48 #define RESOURCE_PARAM_TYPE AlarmResource*
49 #define EVENT_RESOURCE resource
53 using namespace Akonadi;
59 enum Operation { ADD, EDIT, DELETE, REACTIVATE, DEACTIVATE, MULTI };
62 virtual Operation operation()
const = 0;
63 virtual QString actionText()
const {
return !mName.isEmpty() ? mName : defaultActionText(); }
64 virtual QString defaultActionText()
const = 0;
65 virtual QString description()
const {
return QString(); }
66 virtual QString eventID()
const {
return QString(); }
67 virtual QString oldEventID()
const {
return QString(); }
68 virtual QString newEventID()
const {
return QString(); }
70 virtual Collection collection()
const {
return Collection(); }
72 virtual AlarmResource* resource()
const {
return 0; }
74 int id()
const {
return mId; }
77 CalEvent::Type calendar()
const {
return mCalendar; }
78 virtual void setCalendar(CalEvent::Type s) { mCalendar = s; }
79 virtual UndoItem* restore() = 0;
80 virtual bool deleteID(
const QString& ) {
return false; }
82 enum Error { ERR_NONE, ERR_PROG, ERR_NOT_FOUND, ERR_CREATE, ERR_TEMPLATE, ERR_ARCHIVED };
83 enum Warning { WARN_NONE, WARN_KORG_ADD, WARN_KORG_MODIFY, WARN_KORG_DELETE };
85 static Error mRestoreError;
86 static Warning mRestoreWarning;
87 static KAlarm::UpdateStatus mRestoreWarningKorg;
88 static int mRestoreWarningCount;
91 UndoItem(
Undo::Type,
const QString& name = QString());
92 static QString addDeleteActionText(CalEvent::Type,
bool add);
93 QString description(
const KAEvent&)
const;
94 void replaceWith(UndoItem* item) {
Undo::replace(
this, item); }
99 CalEvent::Type mCalendar;
102 class UndoMultiBase :
public UndoItem
105 UndoMultiBase(
Undo::Type t,
const QString& name)
106 : UndoItem(t, name), mUndos(new
Undo::List) { }
108 : UndoItem(t, name), mUndos(undos) { }
109 ~UndoMultiBase() {
delete mUndos; }
110 const Undo::List* undos()
const {
return mUndos; }
115 template <
class T>
class UndoMulti :
public UndoMultiBase
119 UndoMulti(
Undo::Type t,
Undo::List* undos,
const QString& name) : UndoMultiBase(t, undos, name) { }
120 virtual Operation operation()
const {
return MULTI; }
121 virtual UndoItem* restore();
122 virtual bool deleteID(
const QString&
id);
123 virtual UndoItem* createRedo(
Undo::List*) = 0;
126 class UndoAdd :
public UndoItem
132 virtual Operation operation()
const {
return ADD; }
133 virtual QString defaultActionText()
const;
134 virtual QString description()
const {
return mDescription; }
136 virtual Collection collection()
const {
return mResource; }
138 virtual AlarmResource* resource()
const {
return mResource; }
140 virtual QString eventID()
const {
return mEventId; }
141 virtual QString newEventID()
const {
return mEventId; }
142 virtual UndoItem* restore() {
return doRestore(); }
144 UndoItem* doRestore(
bool setArchive =
false);
148 Collection mResource;
150 AlarmResource* mResource;
153 QString mDescription;
156 class UndoEdit :
public UndoItem
159 UndoEdit(
Undo::Type,
const KAEvent& oldEvent,
const QString& newEventID,
162 virtual Operation operation()
const {
return EDIT; }
163 virtual QString defaultActionText()
const;
164 virtual QString description()
const {
return mDescription; }
166 virtual Collection collection()
const {
return mResource; }
168 virtual AlarmResource* resource()
const {
return mResource; }
170 virtual QString eventID()
const {
return mNewEventId; }
171 virtual QString oldEventID()
const {
return mOldEvent->id(); }
172 virtual QString newEventID()
const {
return mNewEventId; }
173 virtual UndoItem* restore();
176 Collection mResource;
178 AlarmResource* mResource;
182 QString mDescription;
183 QStringList mDontShowErrors;
186 class UndoDelete :
public UndoItem
192 virtual Operation operation()
const {
return DELETE; }
193 virtual QString defaultActionText()
const;
194 virtual QString description()
const {
return UndoItem::description(*mEvent); }
196 virtual Collection collection()
const {
return mResource; }
198 virtual AlarmResource* resource()
const {
return mResource; }
200 virtual QString eventID()
const {
return mEvent->id(); }
201 virtual QString oldEventID()
const {
return mEvent->id(); }
202 virtual UndoItem* restore();
203 KAEvent* event()
const {
return mEvent; }
208 Collection mResource;
210 AlarmResource* mResource;
213 QStringList mDontShowErrors;
216 class UndoReactivate :
public UndoAdd
220 : UndoAdd(t, e.event, e.
EVENT_RESOURCE, name, CalEvent::ACTIVE) { }
222 : UndoAdd(t, e, r, name, CalEvent::ACTIVE) { }
223 virtual Operation operation()
const {
return REACTIVATE; }
224 virtual QString defaultActionText()
const;
225 virtual UndoItem* restore();
230 class UndoDeactivate :
public UndoDelete
234 : UndoDelete(t, e, r, QStringList(), name) { }
235 virtual Operation operation()
const {
return DEACTIVATE; }
236 virtual QString defaultActionText()
const;
237 virtual UndoItem* restore();
242 class UndoAdds :
public UndoMulti<UndoAdd>
246 : UndoMulti<UndoAdd>(t, events, name) { }
248 : UndoMulti<UndoAdd>(t, undos, name) { }
249 virtual QString defaultActionText()
const;
253 class UndoDeletes :
public UndoMulti<UndoDelete>
257 : UndoMulti<UndoDelete>(t, events, name) { }
259 : UndoMulti<UndoDelete>(t, undos, name) { }
260 virtual QString defaultActionText()
const;
264 class UndoReactivates :
public UndoMulti<UndoReactivate>
268 : UndoMulti<UndoReactivate>(t, events, name) { }
270 : UndoMulti<UndoReactivate>(t, undos, name) { }
271 virtual QString defaultActionText()
const;
275 Undo* Undo::mInstance = 0;
286 mInstance =
new Undo(kapp);
295 if (!mUndoList.isEmpty() || !mRedoList.isEmpty())
297 mInstance->blockSignals(
true);
298 while (!mUndoList.isEmpty())
299 delete mUndoList.first();
300 while (!mRedoList.isEmpty())
301 delete mRedoList.first();
302 mInstance->blockSignals(
false);
313 new UndoAdd(UNDO, event, resource, name);
319 int count = events.count();
321 saveAdd(events.first().event, events.first().EVENT_RESOURCE, name);
324 new UndoAdds(UNDO, events, name);
331 new UndoEdit(UNDO, oldEvent.
event, newEvent.id(), oldEvent.EVENT_RESOURCE, oldEvent.
dontShowErrors, AlarmText::summary(newEvent));
332 removeRedos(oldEvent.
event.id());
339 removeRedos(event.
event.id());
345 int count = events.count();
347 saveDelete(events[0], name);
350 new UndoDeletes(UNDO, events, name);
351 for (
int i = 0, end = events.count(); i < end; ++i)
352 removeRedos(events[i].event.id());
359 new UndoReactivate(UNDO, event, resource, name);
365 int count = events.count();
370 new UndoReactivates(UNDO, events, name);
378 void Undo::removeRedos(
const QString& eventID)
380 QString
id = eventID;
381 for (
int i = 0; i < mRedoList.count(); )
383 UndoItem* item = mRedoList[i];
385 if (item->operation() == UndoItem::MULTI)
387 if (item->deleteID(
id))
393 else if (item->eventID() == id)
395 if (item->operation() == UndoItem::EDIT)
396 id = item->oldEventID();
410 UndoItem::mRestoreError = UndoItem::ERR_NONE;
411 UndoItem::mRestoreWarning = UndoItem::WARN_NONE;
412 UndoItem::mRestoreWarningKorg = KAlarm::UPDATE_OK;
413 UndoItem::mRestoreWarningCount = 0;
414 List& list = (type == UNDO) ? mUndoList : mRedoList;
415 if (i < list.count() && list[i]->type() == type)
423 switch (UndoItem::mRestoreError)
425 case UndoItem::ERR_NONE:
427 KAlarm::UpdateError errcode;
428 switch (UndoItem::mRestoreWarning)
430 case UndoItem::WARN_KORG_ADD: errcode = KAlarm::ERR_ADD;
break;
431 case UndoItem::WARN_KORG_MODIFY: errcode = KAlarm::ERR_MODIFY;
break;
432 case UndoItem::WARN_KORG_DELETE: errcode = KAlarm::ERR_DELETE;
break;
433 case UndoItem::WARN_NONE:
437 KAlarm::displayKOrgUpdateError(parent, errcode, UndoItem::mRestoreWarningKorg, UndoItem::mRestoreWarningCount);
440 case UndoItem::ERR_NOT_FOUND: err = i18nc(
"@info/plain",
"Alarm not found");
break;
441 case UndoItem::ERR_CREATE: err = i18nc(
"@info/plain",
"Error recreating alarm");
break;
442 case UndoItem::ERR_TEMPLATE: err = i18nc(
"@info/plain",
"Error recreating alarm template");
break;
443 case UndoItem::ERR_ARCHIVED: err = i18nc(
"@info/plain",
"Cannot reactivate archived alarm");
break;
444 case UndoItem::ERR_PROG: err = i18nc(
"@info/plain",
"Program error");
break;
445 default: err = i18nc(
"@info/plain",
"Unknown error");
break;
459 int undoCount = mUndoList.count();
460 int redoCount = mRedoList.count();
461 if (undoCount + redoCount >=
maxCount - 1)
464 mUndoList.pop_back();
466 mRedoList.pop_back();
470 List* list = undo ? &mUndoList : &mRedoList;
480 List* list = undo ? &mUndoList : &mRedoList;
481 if (!list->isEmpty())
482 list->removeAt(list->indexOf(item));
490 Type type = old->type();
491 List* list = (type == UNDO) ? &mUndoList : (type == REDO) ? &mRedoList : 0;
494 int i = list->indexOf(old);
508 List* list = (type == UNDO) ? &mUndoList : (type == REDO) ? &mRedoList : 0;
509 return (list && !list->isEmpty()) ? (*list)[0]->actionText() : QString();
517 UndoItem* undo = getItem(
id, type);
518 return undo ? undo->actionText() : QString();
526 UndoItem* undo = getItem(
id, type);
527 return undo ? undo->description() : QString();
539 QStringList ignoreIDs;
541 List* list = (type == UNDO) ? &mUndoList : (type == REDO) ? &mRedoList : 0;
544 for (
int i = 0, end = list->count(); i < end; ++i)
548 UndoItem* item = (*list)[i];
550 if (item->operation() == UndoItem::MULTI)
554 const Undo::List* undos = ((UndoMultiBase*)item)->undos();
555 for (
int u = 0, uend = undos->count(); u < uend; ++u)
557 QString evid = (*undos)[u]->eventID();
558 if (ignoreIDs.contains(evid))
561 ignoreIDs.append(evid);
567 for (
int i = 0, iend = newIDs.count(); i < iend; ++i)
568 ignoreIDs.append(newIDs[i]);
573 omit = ignoreIDs.contains(item->eventID());
575 ignoreIDs.append(item->eventID());
576 if (item->operation() == UndoItem::EDIT)
577 ignoreIDs.append(item->oldEventID());
580 ids.append(item->id());
593 mInstance->emitChanged(actionText(UNDO), actionText(REDO));
599 UndoItem* Undo::getItem(
int id,
Undo::Type type)
601 List* list = (type == UNDO) ? &mUndoList : (type == REDO) ? &mRedoList : 0;
604 for (
int i = 0, end = list->count(); i < end; ++i)
606 if ((*list)[i]->id() == id)
618 List& list = (type == UNDO) ? mUndoList : mRedoList;
620 for (
int end = list.count(); i < end; ++i)
622 if (list[i]->
id() == id)
633 int UndoItem::mLastId = 0;
634 UndoItem::Error UndoItem::mRestoreError;
635 UndoItem::Warning UndoItem::mRestoreWarning;
636 KAlarm::UpdateStatus UndoItem::mRestoreWarningKorg;
637 int UndoItem::mRestoreWarningCount;
643 UndoItem::UndoItem(
Undo::Type type,
const QString& name)
647 mCalendar(CalEvent::EMPTY)
662 UndoItem::~UndoItem()
671 QString UndoItem::description(
const KAEvent& event)
const
673 return (mCalendar == CalEvent::TEMPLATE) ?
event.templateName() : AlarmText::summary(event);
679 QString UndoItem::addDeleteActionText(CalEvent::Type calendar,
bool add)
683 case CalEvent::ACTIVE:
685 return i18nc(
"@info/plain Action to create a new alarm",
"New alarm");
687 return i18nc(
"@info/plain Action to delete an alarm",
"Delete alarm");
688 case CalEvent::TEMPLATE:
690 return i18nc(
"@info/plain Action to create a new alarm template",
"New template");
692 return i18nc(
"@info/plain Action to delete an alarm template",
"Delete template");
693 case CalEvent::ARCHIVED:
694 return i18nc(
"@info/plain",
"Delete archived alarm");
709 : UndoMultiBase(type, name)
711 for (
int i = 0, end = events.count(); i < end; ++i)
722 UndoItem* UndoMulti<T>::restore()
725 for (
int i = 0, end = mUndos->count(); i < end; ++i)
727 UndoItem* undo = (*mUndos)[i]->restore();
729 newUndos->append(undo);
731 if (newUndos->isEmpty())
738 return createRedo(newUndos);
749 bool UndoMulti<T>::deleteID(
const QString&
id)
751 for (
int i = 0, end = mUndos->count(); i < end; ++i)
753 UndoItem* item = (*mUndos)[i];
754 if (item->eventID() == id)
758 if (mUndos->count() == 1)
782 : UndoItem(type, name),
784 mEventId(undo.event.id())
786 setCalendar(undo.
event.category());
787 mDescription = UndoItem::description(undo.
event);
791 : UndoItem(type, name),
795 setCalendar(event.category());
796 mDescription = UndoItem::description(event);
800 : UndoItem(type, name),
802 mEventId(CalEvent::uid(event.id(), cal))
805 mDescription = UndoItem::description(event);
813 UndoItem* UndoAdd::doRestore(
bool setArchive)
816 kDebug() << mEventId;
824 mRestoreError = ERR_NOT_FOUND;
831 UndoItem* undo = createRedo(event, mResource);
835 case CalEvent::ACTIVE:
840 KAlarm::UpdateStatus status = KAlarm::deleteEvent(event,
true);
843 case KAlarm::UPDATE_ERROR:
844 case KAlarm::UPDATE_FAILED:
845 case KAlarm::SAVE_FAILED:
846 mRestoreError = ERR_CREATE;
848 case KAlarm::UPDATE_KORG_FUNCERR:
849 case KAlarm::UPDATE_KORG_ERRSTART:
850 case KAlarm::UPDATE_KORG_ERR:
851 mRestoreWarning = WARN_KORG_DELETE;
852 ++mRestoreWarningCount;
853 if (status > mRestoreWarningKorg)
854 mRestoreWarningKorg = status;
861 case CalEvent::TEMPLATE:
863 if (KAlarm::deleteTemplate(event) != KAlarm::UPDATE_OK)
865 if (KAlarm::deleteTemplate(event.id()) != KAlarm::UPDATE_OK)
867 mRestoreError = ERR_TEMPLATE;
869 case CalEvent::ARCHIVED:
870 KAlarm::deleteEvent(event);
874 mRestoreError = ERR_PROG;
886 return new UndoDelete(t, event, resource, QStringList(), mName);
892 QString UndoAdd::defaultActionText()
const
894 return addDeleteActionText(calendar(), (type() ==
Undo::UNDO));
906 UndoItem* UndoAdds::createRedo(
Undo::List* undos)
909 return new UndoAdds(t, undos, mName);
915 QString UndoAdds::defaultActionText()
const
917 return i18nc(
"@info/plain",
"Create multiple alarms");
926 UndoEdit::UndoEdit(
Undo::Type type,
const KAEvent& oldEvent,
const QString& newEventID,
927 RESOURCE_PARAM_TYPE resource,
const QStringList& dontShowErrors,
const QString& description)
930 mOldEvent(new KAEvent(oldEvent)),
931 mNewEventId(newEventID),
932 mDescription(description),
933 mDontShowErrors(dontShowErrors)
935 setCalendar(oldEvent.category());
938 UndoEdit::~UndoEdit()
948 UndoItem* UndoEdit::restore()
950 kDebug() << mNewEventId;
959 mRestoreError = ERR_NOT_FOUND;
962 KAEvent newEvent(*event);
967 UndoItem* undo =
new UndoEdit(t, newEvent, mOldEvent->id(), mResource, KAlarm::dontShowErrors(
EventId(newEvent)), mDescription);
969 UndoItem* undo =
new UndoEdit(t, newEvent, mOldEvent->id(), mResource, KAlarm::dontShowErrors(mNewEventId), mDescription);
974 case CalEvent::ACTIVE:
976 KAlarm::UpdateStatus status = KAlarm::modifyEvent(newEvent, *mOldEvent);
979 case KAlarm::UPDATE_ERROR:
980 case KAlarm::UPDATE_FAILED:
981 case KAlarm::SAVE_FAILED:
982 mRestoreError = ERR_CREATE;
984 case KAlarm::UPDATE_KORG_FUNCERR:
985 case KAlarm::UPDATE_KORG_ERRSTART:
986 case KAlarm::UPDATE_KORG_ERR:
987 mRestoreWarning = WARN_KORG_MODIFY;
988 ++mRestoreWarningCount;
989 if (status > mRestoreWarningKorg)
990 mRestoreWarningKorg = status;
994 KAlarm::setDontShowErrors(
EventId(*mOldEvent), mDontShowErrors);
996 KAlarm::setDontShowErrors(mOldEvent->id(), mDontShowErrors);
1002 case CalEvent::TEMPLATE:
1003 if (KAlarm::updateTemplate(*mOldEvent) != KAlarm::UPDATE_OK)
1004 mRestoreError = ERR_TEMPLATE;
1006 case CalEvent::ARCHIVED:
1009 mRestoreError = ERR_PROG;
1018 QString UndoEdit::defaultActionText()
const
1022 case CalEvent::ACTIVE:
1023 return i18nc(
"@info/plain Action to edit an alarm",
"Edit alarm");
1024 case CalEvent::TEMPLATE:
1025 return i18nc(
"@info/plain Action to edit an alarm template",
"Edit template");
1039 : UndoItem(type, name),
1041 mEvent(new KAEvent(undo.event)),
1042 mDontShowErrors(undo.dontShowErrors)
1044 setCalendar(mEvent->category());
1047 UndoDelete::UndoDelete(
Undo::Type type,
const KAEvent& event,
RESOURCE_PARAM_TYPE resource,
const QStringList& dontShowErrors,
const QString& name)
1048 : UndoItem(type, name),
1049 mResource(resource),
1050 mEvent(new KAEvent(event)),
1051 mDontShowErrors(dontShowErrors)
1053 setCalendar(mEvent->category());
1056 UndoDelete::~UndoDelete()
1066 UndoItem* UndoDelete::restore()
1068 kDebug() << mEvent->id();
1072 case CalEvent::ACTIVE:
1073 if (mEvent->toBeArchived())
1076 mEvent->setCategory(CalEvent::ARCHIVED);
1078 KAlarm::UpdateStatus status = KAlarm::reactivateEvent(*mEvent, &mResource);
1080 KAlarm::UpdateStatus status = KAlarm::reactivateEvent(*mEvent, mResource);
1084 case KAlarm::UPDATE_KORG_FUNCERR:
1085 case KAlarm::UPDATE_KORG_ERRSTART:
1086 case KAlarm::UPDATE_KORG_ERR:
1087 mRestoreWarning = WARN_KORG_ADD;
1088 ++mRestoreWarningCount;
1089 if (status > mRestoreWarningKorg)
1090 mRestoreWarningKorg = status;
1092 case KAlarm::UPDATE_ERROR:
1093 case KAlarm::UPDATE_FAILED:
1094 case KAlarm::SAVE_FAILED:
1095 mRestoreError = ERR_ARCHIVED;
1097 case KAlarm::UPDATE_OK:
1104 KAlarm::UpdateStatus status = KAlarm::addEvent(*mEvent, &mResource, 0,
true);
1106 KAlarm::UpdateStatus status = KAlarm::addEvent(*mEvent, mResource, 0,
true);
1110 case KAlarm::UPDATE_KORG_FUNCERR:
1111 case KAlarm::UPDATE_KORG_ERRSTART:
1112 case KAlarm::UPDATE_KORG_ERR:
1113 mRestoreWarning = WARN_KORG_ADD;
1114 ++mRestoreWarningCount;
1115 if (status > mRestoreWarningKorg)
1116 mRestoreWarningKorg = status;
1118 case KAlarm::UPDATE_ERROR:
1119 case KAlarm::UPDATE_FAILED:
1120 case KAlarm::SAVE_FAILED:
1121 mRestoreError = ERR_CREATE;
1123 case KAlarm::UPDATE_OK:
1128 KAlarm::setDontShowErrors(
EventId(*mEvent), mDontShowErrors);
1130 KAlarm::setDontShowErrors(mEvent->id(), mDontShowErrors);
1133 case CalEvent::TEMPLATE:
1135 if (KAlarm::addTemplate(*mEvent, &mResource) != KAlarm::UPDATE_OK)
1137 if (KAlarm::addTemplate(*mEvent, mResource) != KAlarm::UPDATE_OK)
1140 mRestoreError = ERR_CREATE;
1144 case CalEvent::ARCHIVED:
1146 if (!KAlarm::addArchivedEvent(*mEvent, &mResource))
1148 if (!KAlarm::addArchivedEvent(*mEvent, mResource))
1151 mRestoreError = ERR_CREATE;
1156 mRestoreError = ERR_PROG;
1161 return createRedo(*mEvent, mResource);
1170 return new UndoAdd(t, event, resource, mName);
1176 QString UndoDelete::defaultActionText()
const
1178 return addDeleteActionText(calendar(), (type() ==
Undo::REDO));
1190 UndoItem* UndoDeletes::createRedo(
Undo::List* undos)
1193 return new UndoDeletes(t, undos, mName);
1199 QString UndoDeletes::defaultActionText()
const
1201 if (mUndos->isEmpty())
1203 for (
int i = 0, end = mUndos->count(); i < end; ++i)
1205 switch ((*mUndos)[i]->calendar())
1207 case CalEvent::ACTIVE:
1208 return i18nc(
"@info/plain",
"Delete multiple alarms");
1209 case CalEvent::TEMPLATE:
1210 return i18nc(
"@info/plain",
"Delete multiple templates");
1211 case CalEvent::ARCHIVED:
1217 return i18nc(
"@info/plain",
"Delete multiple archived alarms");
1231 UndoItem* UndoReactivate::restore()
1237 case CalEvent::ACTIVE:
1240 mRestoreError = ERR_PROG;
1243 return UndoAdd::doRestore(
true);
1252 return new UndoDeactivate(t, event, resource, mName);
1258 QString UndoReactivate::defaultActionText()
const
1260 return i18nc(
"@info/plain",
"Reactivate alarm");
1274 UndoItem* UndoDeactivate::restore()
1280 case CalEvent::ACTIVE:
1283 mRestoreError = ERR_PROG;
1287 return UndoDelete::restore();
1296 return new UndoReactivate(t, event, resource, mName);
1302 QString UndoDeactivate::defaultActionText()
const
1304 return i18nc(
"@info/plain",
"Reactivate alarm");
1316 UndoItem* UndoReactivates::createRedo(
Undo::List* undos)
1319 return new UndoReactivates(t, undos, mName);
1325 QString UndoReactivates::defaultActionText()
const
1327 return i18nc(
"@info/plain",
"Reactivate multiple alarms");
1339 if (e.category() == CalEvent::ACTIVE)
1341 dontShowErrors = KAlarm::dontShowErrors(
EventId(e));
1343 dontShowErrors = KAlarm::dontShowErrors(e.id());
static void emitChanged()
QStringList dontShowErrors
static QString description(Type, int id)
static void saveEdit(const Event &oldEvent, const KAEvent &newEvent)
static void saveDeletes(const EventList &, const QString &name=QString())
static KAEvent * getEvent(const QString &uniqueId)
static void saveAdds(const EventList &, const QString &name=QString())
static QList< int > ids(Type)
#define RESOURCE_PARAM_TYPE
static void saveReactivate(const KAEvent &, AlarmResource *, const QString &name=QString())
static bool undo(QWidget *parent, const QString &action)
static void remove(UndoItem *, bool undo)
static void saveAdd(const KAEvent &, AlarmResource *, const QString &name=QString())
Unique event identifier for Akonadi.
static void saveReactivates(const EventList &, const QString &name=QString())
static void replace(UndoItem *old, UndoItem *New)
static void saveDelete(const Event &, const QString &name=QString())
static void sorry(QWidget *parent, const QString &text, const QString &caption=QString(), Options options=Options(Notify|WindowModal))
static void add(UndoItem *, bool undo)
static QString actionText(Type)
AutoDeleteList< UndoItem > List