diff --git a/src/gui/torrentcontentitemdelegate.cpp b/src/gui/torrentcontentitemdelegate.cpp index 4341bc18a..679fdaaeb 100644 --- a/src/gui/torrentcontentitemdelegate.cpp +++ b/src/gui/torrentcontentitemdelegate.cpp @@ -34,7 +34,6 @@ #include #include -#include "transferlistmodel.h" #include "base/bittorrent/downloadpriority.h" #include "base/bittorrent/torrent.h" #include "gui/torrentcontentmodel.h" @@ -141,12 +140,11 @@ void TorrentContentItemDelegate::paint(QPainter *painter, const QStyleOptionView const int priority = index.sibling(index.row(), TorrentContentModelItem::COL_PRIO).data(TorrentContentModel::UnderlyingDataRole).toInt(); const bool isEnabled = static_cast(priority) != BitTorrent::DownloadPriority::Ignored; - const QModelIndex statusIndex = index.siblingAtColumn(TransferListModel::TR_STATUS); - const auto torrentState = statusIndex.data(TransferListModel::UnderlyingDataRole).value(); - QStyleOptionViewItem customOption {option}; customOption.state.setFlag(QStyle::State_Enabled, isEnabled); + BitTorrent::TorrentState torrentState = progress >= 100 ? BitTorrent::TorrentState::StalledUploading : BitTorrent::TorrentState::Downloading; + m_progressBarPainter.paint(painter, customOption, index.data().toString(), progress, torrentState); } break;