COSMETIC: Display speeds with more user friendly units instead of always using KiB/s

This commit is contained in:
Christophe Dumez 2009-11-23 07:34:14 +00:00
parent c52e0cf841
commit 8b41d1973c
5 changed files with 9 additions and 8 deletions

View file

@ -112,9 +112,9 @@ public:
case TR_UPSPEED:
case TR_DLSPEED:{
QItemDelegate::drawBackground(painter, opt, index);
double speed = index.data().toDouble();
qulonglong speed = index.data().toULongLong();
opt.displayAlignment = Qt::AlignRight;
QItemDelegate::drawDisplay(painter, opt, opt.rect, QString::number(speed/1024., 'f', 1)+" "+tr("KiB/s"));
QItemDelegate::drawDisplay(painter, opt, opt.rect, misc::friendlyUnit(speed)+tr("/s", "/second (.i.e per second)"));
break;
}
case TR_RATIO:{