summaryrefslogtreecommitdiff
path: root/src/modlistsortproxy.cpp
diff options
context:
space:
mode:
authorTannin <devnull@localhost>2013-06-05 10:05:29 +0200
committerTannin <devnull@localhost>2013-06-05 10:05:29 +0200
commit97111de1409a59eea9e7ab5050ab70f4d01ddb8e (patch)
tree6d3ed6dd899573d23bef15adb2519173cd844b76 /src/modlistsortproxy.cpp
parent280691ebc36d34c803a5bd8e01616680b0d2fafb (diff)
parent1606c1366f5d0ba304334b0e57680fb99feb88b9 (diff)
Merge
Diffstat (limited to 'src/modlistsortproxy.cpp')
-rw-r--r--src/modlistsortproxy.cpp14
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;