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
1172 // Guard against meaningless query and fragment parts.1172 // Guard against meaningless query and fragment parts.
1173 // Do NOT use PreferLocalFile as its behavior is unpredictable (e.g., on defaultScriptsLocation())1173 // Do NOT use PreferLocalFile as its behavior is unpredictable (e.g., on defaultScriptsLocation())
1174 const auto strippingFlags = QUrl::RemoveFilename | QUrl::RemoveQuery | QUrl::RemoveFragment;1174 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);
1176 QUrl thisURL;1177 QUrl thisURL;
1177 bool isStandardLibrary = false;1178 bool isStandardLibrary = false;
1178 if (file.startsWith("/~/")) {1179 if (file.startsWith("/~/")) {
@@ -1187,8 +1188,6 @@ void ScriptEngine::include(const QStringList& includeFiles, QScriptValue callbac · 8 unmodified lines
1187 thisURL = resolvePath(file);1188 thisURL = resolvePath(file);
1188 }1189 }
1189 1190
1190 thisURL = expandScriptUrl(normalizeScriptURL(ResourceManager::normalizeURL(thisURL)));
1191
1192 if (!_includedURLs.contains(thisURL)) {1191 if (!_includedURLs.contains(thisURL)) {
1193 if (!isStandardLibrary && !currentSandboxURL.isEmpty() && (thisURL.scheme() == "file") &&1192 if (!isStandardLibrary && !currentSandboxURL.isEmpty() && (thisURL.scheme() == "file") &&
1194 (currentSandboxURL.scheme() != "file" ||1193 (currentSandboxURL.scheme() != "file" ||