Showing the changes to interface/src/Application.cpp (1 of 2 files). Show all
Unified · Split
| @@ -4804,16 +4804,17 @@ bool Application::askToSetAvatarUrl(const QString& url) { · 4803 unmodified lines | ||
| 4804 | 4804 | } |
| 4805 | 4805 | |
| 4806 | 4806 | |
| 4807 | −bool Application::askToLoadScript(QString scriptFilenameOrURL) { | |
| 4807 | +bool Application::askToLoadScript(const QString& scriptFilenameOrURL) { | |
| 4808 | 4808 | QMessageBox::StandardButton reply; |
| 4809 | 4809 | |
| 4810 | 4810 | static const QString MARKETPLACE_SCRIPT_URL_HOSTNAME_SUFFIX = "mpassets.highfidelity.com"; |
| 4811 | 4811 | |
| 4812 | − if (scriptFilenameOrURL.contains(MARKETPLACE_SCRIPT_URL_HOSTNAME_SUFFIX)) { | |
| 4813 | − scriptFilenameOrURL = scriptFilenameOrURL.mid(scriptFilenameOrURL.lastIndexOf('/') + 1); | |
| 4812 | + QString shortName = scriptFilenameOrURL; | |
| 4813 | + if (shortName.contains(MARKETPLACE_SCRIPT_URL_HOSTNAME_SUFFIX)) { | |
| 4814 | + shortName = shortName.mid(shortName.lastIndexOf('/') + 1); | |
| 4814 | 4815 | } |
| 4815 | 4816 | |
| 4816 | − QString message = "Would you like to run this script:\n" + scriptFilenameOrURL; | |
| 4817 | + QString message = "Would you like to run this script:\n" + shortName; | |
| 4817 | 4818 | |
| 4818 | 4819 | reply = OffscreenUi::question(getWindow(), "Run Script", message, QMessageBox::Yes | QMessageBox::No); |
| 4819 | 4820 | |