Fix Cppcheck warning

This commit is contained in:
Daniel Marjamäki 2019-07-14 22:55:35 +02:00
parent aeefaf7004
commit 4854f0034d
1 changed files with 27 additions and 27 deletions

View File

@ -103,8 +103,7 @@ bool TranslationHandler::setLanguage(const QString &code)
if (index == -1) { if (index == -1) {
error = QObject::tr("Unknown language specified!"); error = QObject::tr("Unknown language specified!");
failure = true; failure = true;
} } else {
// Make sure there is a translator // Make sure there is a translator
if (!mTranslator && !failure) if (!mTranslator && !failure)
mTranslator = new QTranslator(this); mTranslator = new QTranslator(this);
@ -140,6 +139,7 @@ bool TranslationHandler::setLanguage(const QString &code)
error = error.arg(mTranslations[index].mName); error = error.arg(mTranslations[index].mName);
error = error.arg(translationFile); error = error.arg(translationFile);
} }
}
if (failure) { if (failure) {
const QString msg(tr("Failed to change the user interface language:" const QString msg(tr("Failed to change the user interface language:"