diff options
| author | Tannin <devnull@localhost> | 2013-06-05 10:05:29 +0200 |
|---|---|---|
| committer | Tannin <devnull@localhost> | 2013-06-05 10:05:29 +0200 |
| commit | 97111de1409a59eea9e7ab5050ab70f4d01ddb8e (patch) | |
| tree | 6d3ed6dd899573d23bef15adb2519173cd844b76 /src/modlistsortproxy.cpp | |
| parent | 280691ebc36d34c803a5bd8e01616680b0d2fafb (diff) | |
| parent | 1606c1366f5d0ba304334b0e57680fb99feb88b9 (diff) | |
Merge
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; |
