Browse Source

Consistently emit signal when file "ignored" state is changed

PR #17042.
Closes #17037.
adaptive-webui-19844
thalieht 3 years ago committed by GitHub
parent
commit
acdd08e9a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      src/gui/torrentcontentmodel.cpp

11
src/gui/torrentcontentmodel.cpp

@ -311,7 +311,16 @@ bool TorrentContentModel::setData(const QModelIndex &index, const QVariant &valu
item->setName(value.toString()); item->setName(value.toString());
break; break;
case TorrentContentModelItem::COL_PRIO: case TorrentContentModelItem::COL_PRIO:
item->setPriority(static_cast<BitTorrent::DownloadPriority>(value.toInt())); {
const BitTorrent::DownloadPriority previousPrio = item->priority();
const auto newPrio = static_cast<BitTorrent::DownloadPriority>(value.toInt());
item->setPriority(newPrio);
if ((newPrio != previousPrio) && ((newPrio == BitTorrent::DownloadPriority::Ignored)
|| (previousPrio == BitTorrent::DownloadPriority::Ignored)))
{
emit filteredFilesChanged();
}
}
break; break;
default: default:
return false; return false;

Loading…
Cancel
Save