diff options
-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; |