From 0a069709900fe37c265d8645554ae19e25bea06a Mon Sep 17 00:00:00 2001 From: Mikaƫl Capelle Date: Thu, 21 Jan 2021 20:21:57 +0100 Subject: Expose proper priority in ModList and sort in the sort proxy. --- src/modlist.cpp | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) (limited to 'src/modlist.cpp') diff --git a/src/modlist.cpp b/src/modlist.cpp index 5cbc6c9f..6637f48a 100644 --- a/src/modlist.cpp +++ b/src/modlist.cpp @@ -168,20 +168,6 @@ QString ModList::getConflictFlagText(ModInfo::EConflictFlag flag, ModInfo::Ptr m } } -int ModList::modPriority(unsigned int index) const -{ - auto info = ModInfo::getByIndex(index); - if (info->isBackup()) { - return BACKUP_PRIORITY; - } - else if (info->isOverwrite()) { - return OVERWRITE_PRIORITY; - } - else { - return m_Profile->getModPriority(index); - } -} - QVariant ModList::data(const QModelIndex &modelIndex, int role) const { if (m_Profile == nullptr) return QVariant(); @@ -323,9 +309,6 @@ QVariant ModList::data(const QModelIndex &modelIndex, int role) const return QVariant(); } } - else if (column == COL_PRIORITY) { - return modPriority(modIndex); - } else { return modInfo->nexusId(); } @@ -346,7 +329,7 @@ QVariant ModList::data(const QModelIndex &modelIndex, int role) const return modInfo->gameName(); } else if (role == PriorityRole) { - return modPriority(modIndex); + return m_Profile->getModPriority(modIndex); } else if (role == Qt::FontRole) { QFont result; @@ -580,9 +563,6 @@ bool ModList::setData(const QModelIndex &index, const QVariant &value, int role) case COL_PRIORITY: { bool ok = false; int newPriority = value.toInt(&ok); - if (ok && newPriority < 0) { - newPriority = 0; - } if (ok) { changeModPriority(modID, newPriority); result = true; -- cgit v1.3.1