diff options
Diffstat (limited to 'gui/groupview/InstanceDelegate.cpp')
-rw-r--r-- | gui/groupview/InstanceDelegate.cpp | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/gui/groupview/InstanceDelegate.cpp b/gui/groupview/InstanceDelegate.cpp index 3bd77747..e49e1552 100644 --- a/gui/groupview/InstanceDelegate.cpp +++ b/gui/groupview/InstanceDelegate.cpp @@ -113,16 +113,10 @@ void drawProgressOverlay(QPainter *painter, const QStyleOptionViewItemV4 &option void drawBadges(QPainter *painter, const QStyleOptionViewItemV4 &option, BaseInstance *instance) { QList<QString> pixmaps; - for (auto flag : instance->flags()) + const BaseInstance::InstanceFlags flags = instance->flags(); + if (flags & BaseInstance::VersionBrokenFlag) { - switch (flag) - { - case BaseInstance::VersionBrokenFlag: - pixmaps.append("broken"); - break; - default: - break; - } + pixmaps.append("broken"); } // begin easter eggs @@ -160,7 +154,7 @@ void drawBadges(QPainter *painter, const QStyleOptionViewItemV4 &option, BaseIns { return; } - const QPixmap pixmap = ListViewDelegate::requestPixmap(it.next()).scaled( + const QPixmap pixmap = ListViewDelegate::requestBadgePixmap(it.next()).scaled( itemSide, itemSide, Qt::KeepAspectRatio, Qt::FastTransformation); painter->drawPixmap(option.rect.width() - x * itemSide + qMax(x - 1, 0) * spacing - itemSide, y * itemSide + qMax(y - 1, 0) * spacing, itemSide, itemSide, @@ -354,7 +348,7 @@ QSize ListViewDelegate::sizeHint(const QStyleOptionViewItem &option, return sz; } -QPixmap ListViewDelegate::requestPixmap(const QString &key) +QPixmap ListViewDelegate::requestBadgePixmap(const QString &key) { if (!m_pixmapCache.contains(key)) { |