Show torrent error message in transfer list

This commit is contained in:
Chocobo1
2019-11-26 02:40:31 +08:00
parent 2ca70cf6cc
commit b6050463f4
2 changed files with 4 additions and 1 deletions

View File

@@ -100,7 +100,10 @@ void TransferListDelegate::paint(QPainter *painter, const QStyleOptionViewItem &
break;
case TransferListModel::TR_STATUS: {
const auto state = index.data().value<BitTorrent::TorrentState>();
const QString errorMsg = index.data(Qt::UserRole).toString();
QString display = getStatusString(state);
if (state == BitTorrent::TorrentState::Error)
display += (": " + errorMsg);
QItemDelegate::drawDisplay(painter, opt, opt.rect, display);
}
break;