fixed various display bugs in extra file list

This commit is contained in:
csoler 2018-09-27 22:14:00 +02:00
parent 54ec49dc03
commit 752275f813
No known key found for this signature in database
GPG Key ID: 7BCA522266C0804C
3 changed files with 13 additions and 8 deletions

View File

@ -1019,8 +1019,8 @@ void p3FileDatabase::getExtraFilesDirDetails(void *ref,DirectoryStorage::EntryIn
d.hash = f.hash;
d.count = f.size;
d.max_mtime = time(NULL);
d.mtime = time(NULL);
d.max_mtime = 0; // this is irrelevant
d.mtime = 0; // this is irrelevant
d.name = f.path; // so that the UI shows the complete path, since the parent directory is not really a directory.
d.path = f.path;
d.ref = ref ;

View File

@ -113,8 +113,7 @@ void ftExtraList::hashAFile()
/* hash it! */
std::string name, hash;
//uint64_t size;
if (RsDirUtil::hashFile(details.info.path, details.info.fname,
details.info.hash, details.info.size))
if (RsDirUtil::hashFile(details.info.path, details.info.fname, details.info.hash, details.info.size))
{
RS_STACK_MUTEX(extMutex);

View File

@ -470,8 +470,10 @@ QVariant TreeStyle_RDM::displayRole(const DirDetails& details,int coln) const
if(RemoteMode)
rsFiles->getSharedDirStatistics(details.id,stats) ;
else
else if(details.id == rsPeers->getOwnId())
rsFiles->getSharedDirStatistics(rsPeers->getOwnId(),stats) ;
else
stats.total_number_of_files = details.count;
if(stats.total_number_of_files > 0)
{
@ -487,8 +489,10 @@ QVariant TreeStyle_RDM::displayRole(const DirDetails& details,int coln) const
if(RemoteMode)
rsFiles->getSharedDirStatistics(details.id,stats) ;
else
else if(details.id == rsPeers->getOwnId())
rsFiles->getSharedDirStatistics(rsPeers->getOwnId(),stats) ;
else
return QString();
if(stats.total_shared_size > 0)
return misc::friendlyUnit(stats.total_shared_size) ;
@ -498,6 +502,8 @@ QVariant TreeStyle_RDM::displayRole(const DirDetails& details,int coln) const
case COLUMN_AGE:
if(!isNewerThanEpoque(details.max_mtime))
return QString();
else if(details.id != rsPeers->getOwnId())
return QString();
else
return misc::timeRelativeToNow(details.max_mtime);
@ -516,7 +522,7 @@ QVariant TreeStyle_RDM::displayRole(const DirDetails& details,int coln) const
case COLUMN_SIZE:
return misc::friendlyUnit(details.count);
case COLUMN_AGE:
return misc::timeRelativeToNow(details.max_mtime);
return (details.type == DIR_TYPE_FILE)?(misc::timeRelativeToNow(details.max_mtime)):QString();
case COLUMN_FRIEND_ACCESS:
return QVariant();
case COLUMN_WN_VISU_DIR:
@ -795,7 +801,7 @@ QVariant RetroshareDirModel::data(const QModelIndex &index, int role) const
return decorationRole(details,coln) ;
if(role == Qt::ToolTipRole)
if(!isNewerThanEpoque(details.max_mtime))
if(!isNewerThanEpoque(details.max_mtime) && details.type == DIR_TYPE_PERSON)
return tr("This node hasn't sent any directory information yet.") ;
/*****************