diff options
| author | Mikaël Capelle <capelle.mikael@gmail.com> | 2021-01-21 20:21:57 +0100 |
|---|---|---|
| committer | Mikaël Capelle <capelle.mikael@gmail.com> | 2021-01-21 20:21:57 +0100 |
| commit | 0a069709900fe37c265d8645554ae19e25bea06a (patch) | |
| tree | 3ba5f5f436ce21f50f7626d4f0b889b419dca38b /src/modlist.cpp | |
| parent | 60085ae4b662cfd5a3f3d4da78994a275904af96 (diff) | |
Expose proper priority in ModList and sort in the sort proxy.
Diffstat (limited to 'src/modlist.cpp')
| -rw-r--r-- | src/modlist.cpp | 22 |
1 files changed, 1 insertions, 21 deletions
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; |
