Skip to content

Commit

Permalink
Fix torrent content checkbox state under certain conditions
Browse files Browse the repository at this point in the history
Set folder as partially checked when it has at least one
partially checked child and none unchecked.

Closes #22189
  • Loading branch information
thalieht committed Jan 21, 2025
1 parent f8c4834 commit 1f41ceb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/gui/torrentcontentmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1f41ceb

Please sign in to comment.