Merge pull request #10989 from druiz17/bug-whitespace-script-url

Fixed not being able to load a script url that has a white space
This commit is contained in:
Brad Hefta-Gaub 2017-07-18 11:39:10 -07:00 committed by GitHub
commit 0ba9d65732

View file

@ -6599,11 +6599,11 @@ void Application::setPreviousScriptLocation(const QString& location) {
} }
void Application::loadScriptURLDialog() const { void Application::loadScriptURLDialog() const {
auto newScript = OffscreenUi::getText(OffscreenUi::ICON_NONE, "Open and Run Script", "Script URL"); QString newScript = OffscreenUi::getText(OffscreenUi::ICON_NONE, "Open and Run Script", "Script URL");
if (QUrl(newScript).scheme() == "atp") { if (QUrl(newScript).scheme() == "atp") {
OffscreenUi::warning("Error Loading Script", "Cannot load client script over ATP"); OffscreenUi::warning("Error Loading Script", "Cannot load client script over ATP");
} else if (!newScript.isEmpty()) { } else if (!newScript.isEmpty()) {
DependencyManager::get<ScriptEngines>()->loadScript(newScript); DependencyManager::get<ScriptEngines>()->loadScript(newScript.trimmed());
} }
} }