From 4b094beb151373abb4a24d473c6d69a11674c5ba Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Wed, 24 Feb 2016 12:37:51 +0100 Subject: Moved the ActionHandlerHelper --- framework/mail/actions/sinkactions.cpp | 21 +----------------- framework/mail/actions/sinkactions.h | 40 ---------------------------------- 2 files changed, 1 insertion(+), 60 deletions(-) delete mode 100644 framework/mail/actions/sinkactions.h (limited to 'framework/mail') 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 @@ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "sinkactions.h" - #include +#include #include using namespace Kube; -ActionHandlerHelper::ActionHandlerHelper(const QByteArray &actionId, const std::function &isReady, const std::function &handler) - : ActionHandler(nullptr), - isReadyFunction(isReady), - handlerFunction(handler) -{ - setActionId(actionId); -} - -bool ActionHandlerHelper::isActionReady(Context *context) -{ - return isReadyFunction(context); -} - -void ActionHandlerHelper::execute(Context *context) -{ - handlerFunction(context); -} - static ActionHandlerHelper markAsReadHandler("org.kde.kube.actions.mark-as-read", [](Context *context) -> bool { return context->property("mail").isValid(); diff --git a/framework/mail/actions/sinkactions.h b/framework/mail/actions/sinkactions.h deleted file mode 100644 index a583ebf8..00000000 --- a/framework/mail/actions/sinkactions.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - Copyright (c) 2016 Christian Mollekopf - - This library is free software; you can redistribute it and/or modify it - under the terms of the GNU Library General Public License as published by - the Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - This library is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public - License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to the - Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. -*/ -#pragma once - -#include -#include - -namespace Kube { -class Context; - -class ActionHandlerHelper : public ActionHandler -{ - Q_OBJECT -public: - ActionHandlerHelper(const QByteArray &actionId, const std::function &, const std::function &); - - bool isActionReady(Context *context) Q_DECL_OVERRIDE; - void execute(Context *context) Q_DECL_OVERRIDE; -private: - const std::function isReadyFunction; - const std::function handlerFunction; -}; - -} -- cgit v1.2.3