mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-11 15:56:17 -07:00
Show torrent error message in transfer list
This commit is contained in:
parent
2ca70cf6cc
commit
b6050463f4
2 changed files with 4 additions and 1 deletions
|
@ -100,7 +100,10 @@ void TransferListDelegate::paint(QPainter *painter, const QStyleOptionViewItem &
|
||||||
break;
|
break;
|
||||||
case TransferListModel::TR_STATUS: {
|
case TransferListModel::TR_STATUS: {
|
||||||
const auto state = index.data().value<BitTorrent::TorrentState>();
|
const auto state = index.data().value<BitTorrent::TorrentState>();
|
||||||
|
const QString errorMsg = index.data(Qt::UserRole).toString();
|
||||||
QString display = getStatusString(state);
|
QString display = getStatusString(state);
|
||||||
|
if (state == BitTorrent::TorrentState::Error)
|
||||||
|
display += (": " + errorMsg);
|
||||||
QItemDelegate::drawDisplay(painter, opt, opt.rect, display);
|
QItemDelegate::drawDisplay(painter, opt, opt.rect, display);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -184,7 +184,7 @@ QVariant TransferListModel::data(const QModelIndex &index, const int role) const
|
||||||
case TR_PROGRESS:
|
case TR_PROGRESS:
|
||||||
return torrent->progress();
|
return torrent->progress();
|
||||||
case TR_STATUS:
|
case TR_STATUS:
|
||||||
return QVariant::fromValue(torrent->state());
|
return (role == Qt::DisplayRole) ? QVariant::fromValue(torrent->state()) : torrent->error();
|
||||||
case TR_SEEDS:
|
case TR_SEEDS:
|
||||||
return (role == Qt::DisplayRole) ? torrent->seedsCount() : torrent->totalSeedsCount();
|
return (role == Qt::DisplayRole) ? torrent->seedsCount() : torrent->totalSeedsCount();
|
||||||
case TR_PEERS:
|
case TR_PEERS:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue