Scripting does not need to inherit ScriptEngine

This commit is contained in:
Martin Gräßlin 2011-12-23 08:56:25 +01:00
parent c56e70ca7c
commit 0420ecd649
2 changed files with 4 additions and 6 deletions

View file

@ -86,10 +86,9 @@ void KWin::Script::sigException(const QScriptValue& exception)
}
KWin::Scripting::Scripting()
KWin::Scripting::Scripting(QObject *parent)
: QObject(parent)
{
// Default constructor no longer used, scripting can
// be disabled by calling kwin --noscript
}
void KWin::Scripting::start()

View file

@ -71,14 +71,13 @@ private:
/**
* The heart of KWin::Scripting. Infinite power lies beyond
*/
class Scripting : public QScriptEngine
class Scripting : public QObject
{
Q_OBJECT
private:
QStringList scriptList;
QDir scriptsDir;
QVector<KWin::Script*> scripts;
SWrapper::WorkspaceProxy proxy;
// Preferably call ONLY at load time
void runScripts();
@ -89,7 +88,7 @@ private:
void runScript(KWin::Script*);
public:
Scripting();
Scripting(QObject *parent = NULL);
/**
* Start running scripts. This was essential to have KWin::Scripting
* be initialized on stack and also have the option to disable scripting.