diff options
Diffstat (limited to 'framework')
-rw-r--r-- | framework/domain/mailcontroller.cpp | 11 | ||||
-rw-r--r-- | framework/domain/mailcontroller.h | 1 |
2 files changed, 11 insertions, 1 deletions
diff --git a/framework/domain/mailcontroller.cpp b/framework/domain/mailcontroller.cpp index a65c2692..3e5e6ed4 100644 --- a/framework/domain/mailcontroller.cpp +++ b/framework/domain/mailcontroller.cpp | |||
@@ -29,6 +29,7 @@ using namespace Sink::ApplicationDomain; | |||
29 | MailController::MailController() | 29 | MailController::MailController() |
30 | : Kube::Controller(), | 30 | : Kube::Controller(), |
31 | action_markAsRead{new Kube::ControllerAction{this, &MailController::markAsRead}}, | 31 | action_markAsRead{new Kube::ControllerAction{this, &MailController::markAsRead}}, |
32 | action_markAsUnread{new Kube::ControllerAction{this, &MailController::markAsUnread}}, | ||
32 | action_markAsImportant{new Kube::ControllerAction{this, &MailController::markAsImportant}}, | 33 | action_markAsImportant{new Kube::ControllerAction{this, &MailController::markAsImportant}}, |
33 | action_moveToTrash{new Kube::ControllerAction{this, &MailController::moveToTrash}}, | 34 | action_moveToTrash{new Kube::ControllerAction{this, &MailController::moveToTrash}}, |
34 | action_restoreFromTrash{new Kube::ControllerAction{this, &MailController::restoreFromTrash}}, | 35 | action_restoreFromTrash{new Kube::ControllerAction{this, &MailController::restoreFromTrash}}, |
@@ -54,6 +55,14 @@ void MailController::markAsRead() | |||
54 | run(Store::modify(*mail)); | 55 | run(Store::modify(*mail)); |
55 | } | 56 | } |
56 | 57 | ||
58 | void MailController::markAsUnread() | ||
59 | { | ||
60 | auto mail = getMail(); | ||
61 | mail->setUnread(true); | ||
62 | SinkLog() << "Mark as unread " << mail->identifier(); | ||
63 | run(Store::modify(*mail)); | ||
64 | } | ||
65 | |||
57 | void MailController::markAsImportant() | 66 | void MailController::markAsImportant() |
58 | { | 67 | { |
59 | auto mail = getMail(); | 68 | auto mail = getMail(); |
@@ -74,7 +83,7 @@ void MailController::restoreFromTrash() | |||
74 | { | 83 | { |
75 | auto mail = getMail(); | 84 | auto mail = getMail(); |
76 | mail->setTrash(false); | 85 | mail->setTrash(false); |
77 | SinkLog() << "Move to trash " << mail->identifier(); | 86 | SinkLog() << "Restore from trash " << mail->identifier(); |
78 | run(Store::modify(*mail)); | 87 | run(Store::modify(*mail)); |
79 | } | 88 | } |
80 | 89 | ||
diff --git a/framework/domain/mailcontroller.h b/framework/domain/mailcontroller.h index 324f6c62..b92fd566 100644 --- a/framework/domain/mailcontroller.h +++ b/framework/domain/mailcontroller.h | |||
@@ -27,6 +27,7 @@ class MailController : public Kube::Controller | |||
27 | Q_OBJECT | 27 | Q_OBJECT |
28 | KUBE_CONTROLLER_PROPERTY(Sink::ApplicationDomain::Mail::Ptr, Mail, mail) | 28 | KUBE_CONTROLLER_PROPERTY(Sink::ApplicationDomain::Mail::Ptr, Mail, mail) |
29 | KUBE_CONTROLLER_ACTION(markAsRead) | 29 | KUBE_CONTROLLER_ACTION(markAsRead) |
30 | KUBE_CONTROLLER_ACTION(markAsUnread) | ||
30 | KUBE_CONTROLLER_ACTION(markAsImportant) | 31 | KUBE_CONTROLLER_ACTION(markAsImportant) |
31 | KUBE_CONTROLLER_ACTION(moveToTrash) | 32 | KUBE_CONTROLLER_ACTION(moveToTrash) |
32 | KUBE_CONTROLLER_ACTION(restoreFromTrash) | 33 | KUBE_CONTROLLER_ACTION(restoreFromTrash) |