Showing the changes to libraries/script-engine/src/ScriptsModel.cpp (1 of 8 files). Show all
Unified · Split
| @@ -125,15 +125,15 @@ int ScriptsModel::columnCount(const QModelIndex& parent) const { · 124 unmodified lines | ||
| 125 | 125 | |
| 126 | 126 | void ScriptsModel::updateScriptsLocation(const QString& newPath) { |
| 127 | 127 | _fsWatcher.removePath(_localDirectory.absolutePath()); |
| 128 | − | |
| 128 | + | |
| 129 | 129 | if (!newPath.isEmpty()) { |
| 130 | 130 | _localDirectory.setPath(newPath); |
| 131 | − | |
| 131 | + | |
| 132 | 132 | if (!_localDirectory.absolutePath().isEmpty()) { |
| 133 | 133 | _fsWatcher.addPath(_localDirectory.absolutePath()); |
| 134 | 134 | } |
| 135 | 135 | } |
| 136 | − | |
| 136 | + | |
| 137 | 137 | reloadLocalFiles(); |
| 138 | 138 | } |
| 139 | 139 | |
| @@ -154,7 +154,7 @@ void ScriptsModel::reloadDefaultFiles() { · 14 unmodified lines | ||
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | void ScriptsModel::requestDefaultFiles(QString marker) { |
| 157 | − QUrl url(defaultScriptsLocation()); | |
| 157 | + QUrl url(PathUtils::defaultScriptsLocation()); | |
| 158 | 158 | |
| 159 | 159 | // targets that don't have a scripts folder in the appropriate location will have an empty URL here |
| 160 | 160 | if (!url.isEmpty()) { |
| @@ -244,7 +244,7 @@ bool ScriptsModel::parseXML(QByteArray xmlFile) { · 83 unmodified lines | ||
| 244 | 244 | lastKey = xml.text().toString(); |
| 245 | 245 | if (jsRegex.exactMatch(xml.text().toString())) { |
| 246 | 246 | QString localPath = lastKey.split("/").mid(1).join("/"); |
| 247 | − QUrl fullPath = defaultScriptsLocation(); | |
| 247 | + QUrl fullPath = PathUtils::defaultScriptsLocation(); | |
| 248 | 248 | fullPath.setPath(fullPath.path() + lastKey); |
| 249 | 249 | const QString fullPathStr = normalizeScriptURL(fullPath).toString(); |
| 250 | 250 | _treeNodes.append(new TreeNodeScript(localPath, fullPathStr, SCRIPT_ORIGIN_DEFAULT)); |