Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 1 file). Show all
Unified · Split
| @@ -912,7 +912,13 @@ void ScriptEngine::include(const QStringList& includeFiles, QScriptValue callbac · 911 unmodified lines | ||
| 912 | 912 | // Do NOT use PreferLocalFile as its behavior is unpredictable (e.g., on defaultScriptsLocation()) |
| 913 | 913 | const auto strippingFlags = QUrl::RemoveFilename | QUrl::RemoveQuery | QUrl::RemoveFragment; |
| 914 | 914 | for (QString file : includeFiles) { |
| 915 | − QUrl thisURL { resolvePath(file) }; | |
| 915 | + QUrl thisURL; | |
| 916 | + if (file.startsWith("/~/")) { | |
| 917 | + thisURL = expandScriptUrl(QUrl::fromLocalFile(file)); | |
| 918 | + } else { | |
| 919 | + thisURL = resolvePath(file); | |
| 920 | + } | |
| 921 | + | |
| 916 | 922 | if (!_includedURLs.contains(thisURL)) { |
| 917 | 923 | if (!currentSandboxURL.isEmpty() && (thisURL.scheme() == "file") && |
| 918 | 924 | ( |