mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-21 12:54:26 -04:00
fixed remaining size issue
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1611 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
758ba49ff1
commit
700fd1d72f
1 changed files with 11 additions and 12 deletions
|
@ -46,7 +46,7 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
|
||||||
QPixmap pixmap;
|
QPixmap pixmap;
|
||||||
qlonglong fileSize;
|
qlonglong fileSize;
|
||||||
double progress, dlspeed, multi;
|
double progress, dlspeed, multi;
|
||||||
int minutes, hours, days;
|
int seconds,minutes, hours, days;
|
||||||
qlonglong remaining;
|
qlonglong remaining;
|
||||||
QString temp , status;
|
QString temp , status;
|
||||||
qlonglong completed;
|
qlonglong completed;
|
||||||
|
@ -100,22 +100,21 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
|
||||||
case REMAINING:
|
case REMAINING:
|
||||||
remaining = index.data().toLongLong();
|
remaining = index.data().toLongLong();
|
||||||
minutes = remaining / 60;
|
minutes = remaining / 60;
|
||||||
|
seconds = remaining % 60;
|
||||||
hours = minutes / 60;
|
hours = minutes / 60;
|
||||||
minutes = minutes - hours * 60;
|
minutes = minutes % 60 ;
|
||||||
days = hours / 24;
|
days = hours / 24;
|
||||||
hours = hours - days * 24;
|
hours = hours % 24 ;
|
||||||
if(days > 0) {
|
if(days > 0) {
|
||||||
temp.clear();
|
temp = QString::number(days)+"d "+QString::number(hours)+"h" ;
|
||||||
temp.sprintf("%dd %2dh %dm", days, hours, minutes);
|
|
||||||
} else if(hours > 0 || days > 0) {
|
} else if(hours > 0 || days > 0) {
|
||||||
temp.clear();
|
temp = QString::number(hours)+"h "+QString::number(minutes)+"m" ;
|
||||||
temp.sprintf("%dh %dm", hours, minutes);
|
|
||||||
} else if(minutes > 0 || hours > 0) {
|
} else if(minutes > 0 || hours > 0) {
|
||||||
temp.clear();
|
temp = QString::number(minutes)+"m"+QString::number(seconds)+"s" ;
|
||||||
temp.sprintf("%dm", minutes);
|
} else if(seconds > 0) {
|
||||||
} else {
|
temp = QString::number(seconds)+"s" ;
|
||||||
|
} else
|
||||||
temp = "Unknown" ;
|
temp = "Unknown" ;
|
||||||
}
|
|
||||||
painter->drawText(option.rect, Qt::AlignCenter, temp);
|
painter->drawText(option.rect, Qt::AlignCenter, temp);
|
||||||
break;
|
break;
|
||||||
case COMPLETED:
|
case COMPLETED:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue