mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-18 22:47:21 -06:00
Prevent invalid status filter index from being used
PR #20714. Closes #20701.
This commit is contained in:
committed by
GitHub
parent
d7cded54e4
commit
ace5286402
@@ -1353,9 +1353,10 @@ void TransferListWidget::applyFilter(const QString &name, const TransferListMode
|
||||
m_sortFilterModel->setFilterRegularExpression(QRegularExpression(pattern, QRegularExpression::CaseInsensitiveOption));
|
||||
}
|
||||
|
||||
void TransferListWidget::applyStatusFilter(int f)
|
||||
void TransferListWidget::applyStatusFilter(const int filterIndex)
|
||||
{
|
||||
m_sortFilterModel->setStatusFilter(static_cast<TorrentFilter::Type>(f));
|
||||
const auto filterType = static_cast<TorrentFilter::Type>(filterIndex);
|
||||
m_sortFilterModel->setStatusFilter(((filterType >= TorrentFilter::All) && (filterType < TorrentFilter::_Count)) ? filterType : TorrentFilter::All);
|
||||
// Select first item if nothing is selected
|
||||
if (selectionModel()->selectedRows(0).empty() && (m_sortFilterModel->rowCount() > 0))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user