diff --git a/src/data/kmail2.notifyrc b/src/data/kmail2.notifyrc index 0a70a8181..8fdccf77b 100644 --- a/src/data/kmail2.notifyrc +++ b/src/data/kmail2.notifyrc @@ -468,3 +468,8 @@ Name[x-test]=xxFolder Archive Errorxx Name[zh_CN]=文件夹归档错误 Name[zh_TW]=資料夾封存錯誤 Action=Popup + +[Event/undosend] +Name=An email can be undo send +Action=Popup +Urgency=Normal diff --git a/src/undosend/undosendcreatejob.cpp b/src/undosend/undosendcreatejob.cpp index fbaafa08e..457f6c5f5 100644 --- a/src/undosend/undosendcreatejob.cpp +++ b/src/undosend/undosendcreatejob.cpp @@ -20,6 +20,7 @@ #include "undosendcreatejob.h" #include "kmail_debug.h" +//TODO add notification UndoSendCreateJob::UndoSendCreateJob(QObject *parent) : QObject(parent) diff --git a/src/undosend/undosendmanager.cpp b/src/undosend/undosendmanager.cpp index d0cd1bd3b..f3945ee40 100644 --- a/src/undosend/undosendmanager.cpp +++ b/src/undosend/undosendmanager.cpp @@ -19,6 +19,7 @@ #include "undosendmanager.h" #include "undosendcreatejob.h" +#include "kmail_debug.h" UndoSendManager::UndoSendManager(QObject *parent) : QObject(parent) @@ -35,12 +36,13 @@ UndoSendManager *UndoSendManager::self() return &s_self; } -void UndoSendManager::removeItem(qint64 index) -{ - -} - void UndoSendManager::addItem(qint64 index, const QString &subject, int delay) { - //TODO + UndoSendCreateJob *job = new UndoSendCreateJob(this); + job->setAkonadiIndex(index); + job->setSubject(subject); + job->setDelay(delay); + if (!job->start()) { + qCWarning(KMAIL_LOG) << " Impossible to create job"; + } } diff --git a/src/undosend/undosendmanager.h b/src/undosend/undosendmanager.h index 3669daac3..5f4d008cb 100644 --- a/src/undosend/undosendmanager.h +++ b/src/undosend/undosendmanager.h @@ -29,7 +29,6 @@ public: explicit UndoSendManager(QObject *parent = nullptr); ~UndoSendManager(); static UndoSendManager *self(); - void removeItem(qint64 index); void addItem(qint64 index, const QString &subject, int delay); };