Showing the changes to libraries/script-engine/src/ScriptsModel.cpp (1 of 3 files). Show all
Unified · Split
| @@ -158,13 +158,13 @@ void ScriptsModel::requestDefaultFiles(QString marker) { · 157 unmodified lines | |||
| 158 | QUrl url(defaultScriptsLocation()); | 158 | QUrl url(defaultScriptsLocation()); |
| 159 | 159 | ||
| 160 | if (url.isLocalFile()) { | 160 | if (url.isLocalFile()) { |
| 161 | // QDirIterator it(url.toLocalFile(), QStringList() << "*.js", QDir::Files, QDirIterator::Subdirectories); | 161 | QString localDir = url.toLocalFile() + "/scripts"; |
| 162 | // while (it.hasNext()) { | 162 | QDirIterator it(localDir, QStringList() << "*.js", QDir::Files, QDirIterator::Subdirectories); |
| 163 | // QString jsFile = it.next();; | 163 | while (it.hasNext()) { |
| 164 | // _treeNodes.append(new TreeNodeScript(lastKey.mid(MODELS_LOCATION.length()), | 164 | QString jsFullPath = it.next(); |
| 165 | // defaultScriptsLocation() + "/" + jsFile, | 165 | QString jsPartialPath = jsFullPath.mid(localDir.length() + 1); // + 1 to skip a separator |
| 166 | // SCRIPT_ORIGIN_DEFAULT)); | 166 | _treeNodes.append(new TreeNodeScript(jsPartialPath, jsFullPath, SCRIPT_ORIGIN_DEFAULT)); |
| 167 | // } | 167 | } |
| 168 | } else { | 168 | } else { |
| 169 | QUrlQuery query; | 169 | QUrlQuery query; |
| 170 | query.addQueryItem(PREFIX_PARAMETER_NAME, MODELS_LOCATION); | 170 | query.addQueryItem(PREFIX_PARAMETER_NAME, MODELS_LOCATION); |