From 8d408ffc8ba339fea0eab50544715ce3d3a63e82 Mon Sep 17 00:00:00 2001 From: thalieht Date: Fri, 20 May 2022 08:29:22 +0300 Subject: [PATCH] Consistently emit signal when file "ignored" state is changed PR #17042. Closes #17037. --- src/gui/torrentcontentmodel.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/gui/torrentcontentmodel.cpp b/src/gui/torrentcontentmodel.cpp index 610a8fd86..bf99869ed 100644 --- a/src/gui/torrentcontentmodel.cpp +++ b/src/gui/torrentcontentmodel.cpp @@ -313,7 +313,16 @@ bool TorrentContentModel::setData(const QModelIndex &index, const QVariant &valu item->setName(value.toString()); break; case TorrentContentModelItem::COL_PRIO: - item->setPriority(static_cast(value.toInt())); + { + const BitTorrent::DownloadPriority previousPrio = item->priority(); + const auto newPrio = static_cast(value.toInt()); + item->setPriority(newPrio); + if ((newPrio != previousPrio) && ((newPrio == BitTorrent::DownloadPriority::Ignored) + || (previousPrio == BitTorrent::DownloadPriority::Ignored))) + { + emit filteredFilesChanged(); + } + } break; default: return false;