From 197658475b76a93d636081f730a0bb092412ceec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Sun, 1 Jan 2012 15:01:54 +0100 Subject: [PATCH] Make List of Clients in ClientGroup accessable in scripts For that ClientList is exported as a sequence meta type and property is added to ClientGroup. --- client.h | 1 + clientgroup.h | 4 ++++ scripting/meta.cpp | 1 + 3 files changed, 6 insertions(+) diff --git a/client.h b/client.h index fadf7f024e..18b3905816 100644 --- a/client.h +++ b/client.h @@ -1178,5 +1178,6 @@ KWIN_COMPARE_PREDICATE(InputIdMatchPredicate, Client, Window, cl->inputId() == v } // namespace Q_DECLARE_METATYPE(KWin::Client*) +Q_DECLARE_METATYPE(QList) #endif diff --git a/clientgroup.h b/clientgroup.h index 9d9412a849..b70c54403f 100644 --- a/clientgroup.h +++ b/clientgroup.h @@ -69,6 +69,10 @@ class ClientGroup : public QObject * The index of the visible Client in this group. **/ Q_PROPERTY(int visibleClientIndex READ indexOfVisibleClient NOTIFY visibleChanged) + /** + * The Clients in this group. + **/ + Q_PROPERTY(QList clients READ clients) public: /** * Creates a new group containing \p c. diff --git a/scripting/meta.cpp b/scripting/meta.cpp index 6711b50e34..4f770385d5 100644 --- a/scripting/meta.cpp +++ b/scripting/meta.cpp @@ -132,6 +132,7 @@ void KWin::MetaScripting::registration(QScriptEngine* eng) qScriptRegisterSequenceMetaType(eng); qScriptRegisterSequenceMetaType< QList >(eng); + qScriptRegisterSequenceMetaType< QList >(eng); } QScriptValue KWin::MetaScripting::configExists(QScriptContext* ctx, QScriptEngine* eng)