summaryrefslogtreecommitdiffstats
path: root/framework/domain/mailcontroller.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-01-10 12:45:30 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-01-10 12:46:33 +0100
commit41927399c33eae952f78b8361d145c00c5f744d2 (patch)
treee0d905f5b70e557e0d1dc8198231d62ac57cffe1 /framework/domain/mailcontroller.cpp
parent229492f0550730a62d74935e45087683cb5f88e9 (diff)
downloadkube-41927399c33eae952f78b8361d145c00c5f744d2.tar.gz
kube-41927399c33eae952f78b8361d145c00c5f744d2.zip
Move to folder action
Diffstat (limited to 'framework/domain/mailcontroller.cpp')
-rw-r--r--framework/domain/mailcontroller.cpp12
1 files changed, 11 insertions, 1 deletions
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()
33 action_markAsImportant{new Kube::ControllerAction{this, &MailController::markAsImportant}}, 33 action_markAsImportant{new Kube::ControllerAction{this, &MailController::markAsImportant}},
34 action_moveToTrash{new Kube::ControllerAction{this, &MailController::moveToTrash}}, 34 action_moveToTrash{new Kube::ControllerAction{this, &MailController::moveToTrash}},
35 action_restoreFromTrash{new Kube::ControllerAction{this, &MailController::restoreFromTrash}}, 35 action_restoreFromTrash{new Kube::ControllerAction{this, &MailController::restoreFromTrash}},
36 action_remove{new Kube::ControllerAction{this, &MailController::remove}} 36 action_remove{new Kube::ControllerAction{this, &MailController::remove}},
37 action_moveToFolder{new Kube::ControllerAction{this, &MailController::moveToFolder}}
37{ 38{
38 QObject::connect(this, &MailController::mailChanged, &MailController::updateActions); 39 QObject::connect(this, &MailController::mailChanged, &MailController::updateActions);
39 updateActions(); 40 updateActions();
@@ -95,3 +96,12 @@ void MailController::remove()
95 run(Store::remove(*mail)); 96 run(Store::remove(*mail));
96} 97}
97 98
99void MailController::moveToFolder()
100{
101 auto mail = getMail();
102 auto targetFolder = getTargetFolder();
103 mail->setFolder(*targetFolder);
104 SinkLog() << "Moving to folder " << mail->identifier() << targetFolder->identifier();
105 run(Store::modify(*mail));
106}
107