Consider empty locale setting as not set

This commit is contained in:
Vladimir Golovnev (Glassez) 2018-10-27 20:59:08 +03:00
parent b5d253ae66
commit 5712c05e68
No known key found for this signature in database
GPG Key ID: 52A2C7DEE2DFA6F7

View File

@ -91,7 +91,8 @@ void Preferences::setValue(const QString &key, const QVariant &value)
// General options // General options
QString Preferences::getLocale() const 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) void Preferences::setLocale(const QString &locale)