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
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 try98 // 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