From 13c4581c869d6074b741e56b3d0e89e0eb99f00a Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Thu, 26 Nov 2020 00:25:42 +0800 Subject: [PATCH] Fix wrong data used for comparison In torrent transfer list we should use underlying data for sorting, not displayed values. Closes #13818. --- src/gui/torrentcontentfiltermodel.cpp | 1 + src/gui/transferlistsortmodel.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/gui/torrentcontentfiltermodel.cpp b/src/gui/torrentcontentfiltermodel.cpp index d774168d2..9659129ca 100644 --- a/src/gui/torrentcontentfiltermodel.cpp +++ b/src/gui/torrentcontentfiltermodel.cpp @@ -42,6 +42,7 @@ TorrentContentFilterModel::TorrentContentFilterModel(QObject *parent) setFilterRole(TorrentContentModel::UnderlyingDataRole); setDynamicSortFilter(true); setSortCaseSensitivity(Qt::CaseInsensitive); + setSortRole(TorrentContentModel::UnderlyingDataRole); } TorrentContentModel *TorrentContentFilterModel::model() const diff --git a/src/gui/transferlistsortmodel.cpp b/src/gui/transferlistsortmodel.cpp index 9c72ce40e..4177eb325 100644 --- a/src/gui/transferlistsortmodel.cpp +++ b/src/gui/transferlistsortmodel.cpp @@ -41,6 +41,7 @@ TransferListSortModel::TransferListSortModel(QObject *parent) : QSortFilterProxyModel {parent} { + setSortRole(TransferListModel::UnderlyingDataRole); QMetaType::registerComparators(); }