fixed a few UI bugs in channel posts

This commit is contained in:
csoler 2020-06-12 11:00:51 +02:00
parent 67e8b87750
commit f40d7a75b3
No known key found for this signature in database
GPG key ID: 7BCA522266C0804C
4 changed files with 35 additions and 12 deletions

View file

@ -401,6 +401,11 @@ void RsGxsChannelPostsModel::clear()
emit channelPostsLoaded();
}
bool operator<(const RsGxsChannelPost& p1,const RsGxsChannelPost& p2)
{
return p1.mMeta.mPublishTs > p2.mMeta.mPublishTs;
}
void RsGxsChannelPostsModel::setPosts(const RsGxsChannelGroup& group, std::vector<RsGxsChannelPost>& posts)
{
preMods();
@ -413,6 +418,8 @@ void RsGxsChannelPostsModel::setPosts(const RsGxsChannelGroup& group, std::vecto
createPostsArray(posts);
std::sort(mPosts.begin(),mPosts.end());
mFilteredPosts.clear();
for(int i=0;i<mPosts.size();++i)
mFilteredPosts.push_back(i);