# HG changeset patch # User Chris Cannam # Date 1483461943 0 # Node ID c8183f084ad8901fe4cbee618b563ebe72faef27 # Parent 7362be7580d1868b58ac0ebcb289de7c738efd21 Avoid accidentally resetting locale to the empty string when reading pref diff -r 7362be7580d1 -r c8183f084ad8 main/main.cpp --- a/main/main.cpp Tue Jan 03 16:39:42 2017 +0000 +++ b/main/main.cpp Tue Jan 03 16:45:43 2017 +0000 @@ -308,9 +308,11 @@ QApplication::setWindowIcon(icon); QString language = QLocale::system().name(); + SVDEBUG << "System language is: " << language << endl; settings.beginGroup("Preferences"); - language = settings.value("locale", language).toString(); + QString prefLanguage = settings.value("locale", language).toString(); + if (prefLanguage != QString()) language = prefLanguage; settings.endGroup(); QTranslator qtTranslator;