mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-01-01 05:08:05 -06:00
Performance improvement on ARM
This commit is contained in:
@@ -57,14 +57,14 @@ public:
|
||||
case DOWN_SPEED:
|
||||
case UP_SPEED:{
|
||||
QItemDelegate::drawBackground(painter, opt, index);
|
||||
double speed = index.data().toDouble();
|
||||
qreal speed = index.data().toDouble();
|
||||
if (speed > 0.0)
|
||||
QItemDelegate::drawDisplay(painter, opt, opt.rect, misc::friendlyUnit(speed)+tr("/s", "/second (i.e. per second)"));
|
||||
break;
|
||||
}
|
||||
case PROGRESS:{
|
||||
QItemDelegate::drawBackground(painter, opt, index);
|
||||
double progress = index.data().toDouble();
|
||||
qreal progress = index.data().toDouble();
|
||||
QItemDelegate::drawDisplay(painter, opt, opt.rect, QString::number(progress*100., 'f', 1)+"%");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ public:
|
||||
}
|
||||
|
||||
void setAvailability(const std::vector<int>& avail) {
|
||||
double average = 0;
|
||||
qreal average = 0;
|
||||
if(avail.empty()) {
|
||||
// Empty bar
|
||||
QPixmap pix = QPixmap(1, 1);
|
||||
@@ -114,10 +114,10 @@ protected:
|
||||
painter.drawPixmap(rect(), pixmap);
|
||||
}
|
||||
|
||||
QColor getPieceColor(int avail, double average) {
|
||||
QColor getPieceColor(int avail, qreal average) {
|
||||
if(!avail) return Qt::white;
|
||||
//qDebug("avail: %d/%d", avail, max_avail);
|
||||
double fraction = 100.*average/avail;
|
||||
qreal fraction = 100.*average/avail;
|
||||
if(fraction < 100)
|
||||
fraction *= 0.8;
|
||||
else
|
||||
|
||||
@@ -348,7 +348,7 @@ void PropertiesWidget::loadDynamicData() {
|
||||
// Update next announce time
|
||||
reannounce_lbl->setText(h.next_announce());
|
||||
// Update ratio info
|
||||
const double ratio = QBtSession::instance()->getRealRatio(h.hash());
|
||||
const qreal ratio = QBtSession::instance()->getRealRatio(h.hash());
|
||||
if(ratio > 100.)
|
||||
shareRatio->setText(QString::fromUtf8("∞"));
|
||||
else
|
||||
@@ -370,7 +370,7 @@ void PropertiesWidget::loadDynamicData() {
|
||||
showPiecesAvailability(false);
|
||||
}
|
||||
// Progress
|
||||
float progress = h.progress()*100.;
|
||||
qreal progress = h.progress()*100.;
|
||||
if(progress > 99.94 && progress < 100.)
|
||||
progress = 99.9;
|
||||
progress_lbl->setText(QString::number(progress, 'f', 1)+"%");
|
||||
|
||||
Reference in New Issue
Block a user