Fix torrent content checkbox state under certain conditions

PR #22190.
Closes #22189.
This commit is contained in:
thalieht 2025-01-24 11:11:19 +02:00 committed by Vladimir Golovnev (Glassez)
parent 6a5ea93c92
commit f39e066672
No known key found for this signature in database
GPG key ID: 52A2C7DEE2DFA6F7

View file

@ -398,7 +398,9 @@ QVariant TorrentContentModel::data(const QModelIndex &index, const int role) con
const bool hasIgnored = std::any_of(childItems.cbegin(), childItems.cend() const bool hasIgnored = std::any_of(childItems.cbegin(), childItems.cend()
, [](const TorrentContentModelItem *childItem) , [](const TorrentContentModelItem *childItem)
{ {
return (childItem->priority() == BitTorrent::DownloadPriority::Ignored); const auto prio = childItem->priority();
return ((prio == BitTorrent::DownloadPriority::Ignored)
|| (prio == BitTorrent::DownloadPriority::Mixed));
}); });
return hasIgnored ? Qt::PartiallyChecked : Qt::Checked; return hasIgnored ? Qt::PartiallyChecked : Qt::Checked;