Showing the changes to libraries/script-engine/src/ScriptsModel.cpp (1 of 3 files). Show all
Unified · Split
| @@ -162,10 +162,12 @@ void ScriptsModel::requestDefaultFiles(QString marker) { · 161 unmodified lines | ||
| 162 | 162 | // QString localDir = url.toLocalFile() + "/scripts"; |
| 163 | 163 | QString localDir = expandScriptUrl(url).toLocalFile() + "/scripts"; |
| 164 | 164 | int localDirPartCount = localDir.split("/").size(); |
| 165 | + #ifdef Q_OS_WIN | |
| 166 | + localDirPartCount++; // one for the drive letter | |
| 167 | + #endif | |
| 165 | 168 | QDirIterator it(localDir, QStringList() << "*.js", QDir::Files, QDirIterator::Subdirectories); |
| 166 | 169 | while (it.hasNext()) { |
| 167 | 170 | QUrl jsFullPath = QUrl::fromLocalFile(it.next()); |
| 168 | − // QString jsPartialPath = jsFullPath.path().mid(localDir.length() + 1); // + 1 to skip a separator | |
| 169 | 171 | QString jsPartialPath = jsFullPath.path().split("/").mid(localDirPartCount).join("/"); |
| 170 | 172 | jsFullPath = normalizeScriptURL(jsFullPath); |
| 171 | 173 | _treeNodes.append(new TreeNodeScript(jsPartialPath, jsFullPath.toString(), SCRIPT_ORIGIN_DEFAULT)); |