changeset 1469:c8183f084ad8 3.0-integration

Avoid accidentally resetting locale to the empty string when reading pref
author Chris Cannam
date Tue, 03 Jan 2017 16:45:43 +0000
parents 7362be7580d1
children 8b72c5a7dfe5
files main/main.cpp
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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;