Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 2 files). Show all
Unified · Split
| @@ -426,9 +426,9 @@ QString ScriptEngine::getFilename() const { · 425 unmodified lines | ||
| 426 | 426 | } |
| 427 | 427 | |
| 428 | 428 | bool ScriptEngine::hasValidScriptSuffix(const QString& scriptFileName) { |
| 429 | − QFileInfo fileInfo(scriptFileName); | |
| 430 | − QString scriptSuffixToLower = fileInfo.completeSuffix().toLower(); | |
| 431 | − return scriptSuffixToLower.contains(QString("js"), Qt::CaseInsensitive); | |
| 429 | + QFileInfo fileInfo(scriptFileName); | |
| 430 | + QString scriptSuffixToLower = fileInfo.completeSuffix().toLower(); | |
| 431 | + return scriptSuffixToLower.contains(QString("js"), Qt::CaseInsensitive); | |
| 432 | 432 | } |
| 433 | 433 | |
| 434 | 434 | void ScriptEngine::loadURL(const QUrl& scriptURL, bool reload) { |
| @@ -441,10 +441,10 @@ void ScriptEngine::loadURL(const QUrl& scriptURL, bool reload) { · 6 unmodified lines | ||
| 441 | 441 | _isReloading = reload; |
| 442 | 442 | |
| 443 | 443 | // Check that script has a supported file extension |
| 444 | − if (!hasValidScriptSuffix(_fileNameString)) { | |
| 445 | − scriptErrorMessage("File extension of file: " + _fileNameString + " is not a currently supported script type"); | |
| 446 | − emit errorLoadingScript(_fileNameString); | |
| 447 | − return; | |
| 444 | + if (!hasValidScriptSuffix(_fileNameString)) { | |
| 445 | + scriptErrorMessage("File extension of file: " + _fileNameString + " is not a currently supported script type"); | |
| 446 | + emit errorLoadingScript(_fileNameString); | |
| 447 | + return; | |
| 448 | 448 | } |
| 449 | 449 | |
| 450 | 450 | const auto maxRetries = 0; // for consistency with previous scriptCache->getScript() behavior |