summaryrefslogtreecommitdiff
path: root/src/modlistsortproxy.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modlistsortproxy.cpp')
-rw-r--r--src/modlistsortproxy.cpp13
1 files changed, 1 insertions, 12 deletions
diff --git a/src/modlistsortproxy.cpp b/src/modlistsortproxy.cpp
index 455daa76..054b980c 100644
--- a/src/modlistsortproxy.cpp
+++ b/src/modlistsortproxy.cpp
@@ -120,18 +120,7 @@ bool ModListSortProxy::lessThan(const QModelIndex &left,
ModInfo::Ptr leftMod = ModInfo::getByIndex(leftIndex);
ModInfo::Ptr rightMod = ModInfo::getByIndex(rightIndex);
- bool lt = false;
-
- {
- QModelIndex leftPrioIdx = left.sibling(left.row(), ModList::COL_PRIORITY);
- QVariant leftPrio = leftPrioIdx.data();
- if (!leftPrio.isValid()) leftPrio = left.data(Qt::UserRole);
- QModelIndex rightPrioIdx = right.sibling(right.row(), ModList::COL_PRIORITY);
- QVariant rightPrio = rightPrioIdx.data();
- if (!rightPrio.isValid()) rightPrio = right.data(Qt::UserRole);
-
- lt = leftPrio.toInt() < rightPrio.toInt();
- }
+ bool lt = left.data(ModList::PriorityRole).toInt() < right.data(ModList::PriorityRole).toInt();
switch (left.column()) {
case ModList::COL_FLAGS: {