summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikaël Capelle <capelle.mikael@gmail.com>2021-01-20 21:01:49 +0100
committerMikaël Capelle <capelle.mikael@gmail.com>2021-01-20 21:01:49 +0100
commit0e7fed0e32cf7cd6ff342493621287e0040e51ad (patch)
tree891ddb263815453233577517522230df1f1ab23f
parent946d7fc192d47b542e048d9ec72e65ad982eb09c (diff)
Move backup and overwrite priority to ModList.
-rw-r--r--src/modinfo.h6
-rw-r--r--src/modlist.cpp8
-rw-r--r--src/modlist.h9
3 files changed, 11 insertions, 12 deletions
diff --git a/src/modinfo.h b/src/modinfo.h
index 621a0443..0fbcd1c0 100644
--- a/src/modinfo.h
+++ b/src/modinfo.h
@@ -103,12 +103,6 @@ public: // Type definitions:
MOD_CC
};
- // the priority of backups and overwrite from a mod list point of
- // view, these do not correspond to the actual priority in the profile
- //
- static constexpr int BACKUP_PRIORITY = -1;
- static constexpr int OVERWRITE_PRIORITY = std::numeric_limits<int>::max();
-
public: // Static functions:
diff --git a/src/modlist.cpp b/src/modlist.cpp
index 4518f2e9..073dbfd3 100644
--- a/src/modlist.cpp
+++ b/src/modlist.cpp
@@ -337,10 +337,10 @@ QVariant ModList::data(const QModelIndex &modelIndex, int role) const
}
else if (column == COL_PRIORITY) {
if (modInfo->isBackup()) {
- return ModInfo::BACKUP_PRIORITY;
+ return BACKUP_PRIORITY;
}
else if (modInfo->isOverwrite()) {
- return ModInfo::OVERWRITE_PRIORITY;
+ return OVERWRITE_PRIORITY;
}
else {
return m_Profile->getModPriority(modIndex);
@@ -367,10 +367,10 @@ QVariant ModList::data(const QModelIndex &modelIndex, int role) const
}
else if (role == PriorityRole) {
if (modInfo->isBackup()) {
- return ModInfo::BACKUP_PRIORITY;
+ return BACKUP_PRIORITY;
}
else if (modInfo->isOverwrite()) {
- return ModInfo::OVERWRITE_PRIORITY;
+ return OVERWRITE_PRIORITY;
}
else {
return m_Profile->getModPriority(modIndex);
diff --git a/src/modlist.h b/src/modlist.h
index 5c7f28ee..8d0a2384 100644
--- a/src/modlist.h
+++ b/src/modlist.h
@@ -366,10 +366,15 @@ private:
//
int dropPriority(int row, const QModelIndex& parent) const;
-private slots:
-
private:
+ // the priority of backups and overwrite for sorting (and display, although
+ // those are not displayed), these do not correspond to the actual priority
+ // in the mod list
+ //
+ static constexpr int BACKUP_PRIORITY = -1;
+ static constexpr int OVERWRITE_PRIORITY = std::numeric_limits<int>::max();
+
struct TModInfo {
TModInfo(unsigned int index, ModInfo::Ptr modInfo)
: modInfo(modInfo), nameOrder(index), priorityOrder(0), modIDOrder(0), categoryOrder(0) {}