Added proper sorting of DL files according to sources (Patch from Phenom)

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6805 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2013-10-06 12:09:36 +00:00
parent f3f7a40ad7
commit 7cd9ca9f09
2 changed files with 16 additions and 3 deletions

View file

@ -27,6 +27,7 @@
#include <QApplication>
#include <QDateTime>
#include <limits>
#include <math.h>
#include "DLListDelegate.h"
@ -186,6 +187,14 @@ void DLListDelegate::paint(QPainter * painter, const QStyleOptionViewItem & opti
}
painter->drawText(option.rect, Qt::AlignCenter, newopt.text);
break;
case COLUMN_SOURCES:
{
double dblValue = index.data().toDouble();
temp = dblValue!=0 ? QString("%1 (%2)").arg((int)dblValue).arg((int)((fmod(dblValue,1)*1000)+0.5)) : "";
painter->drawText(option.rect, Qt::AlignCenter, temp);
}
break;
case COLUMN_DOWNLOADTIME:
downloadtime = index.data().toLongLong();
minutes = downloadtime / 60;