mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-12 02:55:18 -04:00
* Added Formating for File Size KIB,MIB,GIB and for AGE 1d2h3m
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@818 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
c2e85b3f17
commit
27cfb255eb
4 changed files with 350 additions and 7 deletions
|
@ -8,6 +8,7 @@
|
|||
#include <sstream>
|
||||
#include <math.h>
|
||||
#include <algorithm>
|
||||
#include "util/misc.h"
|
||||
|
||||
/*****
|
||||
* #define RDM_DEBUG
|
||||
|
@ -18,6 +19,8 @@ RemoteDirModel::RemoteDirModel(bool mode, QObject *parent)
|
|||
RemoteMode(mode), nIndex(1), indexSet(1) /* ass zero index cant be used */
|
||||
{
|
||||
setSupportedDragActions(Qt::CopyAction);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -237,8 +240,7 @@ RemoteDirModel::RemoteDirModel(bool mode, QObject *parent)
|
|||
switch(coln)
|
||||
{
|
||||
case 0:
|
||||
QIcon icon(":/images/user/identity16.png");
|
||||
return icon;
|
||||
return(QIcon(":/images/user/identity16.png"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -366,8 +368,9 @@ RemoteDirModel::RemoteDirModel(bool mode, QObject *parent)
|
|||
case 1:
|
||||
{
|
||||
std::ostringstream out;
|
||||
out << details.count;
|
||||
return QString::fromStdString(out.str());
|
||||
//out << details.count;
|
||||
//return QString::fromStdString(out.str());
|
||||
return misc::friendlyUnit(details.count);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
|
@ -380,10 +383,8 @@ RemoteDirModel::RemoteDirModel(bool mode, QObject *parent)
|
|||
case 3:
|
||||
{
|
||||
std::ostringstream out;
|
||||
QDateTime datum = QDateTime::fromTime_t(details.age);
|
||||
QString stime = datum.toString(Qt::LocalDate);
|
||||
//out << details.age;
|
||||
return QString(stime);
|
||||
return misc::userFriendlyDuration(details.age);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
@ -1008,3 +1009,5 @@ QStringList RemoteDirModel::mimeTypes () const
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue