summaryrefslogtreecommitdiffstats
path: root/qt-ui/models.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-02-12 06:18:15 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-02-12 06:22:10 -0800
commit6332976c3d570e7f585e17b6897ae3dc07d7376c (patch)
tree818266e840fad0a9b92f74fc9a71833ac2c8758e /qt-ui/models.cpp
parent9c9867dec527e3d0231a71c043fd9dc9b894a339 (diff)
downloadsubsurface-6332976c3d570e7f585e17b6897ae3dc07d7376c.tar.gz
Whitespace and dead code cleanup
The coding style for switch isn't the prettiest, but let's at least keep things consistent. Also, those ugly break statements never got reached, anyway. And there was no need to re-declare and re-generate currentString. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/models.cpp')
-rw-r--r--qt-ui/models.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp
index 93bc446ef..942be2e5a 100644
--- a/qt-ui/models.cpp
+++ b/qt-ui/models.cpp
@@ -1862,14 +1862,12 @@ QVariant LanguageModel::data(const QModelIndex& index, int role) const
if (!index.isValid())
return QVariant();
switch (role) {
- case Qt::DisplayRole: {
- QLocale l( currentString.remove("subsurface_"));
- return currentString == "English" ? currentString : QString("%1 (%2)").arg(l.languageToString(l.language())).arg(l.countryToString(l.country()));
- }break;
- case Qt::UserRole: {
- QString currentString = languages.at(index.row());
- return currentString == "English" ? "en_US" : currentString.remove("subsurface_");
- }break;
+ case Qt::DisplayRole: {
+ QLocale l( currentString.remove("subsurface_"));
+ 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 QVariant();
}