mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
9c9867dec5
commit
6332976c3d
2 changed files with 7 additions and 9 deletions
|
@ -74,4 +74,4 @@ QColor getSacColor(int sac, int avg_sac)
|
|||
if (sac_index > SAC_COLORS - 1)
|
||||
sac_index = SAC_COLORS - 1;
|
||||
return getColor((color_indice_t)(SAC_COLORS_START_IDX + sac_index), false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue