From d8cb9a4e3710b1a09ac2795541c6b792a917e3a1 Mon Sep 17 00:00:00 2001 From: Tannin Date: Tue, 28 May 2013 22:43:19 +0200 Subject: - bugfixes in hookdll related to path-rerouting - bugfix: expanding modlist groups after changes to modlist works now - bugfix: sorting grouped modlist was broken --- src/modlistsortproxy.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'src/modlistsortproxy.cpp') 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); - - lt = leftPrio < rightPrio; - } else { - lt = leftMod->name() < rightMod->name(); - } + QVariant leftPrio = left.data(); + if (!leftPrio.isValid()) leftPrio = left.data(Qt::UserRole); + QVariant rightPrio = right.data(); + if (!rightPrio.isValid()) rightPrio = right.data(Qt::UserRole); + + return leftPrio.toInt() < rightPrio.toInt(); } break; } return lt; -- cgit v1.3.1