diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2013-12-06 17:48:38 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-12-06 11:58:29 -0800 |
commit | 9b7b477d7cc868212045a78b30089363cbebcf91 (patch) | |
tree | 2d8a00b88f4a7637cb1920c0c629ff581e679ff1 /qt-ui/models.cpp | |
parent | 7436178fe0817a4c5defac28f1a395d84cf539b5 (diff) | |
download | subsurface-9b7b477d7cc868212045a78b30089363cbebcf91.tar.gz |
Added 'English' and 'Use System Default' options.
These complete the ability to select languages from the preferences panel.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/models.cpp')
-rw-r--r-- | qt-ui/models.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
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(); |