mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-13 18:17:08 -07:00
- Big code cleanup
- Added a Qwrapper for torrent_handle to make code more readable
This commit is contained in:
parent
5946f20783
commit
c9925eddb6
24 changed files with 1560 additions and 1201 deletions
|
@ -67,14 +67,14 @@ class DLListDelegate: 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 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 PROGRESS:{
|
||||
|
@ -83,7 +83,7 @@ class DLListDelegate: 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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue