Fix torrent content checkbox state under certain conditions

Set folder as partially checked when it has at least one
partially checked child and none unchecked.

Closes #22189
This commit is contained in:
thalieht 2025-01-21 19:51:16 +02:00
commit 1f41ceb81e

View file

@ -400,7 +400,9 @@ QVariant TorrentContentModel::data(const QModelIndex &index, const int role) con
const bool hasIgnored = std::any_of(childItems.cbegin(), childItems.cend()
, [](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;