diff --git a/src/gui/torrentcontentmodel.cpp b/src/gui/torrentcontentmodel.cpp index d99064eb0..ce3132be3 100644 --- a/src/gui/torrentcontentmodel.cpp +++ b/src/gui/torrentcontentmodel.cpp @@ -284,14 +284,15 @@ bool TorrentContentModel::setData(const QModelIndex &index, const QVariant &valu { auto *item = static_cast(index.internalPointer()); qDebug("setData(%s, %d)", qUtf8Printable(item->name()), value.toInt()); - if (static_cast(item->priority()) != value.toInt()) - { - BitTorrent::DownloadPriority prio = BitTorrent::DownloadPriority::Normal; - if (value.toInt() == Qt::PartiallyChecked) - prio = BitTorrent::DownloadPriority::Mixed; - else if (value.toInt() == Qt::Unchecked) - prio = BitTorrent::DownloadPriority::Ignored; + BitTorrent::DownloadPriority prio = BitTorrent::DownloadPriority::Normal; + if (value.toInt() == Qt::PartiallyChecked) + prio = BitTorrent::DownloadPriority::Mixed; + else if (value.toInt() == Qt::Unchecked) + prio = BitTorrent::DownloadPriority::Ignored; + + if (item->priority() != prio) + { item->setPriority(prio); // Update folders progress in the tree m_rootItem->recalculateProgress();