diff options
Diffstat (limited to 'framework/domain/mailcontroller.cpp')
-rw-r--r-- | framework/domain/mailcontroller.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/framework/domain/mailcontroller.cpp b/framework/domain/mailcontroller.cpp index 4c5ae5c6..3d29ba22 100644 --- a/framework/domain/mailcontroller.cpp +++ b/framework/domain/mailcontroller.cpp | |||
@@ -32,6 +32,16 @@ MailController::MailController() | |||
32 | QObject::connect(markAsReadAction(), &Kube::ControllerAction::triggered, this, &MailController::markAsRead); | 32 | QObject::connect(markAsReadAction(), &Kube::ControllerAction::triggered, this, &MailController::markAsRead); |
33 | QObject::connect(moveToTrashAction(), &Kube::ControllerAction::triggered, this, &MailController::moveToTrash); | 33 | QObject::connect(moveToTrashAction(), &Kube::ControllerAction::triggered, this, &MailController::moveToTrash); |
34 | QObject::connect(removeAction(), &Kube::ControllerAction::triggered, this, &MailController::remove); | 34 | QObject::connect(removeAction(), &Kube::ControllerAction::triggered, this, &MailController::remove); |
35 | |||
36 | QObject::connect(this, &MailController::mailChanged, &MailController::updateActions); | ||
37 | updateActions(); | ||
38 | } | ||
39 | |||
40 | void MailController::updateActions() | ||
41 | { | ||
42 | if (auto mail = getMail()) { | ||
43 | action_moveToTrash->setEnabled(!mail->getTrash()); | ||
44 | } | ||
35 | } | 45 | } |
36 | 46 | ||
37 | void MailController::markAsRead() | 47 | void MailController::markAsRead() |