added list of files for the whole channel

This commit is contained in:
csoler 2020-06-07 14:50:31 +02:00
parent 591ffc2fa7
commit 944c5b3592
No known key found for this signature in database
GPG key ID: 7BCA522266C0804C
7 changed files with 67 additions and 34 deletions
retroshare-gui/src/gui/gxschannels

View file

@ -71,6 +71,22 @@ void RsGxsChannelPostsModel::postMods()
emit dataChanged(createIndex(0,0,(void*)NULL), createIndex(mPosts.size(),mColumns-1,(void*)NULL));
}
void RsGxsChannelPostsModel::getFilesList(std::list<RsGxsFile>& files)
{
// We use an intermediate map so as to remove duplicates
std::map<RsFileHash,RsGxsFile> files_map;
for(uint32_t i=1;i<mPosts.size();++i)
for(auto& file:mPosts[i].mFiles)
files_map[file.mHash] = file;
files.clear();
for(auto& it:files_map)
files.push_back(it.second);
}
void RsGxsChannelPostsModel::setTreeMode(TreeMode mode)
{
if(mode == mTreeMode)