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
162 // QString localDir = url.toLocalFile() + "/scripts";162 // QString localDir = url.toLocalFile() + "/scripts";
163 QString localDir = expandScriptUrl(url).toLocalFile() + "/scripts";163 QString localDir = expandScriptUrl(url).toLocalFile() + "/scripts";
164 int localDirPartCount = localDir.split("/").size();164 int localDirPartCount = localDir.split("/").size();
165 #ifdef Q_OS_WIN
166 localDirPartCount++; // one for the drive letter
167 #endif
165 QDirIterator it(localDir, QStringList() << "*.js", QDir::Files, QDirIterator::Subdirectories);168 QDirIterator it(localDir, QStringList() << "*.js", QDir::Files, QDirIterator::Subdirectories);
166 while (it.hasNext()) {169 while (it.hasNext()) {
167 QUrl jsFullPath = QUrl::fromLocalFile(it.next());170 QUrl jsFullPath = QUrl::fromLocalFile(it.next());
168 // QString jsPartialPath = jsFullPath.path().mid(localDir.length() + 1); // + 1 to skip a separator
169 QString jsPartialPath = jsFullPath.path().split("/").mid(localDirPartCount).join("/");171 QString jsPartialPath = jsFullPath.path().split("/").mid(localDirPartCount).join("/");
170 jsFullPath = normalizeScriptURL(jsFullPath);172 jsFullPath = normalizeScriptURL(jsFullPath);
171 _treeNodes.append(new TreeNodeScript(jsPartialPath, jsFullPath.toString(), SCRIPT_ORIGIN_DEFAULT));173 _treeNodes.append(new TreeNodeScript(jsPartialPath, jsFullPath.toString(), SCRIPT_ORIGIN_DEFAULT));