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