- Big code cleanup

- Added a Qwrapper for torrent_handle to make code more readable
This commit is contained in:
Christophe Dumez
2007-08-20 06:29:18 +00:00
parent 5946f20783
commit c9925eddb6
24 changed files with 1560 additions and 1201 deletions

View File

@@ -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;