mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 18:23:54 +02:00
get this working on windows
This commit is contained in:
parent
bb43347599
commit
62372415be
3 changed files with 5 additions and 3 deletions
|
@ -51,7 +51,7 @@ QUrl normalizeScriptURL(const QUrl& rawScriptURL) {
|
|||
#else
|
||||
// Force lowercase on file scripts because of drive letter weirdness.
|
||||
if (rawScriptURL.isLocalFile()) {
|
||||
fullNormal.setPath(fullNormal.path.toLower());
|
||||
fullNormal.setPath(fullNormal.path().toLower());
|
||||
}
|
||||
#endif
|
||||
// if this url is something "beneath" the default script url, replace the local path with ~
|
||||
|
|
|
@ -162,10 +162,12 @@ void ScriptsModel::requestDefaultFiles(QString marker) {
|
|||
// QString localDir = url.toLocalFile() + "/scripts";
|
||||
QString localDir = expandScriptUrl(url).toLocalFile() + "/scripts";
|
||||
int localDirPartCount = localDir.split("/").size();
|
||||
#ifdef Q_OS_WIN
|
||||
localDirPartCount++; // one for the drive letter
|
||||
#endif
|
||||
QDirIterator it(localDir, QStringList() << "*.js", QDir::Files, QDirIterator::Subdirectories);
|
||||
while (it.hasNext()) {
|
||||
QUrl jsFullPath = QUrl::fromLocalFile(it.next());
|
||||
// QString jsPartialPath = jsFullPath.path().mid(localDir.length() + 1); // + 1 to skip a separator
|
||||
QString jsPartialPath = jsFullPath.path().split("/").mid(localDirPartCount).join("/");
|
||||
jsFullPath = normalizeScriptURL(jsFullPath);
|
||||
_treeNodes.append(new TreeNodeScript(jsPartialPath, jsFullPath.toString(), SCRIPT_ORIGIN_DEFAULT));
|
||||
|
|
|
@ -57,7 +57,7 @@ QString findMostRecentFileExtension(const QString& originalFileName, QVector<QSt
|
|||
|
||||
QUrl defaultScriptsLocation() {
|
||||
#ifdef Q_OS_WIN
|
||||
return QUrl(("file://" + QCoreApplication::applicationDirPath()).toLower());
|
||||
return QUrl(("file:///" + QCoreApplication::applicationDirPath()).toLower());
|
||||
#elif defined(Q_OS_OSX)
|
||||
return QUrl(("file://" + QCoreApplication::applicationDirPath() + "/../..").toLower());
|
||||
#else
|
||||
|
|
Loading…
Reference in a new issue