summaryrefslogtreecommitdiff
path: root/src/modconflicticondelegate.h
diff options
context:
space:
mode:
authorMikaël Capelle <capelle.mikael@gmail.com>2021-01-01 15:30:08 +0100
committerMikaël Capelle <capelle.mikael@gmail.com>2021-01-02 15:38:19 +0100
commitd708287c9e73db94a097b8151ba8f2b6c820a84d (patch)
tree9c9435fd63dbaa5f9ffbba09dad468fe578e660f /src/modconflicticondelegate.h
parent3bb189a42724ad028402ee8d4418703350ff1a2c (diff)
Clean code and reorganize.
Diffstat (limited to 'src/modconflicticondelegate.h')
-rw-r--r--src/modconflicticondelegate.h26
1 files changed, 20 insertions, 6 deletions
diff --git a/src/modconflicticondelegate.h b/src/modconflicticondelegate.h
index 8645da12..7ab1bd11 100644
--- a/src/modconflicticondelegate.h
+++ b/src/modconflicticondelegate.h
@@ -1,6 +1,8 @@
#ifndef MODCONFLICTICONDELEGATE_H
#define MODCONFLICTICONDELEGATE_H
+#include <array>
+
#include "icondelegate.h"
class ModConflictIconDelegate : public IconDelegate
@@ -9,7 +11,7 @@ class ModConflictIconDelegate : public IconDelegate
public:
explicit ModConflictIconDelegate(QObject *parent = 0, int logicalIndex = -1, int compactSize = 80);
- virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
+ QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override;
static QList<QString> getIconsForFlags(
std::vector<ModInfo::EConflictFlag> flags, bool compact);
@@ -20,13 +22,25 @@ public slots:
void columnResized(int logicalIndex, int oldSize, int newSize);
protected:
- virtual QList<QString> getIcons(const QModelIndex &index) const;
- virtual size_t getNumIcons(const QModelIndex &index) const;
+ QList<QString> getIcons(const QModelIndex &index) const override;
+ size_t getNumIcons(const QModelIndex &index) const override;
private:
- static ModInfo::EConflictFlag m_ConflictFlags[4];
- static ModInfo::EConflictFlag m_ArchiveLooseConflictFlags[2];
- static ModInfo::EConflictFlag m_ArchiveConflictFlags[3];
+ static constexpr std::array s_ConflictFlags{
+ ModInfo::FLAG_CONFLICT_MIXED,
+ ModInfo::FLAG_CONFLICT_OVERWRITE,
+ ModInfo::FLAG_CONFLICT_OVERWRITTEN,
+ ModInfo::FLAG_CONFLICT_REDUNDANT
+ };
+ static constexpr std::array s_ArchiveLooseConflictFlags{
+ ModInfo::FLAG_ARCHIVE_LOOSE_CONFLICT_OVERWRITE,
+ ModInfo::FLAG_ARCHIVE_LOOSE_CONFLICT_OVERWRITTEN
+ };
+ static constexpr std::array s_ArchiveConflictFlags{
+ ModInfo::FLAG_ARCHIVE_CONFLICT_MIXED,
+ ModInfo::FLAG_ARCHIVE_CONFLICT_OVERWRITE,
+ ModInfo::FLAG_ARCHIVE_CONFLICT_OVERWRITTEN
+ };
int m_LogicalIndex;
int m_CompactSize;