- //qDebug() << "DownloadView::updateItem() " << items_.count(handle);
-
- static float lastProg = 0;
-
- // If there are items currently downloading, update:
- if (items_.count(handle) > 0) {
-
- DownloadViewItem *item = items_[handle];
-
- // Only the changing fields are being updated:
- item->setData(2, Qt::DisplayRole,
- QVariant(GetStatusString(handle.state())));
- item->setData(4, Qt::DisplayRole,
- QVariant(QString::number(handle.downloadRate(), 'f', 2)));
- item->setData(5, Qt::DisplayRole,
- QVariant(QString::number(handle.uploadRate(), 'f', 2)));
- item->setData(6, Qt::DisplayRole,
- QString::number(handle.numSeeds()) + "/"
- + QString::number(handle.numLeeches()));
-
- // Set progress if increment is 1 percent.
- float prog = handle.progress();
- if ((prog-lastProg) >= 0.01 || prog >= 1.0) {
- item->setData(3, Qt::DisplayRole,
- QVariant(QString::number(100*prog) + '%'));
- lastProg = prog;
- }
-
- /// @TODO: ETA-counter adjusting,if ETA is to be implemented
-
- // Adjust color
- QBrush brushTmp(GetStatusColor(handle.state()));
- item->setForeground(2, brushTmp);
- }
+ //qDebug() << "DownloadView::updateItem() " << items_.count(handle);
+
+ static float lastProg = 0;
+
+ // If there are items currently downloading, update:
+ if (items_.count(handle) > 0)
+ {
+
+ DownloadViewItem *item = items_[handle];
+
+ // Only the changing fields are being updated:
+ item->setData(2, Qt::DisplayRole,
+ QVariant(GetStatusString(handle.state())));
+ item->setData(4, Qt::DisplayRole,
+ QVariant(QString::number(handle.downloadRate(), 'f', 2)));
+ item->setData(5, Qt::DisplayRole,
+ QVariant(QString::number(handle.uploadRate(), 'f', 2)));
+ item->setData(6, Qt::DisplayRole,
+ QString::number(handle.numSeeds()) + "/"
+ + QString::number(handle.numLeeches()));
+
+ // Set progress if increment is 1 percent.
+ float prog = handle.progress();
+ if ((prog-lastProg) >= 0.01 || prog >= 1.0)
+ {
+ item->setData(3, Qt::DisplayRole,
+ QVariant(QString::number(100*prog) + '%'));
+ lastProg = prog;
+ }
+
+ /// @TODO: ETA-counter adjusting,if ETA is to be implemented
+
+ // Adjust color
+ QBrush brushTmp(GetStatusColor(handle.state()));
+ item->setForeground(2, brushTmp);
+ }