mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-29 13:58:51 +03:00
don't make the same request to TorrentModelItem twice
This commit is contained in:
parent
1c98c11dd0
commit
5af778bc93
1 changed files with 3 additions and 2 deletions
|
@ -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 a new issue