mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-20 07:27:22 -06:00
- Big code cleanup
- Added a Qwrapper for torrent_handle to make code more readable
This commit is contained in:
@@ -60,14 +60,14 @@ class FinishedListDelegate: public QItemDelegate {
|
||||
QItemDelegate::drawBackground(painter, opt, index);
|
||||
float speed = index.data().toDouble();
|
||||
snprintf(tmp, MAX_CHAR_TMP, "%.1f", speed/1024.);
|
||||
QItemDelegate::drawDisplay(painter, opt, opt.rect, QString(tmp)+" "+tr("KiB/s"));
|
||||
QItemDelegate::drawDisplay(painter, opt, opt.rect, QString::fromUtf8(tmp)+QString::fromUtf8(" ")+tr("KiB/s"));
|
||||
break;
|
||||
}
|
||||
case F_RATIO:{
|
||||
QItemDelegate::drawBackground(painter, opt, index);
|
||||
float ratio = index.data().toDouble();
|
||||
snprintf(tmp, MAX_CHAR_TMP, "%.1f", ratio);
|
||||
QItemDelegate::drawDisplay(painter, opt, opt.rect, QString(tmp));
|
||||
QItemDelegate::drawDisplay(painter, opt, opt.rect, QString::fromUtf8(tmp));
|
||||
break;
|
||||
}
|
||||
case F_PROGRESS:{
|
||||
@@ -76,7 +76,7 @@ class FinishedListDelegate: public QItemDelegate {
|
||||
progress = index.data().toDouble()*100.;
|
||||
snprintf(tmp, MAX_CHAR_TMP, "%.1f", progress);
|
||||
newopt.rect = opt.rect;
|
||||
newopt.text = QString(tmp)+"%";
|
||||
newopt.text = QString::fromUtf8(tmp)+QString::fromUtf8("%");
|
||||
newopt.progress = (int)progress;
|
||||
newopt.maximum = 100;
|
||||
newopt.minimum = 0;
|
||||
|
||||
Reference in New Issue
Block a user