From 18f70a2dff138f273a9b6babaec226775a03649f Mon Sep 17 00:00:00 2001 From: Mikaƫl Capelle Date: Mon, 11 Jan 2021 21:07:25 +0100 Subject: Add documentation for row computation. --- src/modlistsortproxy.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/modlistsortproxy.cpp') diff --git a/src/modlistsortproxy.cpp b/src/modlistsortproxy.cpp index 1077a833..18e91e6e 100644 --- a/src/modlistsortproxy.cpp +++ b/src/modlistsortproxy.cpp @@ -622,9 +622,7 @@ bool ModListSortProxy::canDropMimeData(const QMimeData* data, Qt::DropAction act } } - // in the regular model, when dropping between rows, the row-value passed to - // the sourceModel is inconsistent between ascending and descending ordering. - // This should fix that + // see dropMimeData for details if (sortOrder() == Qt::DescendingOrder && row != -1 && !sourceIsByPriorityProxy()) { --row; } @@ -648,8 +646,11 @@ bool ModListSortProxy::dropMimeData(const QMimeData *data, Qt::DropAction action } // in the regular model, when dropping between rows, the row-value passed to - // the sourceModel is inconsistent between ascending and descending ordering. - // This should fix that + // the sourceModel is inconsistent between ascending and descending ordering + // + // we want to fix that, but we cannot do it for the by-priority proxy because + // it messes up with non top-level items, so we simply forward the row and the + // by-priority proxy will fix the row for us if (sortOrder() == Qt::DescendingOrder && row != -1 && !sourceIsByPriorityProxy()) { --row; } -- cgit v1.3.1