Code clean up

This commit is contained in:
Christophe Dumez 2010-11-14 19:07:24 +00:00
commit d5898f024d
3 changed files with 8 additions and 20 deletions

View file

@ -73,11 +73,10 @@ public:
}
case TorrentModelItem::TR_SEEDS:
case TorrentModelItem::TR_PEERS: {
const qulonglong tot_val = index.data().toULongLong();
QString display = QString::number((qulonglong)tot_val/1000000);
if(tot_val%2 == 0) {
QString display = QString::number(index.data().toLongLong());
if(index.data(Qt::UserRole).toLongLong() > 0) {
// Scrape was successful, we have total values
display += " ("+QString::number((qulonglong)(tot_val%1000000)/10)+")";
display += " ("+QString::number(index.data(Qt::UserRole).toLongLong())+")";
}
QItemDelegate::drawBackground(painter, opt, index);
opt.displayAlignment = Qt::AlignRight;