diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-01-02 13:57:44 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-01-02 14:01:13 +0100 |
commit | ccb647b4d0f7627bddf5df8b488ebcac2f463829 (patch) | |
tree | 8f2f0e1591d79c55b4cd59e4391f67bc21d38130 /framework/domain/mailcontroller.cpp | |
parent | 9958a642b2c605b397be23b4ee6b02375c5d240e (diff) | |
download | kube-ccb647b4d0f7627bddf5df8b488ebcac2f463829.tar.gz kube-ccb647b4d0f7627bddf5df8b488ebcac2f463829.zip |
Less boilerplate
Diffstat (limited to 'framework/domain/mailcontroller.cpp')
-rw-r--r-- | framework/domain/mailcontroller.cpp | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/framework/domain/mailcontroller.cpp b/framework/domain/mailcontroller.cpp index 0163d41e..a65c2692 100644 --- a/framework/domain/mailcontroller.cpp +++ b/framework/domain/mailcontroller.cpp | |||
@@ -28,18 +28,12 @@ using namespace Sink::ApplicationDomain; | |||
28 | 28 | ||
29 | MailController::MailController() | 29 | MailController::MailController() |
30 | : Kube::Controller(), | 30 | : Kube::Controller(), |
31 | action_markAsRead{new Kube::ControllerAction}, | 31 | action_markAsRead{new Kube::ControllerAction{this, &MailController::markAsRead}}, |
32 | action_markAsImportant{new Kube::ControllerAction}, | 32 | action_markAsImportant{new Kube::ControllerAction{this, &MailController::markAsImportant}}, |
33 | action_moveToTrash{new Kube::ControllerAction}, | 33 | action_moveToTrash{new Kube::ControllerAction{this, &MailController::moveToTrash}}, |
34 | action_restoreFromTrash{new Kube::ControllerAction}, | 34 | action_restoreFromTrash{new Kube::ControllerAction{this, &MailController::restoreFromTrash}}, |
35 | action_remove{new Kube::ControllerAction} | 35 | action_remove{new Kube::ControllerAction{this, &MailController::remove}} |
36 | { | 36 | { |
37 | QObject::connect(markAsReadAction(), &Kube::ControllerAction::triggered, this, &MailController::markAsRead); | ||
38 | QObject::connect(markAsImportantAction(), &Kube::ControllerAction::triggered, this, &MailController::markAsImportant); | ||
39 | QObject::connect(moveToTrashAction(), &Kube::ControllerAction::triggered, this, &MailController::moveToTrash); | ||
40 | QObject::connect(restoreFromTrashAction(), &Kube::ControllerAction::triggered, this, &MailController::restoreFromTrash); | ||
41 | QObject::connect(removeAction(), &Kube::ControllerAction::triggered, this, &MailController::remove); | ||
42 | |||
43 | QObject::connect(this, &MailController::mailChanged, &MailController::updateActions); | 37 | QObject::connect(this, &MailController::mailChanged, &MailController::updateActions); |
44 | updateActions(); | 38 | updateActions(); |
45 | } | 39 | } |