mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -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
@ -46,7 +46,7 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
|
||||
QPixmap pixmap;
|
||||
qlonglong fileSize;
|
||||
double progress, dlspeed, multi;
|
||||
int minutes, hours, days;
|
||||
int seconds,minutes, hours, days;
|
||||
qlonglong remaining;
|
||||
QString temp , status;
|
||||
qlonglong completed;
|
||||
@ -100,22 +100,21 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
|
||||
case REMAINING:
|
||||
remaining = index.data().toLongLong();
|
||||
minutes = remaining / 60;
|
||||
seconds = remaining % 60;
|
||||
hours = minutes / 60;
|
||||
minutes = minutes - hours * 60;
|
||||
minutes = minutes % 60 ;
|
||||
days = hours / 24;
|
||||
hours = hours - days * 24;
|
||||
hours = hours % 24 ;
|
||||
if(days > 0) {
|
||||
temp.clear();
|
||||
temp.sprintf("%dd %2dh %dm", days, hours, minutes);
|
||||
temp = QString::number(days)+"d "+QString::number(hours)+"h" ;
|
||||
} else if(hours > 0 || days > 0) {
|
||||
temp.clear();
|
||||
temp.sprintf("%dh %dm", hours, minutes);
|
||||
temp = QString::number(hours)+"h "+QString::number(minutes)+"m" ;
|
||||
} else if(minutes > 0 || hours > 0) {
|
||||
temp.clear();
|
||||
temp.sprintf("%dm", minutes);
|
||||
} else {
|
||||
temp = "Unknown";
|
||||
}
|
||||
temp = QString::number(minutes)+"m"+QString::number(seconds)+"s" ;
|
||||
} else if(seconds > 0) {
|
||||
temp = QString::number(seconds)+"s" ;
|
||||
} else
|
||||
temp = "Unknown" ;
|
||||
painter->drawText(option.rect, Qt::AlignCenter, temp);
|
||||
break;
|
||||
case COMPLETED:
|
||||
|
Loading…
Reference in New Issue
Block a user