Browse Source

Fix wrong data used for comparison

In torrent transfer list we should use underlying data for sorting, not
displayed values.

Closes #13818.
adaptive-webui-19844
Chocobo1 4 years ago
parent
commit
13c4581c86
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C
  1. 1
      src/gui/torrentcontentfiltermodel.cpp
  2. 1
      src/gui/transferlistsortmodel.cpp

1
src/gui/torrentcontentfiltermodel.cpp

@ -42,6 +42,7 @@ TorrentContentFilterModel::TorrentContentFilterModel(QObject *parent)
setFilterRole(TorrentContentModel::UnderlyingDataRole); setFilterRole(TorrentContentModel::UnderlyingDataRole);
setDynamicSortFilter(true); setDynamicSortFilter(true);
setSortCaseSensitivity(Qt::CaseInsensitive); setSortCaseSensitivity(Qt::CaseInsensitive);
setSortRole(TorrentContentModel::UnderlyingDataRole);
} }
TorrentContentModel *TorrentContentFilterModel::model() const TorrentContentModel *TorrentContentFilterModel::model() const

1
src/gui/transferlistsortmodel.cpp

@ -41,6 +41,7 @@
TransferListSortModel::TransferListSortModel(QObject *parent) TransferListSortModel::TransferListSortModel(QObject *parent)
: QSortFilterProxyModel {parent} : QSortFilterProxyModel {parent}
{ {
setSortRole(TransferListModel::UnderlyingDataRole);
QMetaType::registerComparators<BitTorrent::TorrentState>(); QMetaType::registerComparators<BitTorrent::TorrentState>();
} }

Loading…
Cancel
Save