From 9b7b477d7cc868212045a78b30089363cbebcf91 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Fri, 6 Dec 2013 17:48:38 -0200 Subject: Added 'English' and 'Use System Default' options. These complete the ability to select languages from the preferences panel. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/models.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'qt-ui/models.cpp') diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp index 985d213f6..e57ececd4 100644 --- a/qt-ui/models.cpp +++ b/qt-ui/models.cpp @@ -1772,24 +1772,24 @@ LanguageModel::LanguageModel(QObject* parent): QAbstractListModel(parent) if ( !s.endsWith(".qm") ){ continue; } - languages.push_back(s); + languages.push_back( (s == "subsurface_source.qm") ? "English" : s); } } QVariant LanguageModel::data(const QModelIndex& index, int role) const { QLocale loc; + QString currentString = languages.at(index.row()); if(!index.isValid()) return QVariant(); switch(role){ case Qt::DisplayRole:{ - QString currentString = languages.at(index.row()); QLocale l( currentString.remove("subsurface_")); - return l.countryToString(l.country()); + return currentString == "English" ? currentString : l.countryToString(l.country()); }break; case Qt::UserRole:{ QString currentString = languages.at(index.row()); - return currentString.remove("subsurface_"); + return currentString == "English" ? "en_US" : currentString.remove("subsurface_"); }break; } return QVariant(); -- cgit v1.2.3-70-g09d2