Showing the changes to libraries/script-engine/src/ScriptsModel.cpp (1 of 4 files). Show all
Unified · Split
| @@ -160,6 +160,13 @@ void ScriptsModel::requestDefaultFiles(QString marker) { · 159 unmodified lines | ||
| 160 | 160 | // if the url indicates a local directory, use QDirIterator |
| 161 | 161 | QString localDir = expandScriptUrl(url).toLocalFile(); |
| 162 | 162 | int localDirPartCount = localDir.split("/").size(); |
| 163 | + if (localDir.endsWith("/")) { | |
| 164 | + localDirPartCount--; | |
| 165 | + } | |
| 166 | + qDebug() << "|"; | |
| 167 | + qDebug() << "|"; | |
| 168 | + qDebug() << "|"; | |
| 169 | + qDebug() << localDir; | |
| 163 | 170 | #ifdef Q_OS_WIN |
| 164 | 171 | localDirPartCount++; // one for the drive letter |
| 165 | 172 | #endif |
| @@ -238,7 +245,7 @@ bool ScriptsModel::parseXML(QByteArray xmlFile) { · 72 unmodified lines | ||
| 238 | 245 | if (jsRegex.exactMatch(xml.text().toString())) { |
| 239 | 246 | QString localPath = lastKey.split("/").mid(1).join("/"); |
| 240 | 247 | QUrl fullPath = defaultScriptsLocation(); |
| 241 | − fullPath.setPath(fullPath.path() + "/" + lastKey); | |
| 248 | + fullPath.setPath(fullPath.path() + lastKey); | |
| 242 | 249 | const QString fullPathStr = normalizeScriptURL(fullPath).toString(); |
| 243 | 250 | _treeNodes.append(new TreeNodeScript(localPath, fullPathStr, SCRIPT_ORIGIN_DEFAULT)); |
| 244 | 251 | } |