Consider empty locale setting as not set

This commit is contained in:
Vladimir Golovnev (Glassez) 2018-10-27 20:59:08 +03:00 committed by sledgehammer999
parent e1bfa95a63
commit 93351476e4
No known key found for this signature in database
GPG key ID: 6E4A2D025B7CC9A2

View file

@ -91,7 +91,8 @@ void Preferences::setValue(const QString &key, const QVariant &value)
// General options
QString Preferences::getLocale() const
{
return value("Preferences/General/Locale", QLocale::system().name()).toString();
const QString localeName = value("Preferences/General/Locale").toString();
return (localeName.isEmpty() ? QLocale::system().name() : localeName);
}
void Preferences::setLocale(const QString &locale)