try, try again

This commit is contained in:
Seth Alves 2016-02-16 01:13:37 -08:00
parent f2c9bbc32d
commit 164d5d9c7e

View file

@ -42,16 +42,21 @@ ScriptEngines::ScriptEngines()
}
QString normalizeScriptUrl(const QString& rawScriptUrl) {
auto lower = rawScriptUrl.toLower();
#ifndef Q_OS_LINUX
if (!rawScriptUrl.startsWith("http:") && !rawScriptUrl.startsWith("https:") && !rawScriptUrl.startsWith("atp:")) {
#ifdef Q_OS_LINUX
if (rawScriptUrl.startsWith("file:")) {
return rawScriptUrl;
}
return QUrl::fromLocalFile(rawScriptUrl).toString();
#else
if (rawScriptUrl.startsWith("file:")) {
return rawScriptUrl.toLower();
}
// Force lowercase on file scripts because of drive letter weirdness.
return QUrl::fromLocalFile(rawScriptUrl).toString().toLower();
}
#endif
}
return QUrl(rawScriptUrl).toString();
}