Drop script dir variable
Not needed any more.
This commit is contained in:
parent
f5cf141760
commit
f9ad0621d5
2 changed files with 6 additions and 8 deletions
|
@ -51,15 +51,14 @@ QScriptValue kwinScriptPrint(QScriptContext *context, QScriptEngine *engine)
|
|||
}
|
||||
|
||||
|
||||
KWin::Script::Script(int scriptId, QString scriptName, QDir dir, QObject *parent)
|
||||
KWin::Script::Script(int scriptId, QString scriptName, QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_scriptId(scriptId)
|
||||
, m_engine(new QScriptEngine(this))
|
||||
, m_scriptDir(dir)
|
||||
, m_workspace(new WorkspaceWrapper(m_engine))
|
||||
, m_running(false)
|
||||
{
|
||||
m_scriptFile.setFileName(dir.filePath(scriptName));
|
||||
m_scriptFile.setFileName(scriptName);
|
||||
QDBusConnection::sessionBus().registerObject('/' + QString::number(m_scriptId), this, QDBusConnection::ExportScriptableContents | QDBusConnection::ExportScriptableInvokables);
|
||||
}
|
||||
|
||||
|
@ -178,7 +177,7 @@ void KWin::Scripting::scriptDestroyed(QObject *object)
|
|||
int KWin::Scripting::loadScript(const QString &filePath)
|
||||
{
|
||||
const int id = scripts.size();
|
||||
KWin::Script *script = new KWin::Script(id, filePath, scriptsDir, this);
|
||||
KWin::Script *script = new KWin::Script(id, filePath, this);
|
||||
connect(script, SIGNAL(destroyed(QObject*)), SLOT(scriptDestroyed(QObject*)));
|
||||
scripts.append(script);
|
||||
return id;
|
||||
|
|
|
@ -22,7 +22,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#ifndef KWIN_SCRIPTING_H
|
||||
#define KWIN_SCRIPTING_H
|
||||
|
||||
#include <QDir>
|
||||
#include <QtCore/QFile>
|
||||
#include <QtCore/QStringList>
|
||||
|
||||
class QScriptEngine;
|
||||
class QScriptValue;
|
||||
|
@ -37,7 +38,7 @@ class Script : public QObject
|
|||
Q_CLASSINFO("D-Bus Interface", "org.kde.kwin.Scripting")
|
||||
public:
|
||||
|
||||
Script(int id, QString scriptName, QDir dir, QObject *parent = NULL);
|
||||
Script(int id, QString scriptName, QObject *parent = NULL);
|
||||
virtual ~Script();
|
||||
QString fileName() const {
|
||||
return m_scriptFile.fileName();
|
||||
|
@ -63,7 +64,6 @@ private slots:
|
|||
private:
|
||||
int m_scriptId;
|
||||
QScriptEngine *m_engine;
|
||||
QDir m_scriptDir;
|
||||
QFile m_scriptFile;
|
||||
WorkspaceWrapper *m_workspace;
|
||||
bool m_running;
|
||||
|
@ -78,7 +78,6 @@ class Scripting : public QObject
|
|||
Q_CLASSINFO("D-Bus Interface", "org.kde.kwin.Scripting")
|
||||
private:
|
||||
QStringList scriptList;
|
||||
QDir scriptsDir;
|
||||
QList<KWin::Script*> scripts;
|
||||
|
||||
// Preferably call ONLY at load time
|
||||
|
|
Loading…
Reference in a new issue