History

Merge pull request #2635 from thoys/windows-script-path-fix

Fixed loading local stored scripts on Windows machines

Clément Brisset committed 12 years ago

Commit 5f6dee62 parents d7c2b44 825acbb1 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
@@ -95,8 +95,9 @@ ScriptEngine::ScriptEngine(const QUrl& scriptURL, · 94 unmodified lines
9595
9696 QUrl url(scriptURL);
9797
98− // if the scheme is empty, maybe they typed in a file, let's try
99− if (url.scheme().isEmpty()) {
98+ // if the scheme length is one or lower, maybe they typed in a file, let's try
99+ const int WINDOWS_DRIVE_LETTER_SIZE = 1;
100+ if (url.scheme().size() <= WINDOWS_DRIVE_LETTER_SIZE) {
100101 url = QUrl::fromLocalFile(scriptURLString);
101102 }
102103