History

get this working on windows

Seth Alves committed 10 years ago

Commit 62372411 parent bb433473 files · +5 −3Browse files

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

Unified · Split

libraries/script-engine/src/ScriptsModel.cpp+3−1
@@ -162,10 +162,12 @@ void ScriptsModel::requestDefaultFiles(QString marker) { · 161 unmodified lines
162162 // QString localDir = url.toLocalFile() + "/scripts";
163163 QString localDir = expandScriptUrl(url).toLocalFile() + "/scripts";
164164 int localDirPartCount = localDir.split("/").size();
165+ #ifdef Q_OS_WIN
166+ localDirPartCount++; // one for the drive letter
167+ #endif
165168 QDirIterator it(localDir, QStringList() << "*.js", QDir::Files, QDirIterator::Subdirectories);
166169 while (it.hasNext()) {
167170 QUrl jsFullPath = QUrl::fromLocalFile(it.next());
168− // QString jsPartialPath = jsFullPath.path().mid(localDir.length() + 1); // + 1 to skip a separator
169171 QString jsPartialPath = jsFullPath.path().split("/").mid(localDirPartCount).join("/");
170172 jsFullPath = normalizeScriptURL(jsFullPath);
171173 _treeNodes.append(new TreeNodeScript(jsPartialPath, jsFullPath.toString(), SCRIPT_ORIGIN_DEFAULT));