diff --git a/retroshare-gui/src/gui/RemoteDirModel.cpp b/retroshare-gui/src/gui/RemoteDirModel.cpp index 2bcc8cd4e..9c010e904 100644 --- a/retroshare-gui/src/gui/RemoteDirModel.cpp +++ b/retroshare-gui/src/gui/RemoteDirModel.cpp @@ -391,34 +391,46 @@ QVariant TreeStyle_RDM::displayRole(const DirDetails& details,int coln) const switch(coln) { case 0: { - SharedDirStats stats ; - QString res ; + SharedDirStats stats ; + QString res ; - if(RemoteMode) - { - res = QString::fromUtf8(rsPeers->getPeerName(details.id).c_str()); - rsFiles->getSharedDirStatistics(details.id,stats) ; + if(RemoteMode) + { + res = QString::fromUtf8(rsPeers->getPeerName(details.id).c_str()); + } + else + { + res = tr("My files"); + } + return res ; } - else - { - res = tr("My files"); - rsFiles->getSharedDirStatistics(rsPeers->getOwnId(),stats) ; - } + case 1: { + SharedDirStats stats ; + QString res ; - if(stats.total_number_of_files > 0) - res += " - " + QString::number(stats.total_number_of_files) + " files, " + misc::friendlyUnit(stats.total_shared_size) ; + if(RemoteMode) + { + //res = QString::fromUtf8(rsPeers->getPeerName(details.id).c_str()); + rsFiles->getSharedDirStatistics(details.id,stats) ; + } + else + { + //res = tr("My files"); + rsFiles->getSharedDirStatistics(rsPeers->getOwnId(),stats) ; + } - return res ; - } + if(stats.total_number_of_files > 0) + res += QString::number(stats.total_number_of_files) + " files, " + misc::friendlyUnit(stats.total_shared_size) ; - case 1: - return QString() ; - case 2: if(!isNewerThanEpoque(details.max_mtime)) - return QString(); - else - return misc::timeRelativeToNow(details.max_mtime); + return res ; + } + case 2: if(!isNewerThanEpoque(details.max_mtime)) + return QString(); - default: + else + return misc::timeRelativeToNow(details.max_mtime); + + default: return QString() ; } } diff --git a/retroshare-gui/src/util/misc.cpp b/retroshare-gui/src/util/misc.cpp index 92cd43489..886d200a6 100644 --- a/retroshare-gui/src/util/misc.cpp +++ b/retroshare-gui/src/util/misc.cpp @@ -37,7 +37,7 @@ QString misc::friendlyUnit(float val) if(val < 0) { return tr("Unknown", "Unknown (size)"); } - const QString units[5] = {tr(" B", "bytes"), tr(" KB", "kilobytes (1024 bytes)"), tr(" MB", "megabytes (1024 kilobytes)"), tr(" GB", "gigabytes (1024 megabytes)"), tr(" TB,", "terabytes (1024 gigabytes)") }; + const QString units[5] = {tr(" B", "bytes"), tr(" KB", "kilobytes (1024 bytes)"), tr(" MB", "megabytes (1024 kilobytes)"), tr(" GB", "gigabytes (1024 megabytes)"), tr(" TB", "terabytes (1024 gigabytes)") }; for(unsigned int i=0; i<5; ++i) { if (val < 1024.) { return QString(QByteArray::number(val, 'f', 1)) + units[i];