History

Fixed loading local stored scripts on Windows machines

Thijs Wenker committed 12 years ago

Commit 5d812c81 parent 973fb951 file · +3 −2Browse 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+3−2
@@ -92,8 +92,9 @@ ScriptEngine::ScriptEngine(const QUrl& scriptURL, · 91 unmodified lines
9292
9393 QUrl url(scriptURL);
9494
95− // if the scheme is empty, maybe they typed in a file, let's try
96− if (url.scheme().isEmpty()) {
95+ // if the scheme length is one or lower, maybe they typed in a file, let's try
96+ const DWORD WINDOWS_DRIVE_LETTER_SIZE = 1;
97+ if (url.scheme().size() <= WINDOWS_DRIVE_LETTER_SIZE) {
9798 url = QUrl::fromLocalFile(scriptURLString);
9899 }
99100