History

trying again on script loading changes

Seth Alves committed 10 years ago

Commit 35affe21 parent 0f288244 files · +67 −36Browse files

Showing the changes to libraries/script-engine/src/ScriptsModel.cpp (1 of 4 files). Show all

Unified · Split

libraries/script-engine/src/ScriptsModel.cpp+8−1
@@ -160,6 +160,13 @@ void ScriptsModel::requestDefaultFiles(QString marker) { · 159 unmodified lines
160160 // if the url indicates a local directory, use QDirIterator
161161 QString localDir = expandScriptUrl(url).toLocalFile();
162162 int localDirPartCount = localDir.split("/").size();
163+ if (localDir.endsWith("/")) {
164+ localDirPartCount--;
165+ }
166+ qDebug() << "|";
167+ qDebug() << "|";
168+ qDebug() << "|";
169+ qDebug() << localDir;
163170 #ifdef Q_OS_WIN
164171 localDirPartCount++; // one for the drive letter
165172 #endif
@@ -238,7 +245,7 @@ bool ScriptsModel::parseXML(QByteArray xmlFile) { · 72 unmodified lines
238245 if (jsRegex.exactMatch(xml.text().toString())) {
239246 QString localPath = lastKey.split("/").mid(1).join("/");
240247 QUrl fullPath = defaultScriptsLocation();
241− fullPath.setPath(fullPath.path() + "/" + lastKey);
248+ fullPath.setPath(fullPath.path() + lastKey);
242249 const QString fullPathStr = normalizeScriptURL(fullPath).toString();
243250 _treeNodes.append(new TreeNodeScript(localPath, fullPathStr, SCRIPT_ORIGIN_DEFAULT));
244251 }