Do not report any progress for disabled files (Closes #56731485)

(cherry picked from commit 4ca665eb0c)
This commit is contained in:
Christophe Dumez 2011-12-28 14:37:59 +02:00
commit b4dc66020c
3 changed files with 26 additions and 18 deletions

View file

@ -2,6 +2,7 @@
- BUGFIX: Fix btdigg plugin (Python3 support + torrent name in magnet links)
- BUGFIX: Fix banning of IPv6 peers (Closes #885021)
- BUGFIX: Fix torrent addition dialog layout problem (Closes #84650522)
- BUGFIX: Do not report any progress for disabled files (Closes #56731485)
- I18N: Add Georgian translation
* Sat Oct 29 2011 - Christophe Dumez <chris@qbittorrent.org> - v2.9.2

View file

@ -74,6 +74,7 @@ public:
QItemDelegate::drawDisplay(painter, opt, option.rect, misc::friendlyUnit(index.data().toLongLong()));
break;
case PROGRESS:{
if (index.data().toDouble() >= 0) {
QStyleOptionProgressBarV2 newopt;
qreal progress = index.data().toDouble()*100.;
newopt.rect = opt.rect;
@ -94,6 +95,10 @@ public:
QPlastiqueStyle st;
st.drawControl(QStyle::CE_ProgressBar, &newopt, painter, 0);
#endif
} else {
// Do not display anything if the file is disabled (progress == -1)
QItemDelegate::drawBackground(painter, opt, index);
}
break;
}
case PRIORITY: {

View file

@ -194,7 +194,7 @@ public:
qreal getProgress() const {
if(getPriority() == 0)
return 0.;
return -1;
qulonglong size = getSize();
if(size > 0)
return total_done/(float)getSize();
@ -313,6 +313,8 @@ public:
}
QVariant data(int column) const {
if(column == COL_PROGRESS)
return getProgress();
return itemData.value(column);
}