Fixed loading local stored scripts on Windows machines
Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 1 file). Show all
Unified · Split
| @@ -95,8 +95,9 @@ ScriptEngine::ScriptEngine(const QUrl& scriptURL, · 94 unmodified lines | |||
| 95 | 95 | ||
| 96 | QUrl url(scriptURL); | 96 | QUrl url(scriptURL); |
| 97 | 97 | ||
| 98 | // if the scheme is empty, maybe they typed in a file, let's try | 98 | // if the scheme length is one or lower, maybe they typed in a file, let's try |
| 99 | if (url.scheme().isEmpty()) { | 99 | const int WINDOWS_DRIVE_LETTER_SIZE = 1; |
| 100 | if (url.scheme().size() <= WINDOWS_DRIVE_LETTER_SIZE) { | ||
| 100 | url = QUrl::fromLocalFile(scriptURLString); | 101 | url = QUrl::fromLocalFile(scriptURLString); |
| 101 | } | 102 | } |
| 102 | 103 | ||