mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-10-22 02:36:15 +03:00
Switch to lightweight function for filtering data
We can use this function since the columns doesn't change. PR #20518.
This commit is contained in:
parent
c06817f4eb
commit
0967bdc715
2 changed files with 9 additions and 9 deletions
|
@ -39,7 +39,7 @@ LogFilterModel::LogFilterModel(const Log::MsgTypes types, QObject *parent)
|
||||||
void LogFilterModel::setMessageTypes(const Log::MsgTypes types)
|
void LogFilterModel::setMessageTypes(const Log::MsgTypes types)
|
||||||
{
|
{
|
||||||
m_types = types;
|
m_types = types;
|
||||||
invalidateFilter();
|
invalidateRowsFilter();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LogFilterModel::filterAcceptsRow(const int sourceRow, const QModelIndex &sourceParent) const
|
bool LogFilterModel::filterAcceptsRow(const int sourceRow, const QModelIndex &sourceParent) const
|
||||||
|
|
|
@ -112,46 +112,46 @@ void TransferListSortModel::sort(const int column, const Qt::SortOrder order)
|
||||||
QSortFilterProxyModel::sort(column, order);
|
QSortFilterProxyModel::sort(column, order);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TransferListSortModel::setStatusFilter(TorrentFilter::Type filter)
|
void TransferListSortModel::setStatusFilter(const TorrentFilter::Type filter)
|
||||||
{
|
{
|
||||||
if (m_filter.setType(filter))
|
if (m_filter.setType(filter))
|
||||||
invalidateFilter();
|
invalidateRowsFilter();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TransferListSortModel::setCategoryFilter(const QString &category)
|
void TransferListSortModel::setCategoryFilter(const QString &category)
|
||||||
{
|
{
|
||||||
if (m_filter.setCategory(category))
|
if (m_filter.setCategory(category))
|
||||||
invalidateFilter();
|
invalidateRowsFilter();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TransferListSortModel::disableCategoryFilter()
|
void TransferListSortModel::disableCategoryFilter()
|
||||||
{
|
{
|
||||||
if (m_filter.setCategory(TorrentFilter::AnyCategory))
|
if (m_filter.setCategory(TorrentFilter::AnyCategory))
|
||||||
invalidateFilter();
|
invalidateRowsFilter();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TransferListSortModel::setTagFilter(const Tag &tag)
|
void TransferListSortModel::setTagFilter(const Tag &tag)
|
||||||
{
|
{
|
||||||
if (m_filter.setTag(tag))
|
if (m_filter.setTag(tag))
|
||||||
invalidateFilter();
|
invalidateRowsFilter();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TransferListSortModel::disableTagFilter()
|
void TransferListSortModel::disableTagFilter()
|
||||||
{
|
{
|
||||||
if (m_filter.setTag(TorrentFilter::AnyTag))
|
if (m_filter.setTag(TorrentFilter::AnyTag))
|
||||||
invalidateFilter();
|
invalidateRowsFilter();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TransferListSortModel::setTrackerFilter(const QSet<BitTorrent::TorrentID> &torrentIDs)
|
void TransferListSortModel::setTrackerFilter(const QSet<BitTorrent::TorrentID> &torrentIDs)
|
||||||
{
|
{
|
||||||
if (m_filter.setTorrentIDSet(torrentIDs))
|
if (m_filter.setTorrentIDSet(torrentIDs))
|
||||||
invalidateFilter();
|
invalidateRowsFilter();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TransferListSortModel::disableTrackerFilter()
|
void TransferListSortModel::disableTrackerFilter()
|
||||||
{
|
{
|
||||||
if (m_filter.setTorrentIDSet(TorrentFilter::AnyID))
|
if (m_filter.setTorrentIDSet(TorrentFilter::AnyID))
|
||||||
invalidateFilter();
|
invalidateRowsFilter();
|
||||||
}
|
}
|
||||||
|
|
||||||
int TransferListSortModel::compare(const QModelIndex &left, const QModelIndex &right) const
|
int TransferListSortModel::compare(const QModelIndex &left, const QModelIndex &right) const
|
||||||
|
|
Loading…
Reference in a new issue