From 0e7fed0e32cf7cd6ff342493621287e0040e51ad Mon Sep 17 00:00:00 2001 From: Mikaƫl Capelle Date: Wed, 20 Jan 2021 21:01:49 +0100 Subject: Move backup and overwrite priority to ModList. --- src/modinfo.h | 6 ------ src/modlist.cpp | 8 ++++---- src/modlist.h | 9 +++++++-- 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::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::max(); + struct TModInfo { TModInfo(unsigned int index, ModInfo::Ptr modInfo) : modInfo(modInfo), nameOrder(index), priorityOrder(0), modIDOrder(0), categoryOrder(0) {} -- cgit v1.3.1