From acdd08e9a219b69a726315f9285e5f4c681bd22b Mon Sep 17 00:00:00 2001 From: thalieht Date: Wed, 18 May 2022 07:47:48 +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 d1bf952fc..36fe9b281 100644 --- a/src/gui/torrentcontentmodel.cpp +++ b/src/gui/torrentcontentmodel.cpp @@ -311,7 +311,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;