1
mirror of https://github.com/qbittorrent/qBittorrent synced 2024-10-17 13:01:11 +02:00

Consistently emit signal when file "ignored" state is changed

PR #17042.
Closes #17037.
This commit is contained in:
thalieht 2022-05-18 07:47:48 +03:00 committed by GitHub
parent dbfd6a2368
commit acdd08e9a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -311,7 +311,16 @@ bool TorrentContentModel::setData(const QModelIndex &index, const QVariant &valu
item->setName(value.toString());
break;
case TorrentContentModelItem::COL_PRIO:
item->setPriority(static_cast<BitTorrent::DownloadPriority>(value.toInt()));
{
const BitTorrent::DownloadPriority previousPrio = item->priority();
const auto newPrio = static_cast<BitTorrent::DownloadPriority>(value.toInt());
item->setPriority(newPrio);
if ((newPrio != previousPrio) && ((newPrio == BitTorrent::DownloadPriority::Ignored)
|| (previousPrio == BitTorrent::DownloadPriority::Ignored)))
{
emit filteredFilesChanged();
}
}
break;
default:
return false;