diff options
Diffstat (limited to 'framework/actions/actionhandler.cpp')
-rw-r--r-- | framework/actions/actionhandler.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/framework/actions/actionhandler.cpp b/framework/actions/actionhandler.cpp index dc9edeca..eb7b3224 100644 --- a/framework/actions/actionhandler.cpp +++ b/framework/actions/actionhandler.cpp | |||
@@ -31,6 +31,11 @@ ActionHandler::ActionHandler(QObject *parent) | |||
31 | 31 | ||
32 | } | 32 | } |
33 | 33 | ||
34 | ActionHandler::~ActionHandler() | ||
35 | { | ||
36 | ActionBroker::instance().unregisterHandler(mActionId, this); | ||
37 | } | ||
38 | |||
34 | bool ActionHandler::isActionReady(Context *context) | 39 | bool ActionHandler::isActionReady(Context *context) |
35 | { | 40 | { |
36 | if (context) { | 41 | if (context) { |
@@ -67,6 +72,8 @@ ActionResult ActionHandler::execute(Context *context) | |||
67 | 72 | ||
68 | void ActionHandler::setActionId(const QByteArray &actionId) | 73 | void ActionHandler::setActionId(const QByteArray &actionId) |
69 | { | 74 | { |
75 | //Reassigning the id is not supported | ||
76 | Q_ASSERT(mActionId.isEmpty()); | ||
70 | mActionId = actionId; | 77 | mActionId = actionId; |
71 | ActionBroker::instance().registerHandler(actionId, this); | 78 | ActionBroker::instance().registerHandler(actionId, this); |
72 | } | 79 | } |
@@ -76,6 +83,16 @@ QByteArray ActionHandler::actionId() const | |||
76 | return mActionId; | 83 | return mActionId; |
77 | } | 84 | } |
78 | 85 | ||
86 | void ActionHandler::setRequiredProperties(const QSet<QByteArray> &requiredProperties) | ||
87 | { | ||
88 | mRequiredProperties = requiredProperties; | ||
89 | } | ||
90 | |||
91 | QSet<QByteArray> ActionHandler::requiredProperties() const | ||
92 | { | ||
93 | return mRequiredProperties; | ||
94 | } | ||
95 | |||
79 | 96 | ||
80 | ActionHandlerHelper::ActionHandlerHelper(const Handler &handler) | 97 | ActionHandlerHelper::ActionHandlerHelper(const Handler &handler) |
81 | : ActionHandler(nullptr), | 98 | : ActionHandler(nullptr), |