aboutsummaryrefslogtreecommitdiff
path: root/launcher/VersionProxyModel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'launcher/VersionProxyModel.cpp')
-rw-r--r--launcher/VersionProxyModel.cpp30
1 files changed, 10 insertions, 20 deletions
diff --git a/launcher/VersionProxyModel.cpp b/launcher/VersionProxyModel.cpp
index e5c66566..63a43465 100644
--- a/launcher/VersionProxyModel.cpp
+++ b/launcher/VersionProxyModel.cpp
@@ -193,31 +193,21 @@ QVariant VersionProxyModel::data(const QModelIndex &index, int role) const
}
case Qt::ToolTipRole:
{
- switch(column)
+ if(column == Name && hasRecommended)
{
- case Name:
+ auto value = sourceModel()->data(parentIndex, BaseVersionList::RecommendedRole);
+ if(value.toBool())
{
- if(hasRecommended)
+ return tr("Recommended");
+ } else if(hasLatest) {
+ auto value = sourceModel()->data(parentIndex, BaseVersionList::LatestRole);
+ if(value.toBool())
{
- auto value = sourceModel()->data(parentIndex, BaseVersionList::RecommendedRole);
- if(value.toBool())
- {
- return tr("Recommended");
- }
- else if(hasLatest)
- {
- auto value = sourceModel()->data(parentIndex, BaseVersionList::LatestRole);
- if(value.toBool())
- {
- return tr("Latest");
- }
- }
+ return tr("Latest");
}
}
- default:
- {
- return sourceModel()->data(parentIndex, BaseVersionList::VersionIdRole);
- }
+ } else {
+ return sourceModel()->data(parentIndex, BaseVersionList::VersionIdRole);
}
}
case Qt::DecorationRole: