From 5bce924eda4dcb16be76ddd89346cd1503c47474 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Fri, 8 Jul 2016 10:11:59 -0700 Subject: [PATCH] keep signature for askToLoadScript --- interface/src/Application.cpp | 9 +++++---- interface/src/Application.h | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 93465c8228..94dc26693f 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -4804,16 +4804,17 @@ bool Application::askToSetAvatarUrl(const QString& url) { } -bool Application::askToLoadScript(QString scriptFilenameOrURL) { +bool Application::askToLoadScript(const QString& scriptFilenameOrURL) { QMessageBox::StandardButton reply; static const QString MARKETPLACE_SCRIPT_URL_HOSTNAME_SUFFIX = "mpassets.highfidelity.com"; - if (scriptFilenameOrURL.contains(MARKETPLACE_SCRIPT_URL_HOSTNAME_SUFFIX)) { - scriptFilenameOrURL = scriptFilenameOrURL.mid(scriptFilenameOrURL.lastIndexOf('/') + 1); + QString shortName = scriptFilenameOrURL; + if (shortName.contains(MARKETPLACE_SCRIPT_URL_HOSTNAME_SUFFIX)) { + shortName = shortName.mid(shortName.lastIndexOf('/') + 1); } - QString message = "Would you like to run this script:\n" + scriptFilenameOrURL; + QString message = "Would you like to run this script:\n" + shortName; reply = OffscreenUi::question(getWindow(), "Run Script", message, QMessageBox::Yes | QMessageBox::No); diff --git a/interface/src/Application.h b/interface/src/Application.h index 234d79dc0d..6857ba2a3a 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -329,7 +329,7 @@ private slots: bool acceptSnapshot(const QString& urlString); bool askToSetAvatarUrl(const QString& url); - bool askToLoadScript(QString scriptFilenameOrURL); + bool askToLoadScript(const QString& scriptFilenameOrURL); bool askToWearAvatarAttachmentUrl(const QString& url); void displayAvatarAttachmentWarning(const QString& message) const;