mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-01-18 18:35:14 +08:00
don't make the same request to TorrentModelItem twice
This commit is contained in:
parent
1c98c11dd0
commit
5af778bc93
@ -78,9 +78,10 @@ public:
|
||||
case TorrentModelItem::TR_SEEDS:
|
||||
case TorrentModelItem::TR_PEERS: {
|
||||
QString display = QString::number(index.data().toLongLong());
|
||||
if (index.data(Qt::UserRole).toLongLong() > 0) {
|
||||
qlonglong total = index.data(Qt::UserRole).toLongLong();
|
||||
if (total > 0) {
|
||||
// Scrape was successful, we have total values
|
||||
display += " ("+QString::number(index.data(Qt::UserRole).toLongLong())+")";
|
||||
display += " ("+QString::number(total)+")";
|
||||
}
|
||||
QItemDelegate::drawBackground(painter, opt, index);
|
||||
QItemDelegate::drawDisplay(painter, opt, opt.rect, display);
|
||||
|
Loading…
Reference in New Issue
Block a user