History

switch to apply normalizeURL only and move to top of for loop

humbletim committed 10 years ago

Commit 28eadc11 parent d749f241 file · +2 −3Browse files

Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 1 file). Show all

Unified · Split

libraries/script-engine/src/ScriptEngine.cpp+2−3
@@ -1172,7 +1172,8 @@ void ScriptEngine::include(const QStringList& includeFiles, QScriptValue callbac · 1171 unmodified lines
11721172 // Guard against meaningless query and fragment parts.
11731173 // Do NOT use PreferLocalFile as its behavior is unpredictable (e.g., on defaultScriptsLocation())
11741174 const auto strippingFlags = QUrl::RemoveFilename | QUrl::RemoveQuery | QUrl::RemoveFragment;
1175− for (QString file : includeFiles) {
1175+ for (QString includeFile : includeFiles) {
1176+ QString file = ResourceManager::normalizeURL(includeFile);
11761177 QUrl thisURL;
11771178 bool isStandardLibrary = false;
11781179 if (file.startsWith("/~/")) {
@@ -1187,8 +1188,6 @@ void ScriptEngine::include(const QStringList& includeFiles, QScriptValue callbac · 8 unmodified lines
11871188 thisURL = resolvePath(file);
11881189 }
11891190
1190− thisURL = expandScriptUrl(normalizeScriptURL(ResourceManager::normalizeURL(thisURL)));
1191−
11921191 if (!_includedURLs.contains(thisURL)) {
11931192 if (!isStandardLibrary && !currentSandboxURL.isEmpty() && (thisURL.scheme() == "file") &&
11941193 (currentSandboxURL.scheme() != "file" ||