summaryrefslogtreecommitdiffstats
path: root/qt-models
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2016-09-20 12:47:31 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-09-20 12:48:30 -0700
commit6b181d6b8579b8281257a0d3cdeaff4769c96477 (patch)
tree0dc6937ae8d1cc7474f093917465e7b3abf7bbb2 /qt-models
parent5fdbc1ffc3c7b161e96e45e2a393eaf7b3bf853f (diff)
downloadsubsurface-6b181d6b8579b8281257a0d3cdeaff4769c96477.tar.gz
Language preference: remove the .qm suffix before handling locale
Otherwise things don't match as one might expect... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-models')
-rw-r--r--qt-models/models.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/qt-models/models.cpp b/qt-models/models.cpp
index 655213e62..5b2f7f779 100644
--- a/qt-models/models.cpp
+++ b/qt-models/models.cpp
@@ -82,11 +82,11 @@ QVariant LanguageModel::data(const QModelIndex &index, int role) const
return QVariant();
switch (role) {
case Qt::DisplayRole: {
- QLocale l(currentString.remove("subsurface_"));
+ QLocale l(currentString.remove("subsurface_").remove(".qm"));
return currentString == "English" ? currentString : QString("%1 (%2)").arg(l.languageToString(l.language())).arg(l.countryToString(l.country()));
}
case Qt::UserRole:
- return currentString == "English" ? "en_US" : currentString.remove("subsurface_");
+ return currentString == "English" ? "en_US" : currentString.remove("subsurface_").remove(".qm");
}
return QVariant();
}