diff options
author | Jesper K. Pedersen <[email protected]> | 2013-05-29 07:16:50 +0000 |
---|---|---|
committer | Jesper K. Pedersen <[email protected]> | 2013-06-03 15:36:06 +0200 |
commit | af8eb8d825d7d1ea08b1a1ac36f52860bf4b7b84 (patch) | |
tree | 11b9d426e1a21845f498f7fdd47ca80f66ebdaec | |
parent | a29bf2cd09e0a1bf36aac99ebc551658c58b2a58 (diff) |
Change-Id: I270dc67545d27cd3177414112f14684df63a70ad
Reviewed-by: Nicolas Arnaud-Cormos <[email protected]>
-rw-r--r-- | scriptmanager.cpp | 6 | ||||
-rw-r--r-- | scriptmanager.h | 1 | ||||
-rw-r--r-- | utils/utils.cpp | 6 | ||||
-rw-r--r-- | utils/utils.h | 1 |
4 files changed, 14 insertions, 0 deletions
diff --git a/scriptmanager.cpp b/scriptmanager.cpp index c605a67..6def7c2 100644 --- a/scriptmanager.cpp +++ b/scriptmanager.cpp @@ -118,6 +118,12 @@ ScriptManager::ScriptList ScriptManager::scriptList() const return m_scriptList; } +void ScriptManager::addScriptPath(const QString &path) +{ + m_watcher->addPath(path); + directoryChanged(path, true); +} + QStringList scriptListFromDir(const QString &path) { QDir dir(path); diff --git a/scriptmanager.h b/scriptmanager.h index 7861986..e212fe5 100644 --- a/scriptmanager.h +++ b/scriptmanager.h @@ -80,6 +80,7 @@ public: QString defaultDirectory() const; QString scriptDirectory(ProjectExplorer::Project *project) const; ScriptList scriptList() const; + void addScriptPath(const QString& path); public slots: void runFile(const QString &scriptName); diff --git a/utils/utils.cpp b/utils/utils.cpp index 9208b45..091a958 100644 --- a/utils/utils.cpp +++ b/utils/utils.cpp @@ -31,6 +31,7 @@ #include <QDir> #include "scriptrunner.h" #include <QFile> +#include <scriptmanager.h> namespace Scripting { namespace Internal { @@ -82,6 +83,11 @@ void Utils::touchFile(const QString &fileName) file.close(); } +void Utils::addScriptPath(const QString &path) +{ + ScriptManager::instance()->addScriptPath(path); +} + } // namespace Internal } // namespace Scripting diff --git a/utils/utils.h b/utils/utils.h index d0f12f6..e4ebec1 100644 --- a/utils/utils.h +++ b/utils/utils.h @@ -47,6 +47,7 @@ public slots: QStringList backtrace() const; bool copyFile(const QString& from, const QString& to); void touchFile(const QString& fileName); + void addScriptPath(const QString& path); public: QString currentScripRoot() const; |