summaryrefslogtreecommitdiffstats
path: root/framework/actions/actionhandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'framework/actions/actionhandler.cpp')
-rw-r--r--framework/actions/actionhandler.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/framework/actions/actionhandler.cpp b/framework/actions/actionhandler.cpp
index 9d58f464..dc9edeca 100644
--- a/framework/actions/actionhandler.cpp
+++ b/framework/actions/actionhandler.cpp
@@ -77,6 +77,18 @@ QByteArray ActionHandler::actionId() const
77} 77}
78 78
79 79
80ActionHandlerHelper::ActionHandlerHelper(const Handler &handler)
81 : ActionHandler(nullptr),
82 handlerFunction(handler)
83{
84}
85
86ActionHandlerHelper::ActionHandlerHelper(const IsReadyFunction &isReady, const Handler &handler)
87 : ActionHandler(nullptr),
88 isReadyFunction(isReady),
89 handlerFunction(handler)
90{
91}
80 92
81ActionHandlerHelper::ActionHandlerHelper(const QByteArray &actionId, const IsReadyFunction &isReady, const Handler &handler) 93ActionHandlerHelper::ActionHandlerHelper(const QByteArray &actionId, const IsReadyFunction &isReady, const Handler &handler)
82 : ActionHandler(nullptr), 94 : ActionHandler(nullptr),
@@ -96,7 +108,10 @@ ActionHandlerHelper::ActionHandlerHelper(const QByteArray &actionId, const IsRea
96 108
97bool ActionHandlerHelper::isActionReady(Context *context) 109bool ActionHandlerHelper::isActionReady(Context *context)
98{ 110{
99 return isReadyFunction(context); 111 if (isReadyFunction) {
112 return isReadyFunction(context);
113 }
114 return true;
100} 115}
101 116
102ActionResult ActionHandlerHelper::execute(Context *context) 117ActionResult ActionHandlerHelper::execute(Context *context)