From 1f41ceb81e629f1452a38079eaeec542a991538d Mon Sep 17 00:00:00 2001 From: thalieht Date: Tue, 21 Jan 2025 19:51:16 +0200 Subject: [PATCH] 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 --- src/gui/torrentcontentmodel.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/torrentcontentmodel.cpp b/src/gui/torrentcontentmodel.cpp index 474fbd573639..e75fc1856e3d 100644 --- a/src/gui/torrentcontentmodel.cpp +++ b/src/gui/torrentcontentmodel.cpp @@ -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;