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
160 // if the url indicates a local directory, use QDirIterator160 // if the url indicates a local directory, use QDirIterator
161 QString localDir = expandScriptUrl(url).toLocalFile();161 QString localDir = expandScriptUrl(url).toLocalFile();
162 int localDirPartCount = localDir.split("/").size();162 int localDirPartCount = localDir.split("/").size();
163 if (localDir.endsWith("/")) {
164 localDirPartCount--;
165 }
166 qDebug() << "|";
167 qDebug() << "|";
168 qDebug() << "|";
169 qDebug() << localDir;
163 #ifdef Q_OS_WIN170 #ifdef Q_OS_WIN
164 localDirPartCount++; // one for the drive letter171 localDirPartCount++; // one for the drive letter
165 #endif172 #endif
@@ -238,7 +245,7 @@ bool ScriptsModel::parseXML(QByteArray xmlFile) { · 72 unmodified lines
238 if (jsRegex.exactMatch(xml.text().toString())) {245 if (jsRegex.exactMatch(xml.text().toString())) {
239 QString localPath = lastKey.split("/").mid(1).join("/");246 QString localPath = lastKey.split("/").mid(1).join("/");
240 QUrl fullPath = defaultScriptsLocation();247 QUrl fullPath = defaultScriptsLocation();
241 fullPath.setPath(fullPath.path() + "/" + lastKey);248 fullPath.setPath(fullPath.path() + lastKey);
242 const QString fullPathStr = normalizeScriptURL(fullPath).toString();249 const QString fullPathStr = normalizeScriptURL(fullPath).toString();
243 _treeNodes.append(new TreeNodeScript(localPath, fullPathStr, SCRIPT_ORIGIN_DEFAULT));250 _treeNodes.append(new TreeNodeScript(localPath, fullPathStr, SCRIPT_ORIGIN_DEFAULT));
244 }251 }