diff options
Diffstat (limited to 'framework/mail/actions/sinkactions.cpp')
-rw-r--r-- | framework/mail/actions/sinkactions.cpp | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/framework/mail/actions/sinkactions.cpp b/framework/mail/actions/sinkactions.cpp index 978a045b..e00d3947 100644 --- a/framework/mail/actions/sinkactions.cpp +++ b/framework/mail/actions/sinkactions.cpp | |||
@@ -16,32 +16,13 @@ | |||
16 | Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | 16 | Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
17 | 02110-1301, USA. | 17 | 02110-1301, USA. |
18 | */ | 18 | */ |
19 | #include "sinkactions.h" | ||
20 | |||
21 | #include <actions/context.h> | 19 | #include <actions/context.h> |
20 | #include <actions/actionhandler.h> | ||
22 | 21 | ||
23 | #include <sink/store.h> | 22 | #include <sink/store.h> |
24 | 23 | ||
25 | using namespace Kube; | 24 | using namespace Kube; |
26 | 25 | ||
27 | ActionHandlerHelper::ActionHandlerHelper(const QByteArray &actionId, const std::function<bool(Context*)> &isReady, const std::function<void(Context*)> &handler) | ||
28 | : ActionHandler(nullptr), | ||
29 | isReadyFunction(isReady), | ||
30 | handlerFunction(handler) | ||
31 | { | ||
32 | setActionId(actionId); | ||
33 | } | ||
34 | |||
35 | bool ActionHandlerHelper::isActionReady(Context *context) | ||
36 | { | ||
37 | return isReadyFunction(context); | ||
38 | } | ||
39 | |||
40 | void ActionHandlerHelper::execute(Context *context) | ||
41 | { | ||
42 | handlerFunction(context); | ||
43 | } | ||
44 | |||
45 | static ActionHandlerHelper markAsReadHandler("org.kde.kube.actions.mark-as-read", | 26 | static ActionHandlerHelper markAsReadHandler("org.kde.kube.actions.mark-as-read", |
46 | [](Context *context) -> bool { | 27 | [](Context *context) -> bool { |
47 | return context->property("mail").isValid(); | 28 | return context->property("mail").isValid(); |