style fixes

This commit is contained in:
Liv 2017-05-23 15:21:21 -07:00
parent 09c7a61599
commit b2bbf21fb0
2 changed files with 8 additions and 8 deletions

View file

@ -426,9 +426,9 @@ QString ScriptEngine::getFilename() const {
} }
bool ScriptEngine::hasValidScriptSuffix(const QString& scriptFileName) { bool ScriptEngine::hasValidScriptSuffix(const QString& scriptFileName) {
QFileInfo fileInfo(scriptFileName); QFileInfo fileInfo(scriptFileName);
QString scriptSuffixToLower = fileInfo.completeSuffix().toLower(); QString scriptSuffixToLower = fileInfo.completeSuffix().toLower();
return scriptSuffixToLower.contains(QString("js"), Qt::CaseInsensitive); return scriptSuffixToLower.contains(QString("js"), Qt::CaseInsensitive);
} }
void ScriptEngine::loadURL(const QUrl& scriptURL, bool reload) { void ScriptEngine::loadURL(const QUrl& scriptURL, bool reload) {
@ -441,10 +441,10 @@ void ScriptEngine::loadURL(const QUrl& scriptURL, bool reload) {
_isReloading = reload; _isReloading = reload;
// Check that script has a supported file extension // Check that script has a supported file extension
if (!hasValidScriptSuffix(_fileNameString)) { if (!hasValidScriptSuffix(_fileNameString)) {
scriptErrorMessage("File extension of file: " + _fileNameString + " is not a currently supported script type"); scriptErrorMessage("File extension of file: " + _fileNameString + " is not a currently supported script type");
emit errorLoadingScript(_fileNameString); emit errorLoadingScript(_fileNameString);
return; return;
} }
const auto maxRetries = 0; // for consistency with previous scriptCache->getScript() behavior const auto maxRetries = 0; // for consistency with previous scriptCache->getScript() behavior

View file

@ -146,7 +146,7 @@ public:
/// to run... NOTE - this is used by Application currently to load the url. We don't really want it to be exposed /// to run... NOTE - this is used by Application currently to load the url. We don't really want it to be exposed
/// to scripts. we may not need this to be invokable /// to scripts. we may not need this to be invokable
void loadURL(const QUrl& scriptURL, bool reload); void loadURL(const QUrl& scriptURL, bool reload);
bool hasValidScriptSuffix(const QString& scriptFileName); bool hasValidScriptSuffix(const QString& scriptFileName);
Q_INVOKABLE QString getContext() const; Q_INVOKABLE QString getContext() const;
Q_INVOKABLE bool isClientScript() const { return _context == CLIENT_SCRIPT; } Q_INVOKABLE bool isClientScript() const { return _context == CLIENT_SCRIPT; }