diff options
| author | Tannin <devnull@localhost> | 2013-05-28 22:43:19 +0200 |
|---|---|---|
| committer | Tannin <devnull@localhost> | 2013-05-28 22:43:19 +0200 |
| commit | d8cb9a4e3710b1a09ac2795541c6b792a917e3a1 (patch) | |
| tree | 1e69347e9659bf3408b794976791048b2b05d181 /src/modlistsortproxy.cpp | |
| parent | 3c21d1884a499066785e70dc44a869cb8b2d589d (diff) | |
- bugfixes in hookdll related to path-rerouting
- bugfix: expanding modlist groups after changes to modlist works now
- bugfix: sorting grouped modlist was broken
Diffstat (limited to 'src/modlistsortproxy.cpp')
| -rw-r--r-- | src/modlistsortproxy.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/modlistsortproxy.cpp b/src/modlistsortproxy.cpp index 17dca5fc..ede83659 100644 --- a/src/modlistsortproxy.cpp +++ b/src/modlistsortproxy.cpp @@ -157,16 +157,12 @@ bool ModListSortProxy::lessThan(const QModelIndex &left, case ModList::COL_MODID: lt = leftMod->getNexusID() < rightMod->getNexusID(); break; case ModList::COL_VERSION: lt = leftMod->getVersion() < rightMod->getVersion(); break; case ModList::COL_PRIORITY: { - if (m_Profile != NULL) { - int leftPrio = leftMod->getFixedPriority(); - int rightPrio = rightMod->getFixedPriority(); - if (leftPrio == INT_MIN) leftPrio = m_Profile->getModPriority(leftIndex); - if (rightPrio == INT_MIN) rightPrio = m_Profile->getModPriority(rightIndex); + QVariant leftPrio = left.data(); + if (!leftPrio.isValid()) leftPrio = left.data(Qt::UserRole); + QVariant rightPrio = right.data(); + if (!rightPrio.isValid()) rightPrio = right.data(Qt::UserRole); - lt = leftPrio < rightPrio; - } else { - lt = leftMod->name() < rightMod->name(); - } + return leftPrio.toInt() < rightPrio.toInt(); } break; } return lt; |
