From 41927399c33eae952f78b8361d145c00c5f744d2 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 10 Jan 2017 12:45:30 +0100 Subject: Move to folder action --- framework/domain/mailcontroller.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'framework/domain/mailcontroller.cpp') diff --git a/framework/domain/mailcontroller.cpp b/framework/domain/mailcontroller.cpp index 3e5e6ed4..a5d7efb7 100644 --- a/framework/domain/mailcontroller.cpp +++ b/framework/domain/mailcontroller.cpp @@ -33,7 +33,8 @@ MailController::MailController() action_markAsImportant{new Kube::ControllerAction{this, &MailController::markAsImportant}}, action_moveToTrash{new Kube::ControllerAction{this, &MailController::moveToTrash}}, action_restoreFromTrash{new Kube::ControllerAction{this, &MailController::restoreFromTrash}}, - action_remove{new Kube::ControllerAction{this, &MailController::remove}} + action_remove{new Kube::ControllerAction{this, &MailController::remove}}, + action_moveToFolder{new Kube::ControllerAction{this, &MailController::moveToFolder}} { QObject::connect(this, &MailController::mailChanged, &MailController::updateActions); updateActions(); @@ -95,3 +96,12 @@ void MailController::remove() run(Store::remove(*mail)); } +void MailController::moveToFolder() +{ + auto mail = getMail(); + auto targetFolder = getTargetFolder(); + mail->setFolder(*targetFolder); + SinkLog() << "Moving to folder " << mail->identifier() << targetFolder->identifier(); + run(Store::modify(*mail)); +} + -- cgit v1.2.3