summaryrefslogtreecommitdiffstats
path: root/framework/actions/action.h
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-12-13 16:24:31 +0100
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-12-16 14:54:14 +0100
commit630f45719a527f8ee739b03bc62f886badea6df3 (patch)
treeb9d859cbfedb30ad8a9570e3b87a419bf24ba6c7 /framework/actions/action.h
parentb1a2e2de201985a00980bead5272977cda4ef637 (diff)
downloadkube-630f45719a527f8ee739b03bc62f886badea6df3.tar.gz
kube-630f45719a527f8ee739b03bc62f886badea6df3.zip
Revamp of composercontroller to use actions more.
Instead of setting all properties individually we directly assign all properties to a context that we assign to the actions. This way actions can automatically update themselves as new data becomes available, and we avoid the setter/getter boilerplate, at the cost of a less explicit interface (But that could be improved by allowing to define the required properties of a context in c++). By relying on prehandler/posthandler to execute certain actions we simplify the control flow and enable the future extension with handlers that i.e. do encryption etc.
Diffstat (limited to 'framework/actions/action.h')
-rw-r--r--framework/actions/action.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/framework/actions/action.h b/framework/actions/action.h
index 47e41138..dda8c987 100644
--- a/framework/actions/action.h
+++ b/framework/actions/action.h
@@ -37,6 +37,7 @@ class Action : public QObject
37public: 37public:
38 Action(QObject *parent = 0); 38 Action(QObject *parent = 0);
39 Action(const QByteArray &actionId, Context &context, QObject *parent = 0); 39 Action(const QByteArray &actionId, Context &context, QObject *parent = 0);
40 ~Action();
40 41
41 void setContext(Context *); 42 void setContext(Context *);
42 Context *context() const; 43 Context *context() const;
@@ -52,6 +53,8 @@ public:
52 void addPreHandler(ActionHandler *handler); 53 void addPreHandler(ActionHandler *handler);
53 void addPostHandler(ActionHandler *handler); 54 void addPostHandler(ActionHandler *handler);
54 55
56 bool eventFilter(QObject *obj, QEvent *e) Q_DECL_OVERRIDE;
57
55Q_SIGNALS: 58Q_SIGNALS:
56 void readyChanged(); 59 void readyChanged();
57 60