mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-26 07:59:35 -05:00
commit
e829292eaf
@ -117,14 +117,14 @@ int RsGxsForumModel::columnCount(const QModelIndex &/*parent*/) const
|
|||||||
return COLUMN_THREAD_NB_COLUMNS ;
|
return COLUMN_THREAD_NB_COLUMNS ;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<std::pair<time_t,RsGxsMessageId> > RsGxsForumModel::getPostVersions(const RsGxsMessageId& mid) const
|
std::vector<std::pair<rstime_t,RsGxsMessageId> > RsGxsForumModel::getPostVersions(const RsGxsMessageId& mid) const
|
||||||
{
|
{
|
||||||
auto it = mPostVersions.find(mid);
|
auto it = mPostVersions.find(mid);
|
||||||
|
|
||||||
if(it != mPostVersions.end())
|
if(it != mPostVersions.end())
|
||||||
return it->second;
|
return it->second;
|
||||||
else
|
else
|
||||||
return std::vector<std::pair<time_t,RsGxsMessageId> >();
|
return std::vector<std::pair<rstime_t,RsGxsMessageId> >();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RsGxsForumModel::getPostData(const QModelIndex& i,ForumModelPostEntry& fmpe) const
|
bool RsGxsForumModel::getPostData(const QModelIndex& i,ForumModelPostEntry& fmpe) const
|
||||||
@ -746,7 +746,7 @@ void RsGxsForumModel::clear()
|
|||||||
emit forumLoaded();
|
emit forumLoaded();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RsGxsForumModel::setPosts(const RsGxsForumGroup& group, const std::vector<ForumModelPostEntry>& posts,const std::map<RsGxsMessageId,std::vector<std::pair<time_t,RsGxsMessageId> > >& post_versions)
|
void RsGxsForumModel::setPosts(const RsGxsForumGroup& group, const std::vector<ForumModelPostEntry>& posts,const std::map<RsGxsMessageId,std::vector<std::pair<rstime_t,RsGxsMessageId> > >& post_versions)
|
||||||
{
|
{
|
||||||
preMods();
|
preMods();
|
||||||
|
|
||||||
@ -812,7 +812,7 @@ void RsGxsForumModel::update_posts(const RsGxsGroupId& group_id)
|
|||||||
|
|
||||||
// 2 - sort messages into a proper hierarchy
|
// 2 - sort messages into a proper hierarchy
|
||||||
|
|
||||||
auto post_versions = new std::map<RsGxsMessageId,std::vector<std::pair<time_t, RsGxsMessageId> > >() ;
|
auto post_versions = new std::map<RsGxsMessageId,std::vector<std::pair<rstime_t, RsGxsMessageId> > >() ;
|
||||||
std::vector<ForumPostEntry> *vect = new std::vector<ForumPostEntry>();
|
std::vector<ForumPostEntry> *vect = new std::vector<ForumPostEntry>();
|
||||||
RsGxsForumGroup group = groups[0];
|
RsGxsForumGroup group = groups[0];
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ public:
|
|||||||
|
|
||||||
static const QString FilterString ;
|
static const QString FilterString ;
|
||||||
|
|
||||||
std::vector<std::pair<time_t,RsGxsMessageId> > getPostVersions(const RsGxsMessageId& mid) const;
|
std::vector<std::pair<rstime_t,RsGxsMessageId> > getPostVersions(const RsGxsMessageId& mid) const;
|
||||||
|
|
||||||
// This method will asynchroneously update the data
|
// This method will asynchroneously update the data
|
||||||
void updateForum(const RsGxsGroupId& forumGroup);
|
void updateForum(const RsGxsGroupId& forumGroup);
|
||||||
@ -170,11 +170,11 @@ private:
|
|||||||
static void convertMsgToPostEntry(const RsGxsForumGroup &mForumGroup, const RsMsgMetaData &msg, bool useChildTS, ForumModelPostEntry& fentry);
|
static void convertMsgToPostEntry(const RsGxsForumGroup &mForumGroup, const RsMsgMetaData &msg, bool useChildTS, ForumModelPostEntry& fentry);
|
||||||
|
|
||||||
void computeMessagesHierarchy(const RsGxsForumGroup& forum_group, const std::vector<RsMsgMetaData> &msgs_array, std::vector<ForumModelPostEntry>& posts, std::map<RsGxsMessageId, std::vector<std::pair<time_t, RsGxsMessageId> > > &mPostVersions);
|
void computeMessagesHierarchy(const RsGxsForumGroup& forum_group, const std::vector<RsMsgMetaData> &msgs_array, std::vector<ForumModelPostEntry>& posts, std::map<RsGxsMessageId, std::vector<std::pair<time_t, RsGxsMessageId> > > &mPostVersions);
|
||||||
void setPosts(const RsGxsForumGroup& group, const std::vector<ForumModelPostEntry>& posts,const std::map<RsGxsMessageId,std::vector<std::pair<time_t,RsGxsMessageId> > >& post_versions);
|
void setPosts(const RsGxsForumGroup& group, const std::vector<ForumModelPostEntry>& posts,const std::map<RsGxsMessageId,std::vector<std::pair<rstime_t,RsGxsMessageId> > >& post_versions);
|
||||||
void initEmptyHierarchy(std::vector<ForumModelPostEntry>& posts);
|
void initEmptyHierarchy(std::vector<ForumModelPostEntry>& posts);
|
||||||
|
|
||||||
std::vector<ForumModelPostEntry> mPosts ; // store the list of posts updated from rsForums.
|
std::vector<ForumModelPostEntry> mPosts ; // store the list of posts updated from rsForums.
|
||||||
std::map<RsGxsMessageId,std::vector<std::pair<time_t,RsGxsMessageId> > > mPostVersions;
|
std::map<RsGxsMessageId,std::vector<std::pair<rstime_t,RsGxsMessageId> > > mPostVersions;
|
||||||
|
|
||||||
QColor mTextColorRead ;
|
QColor mTextColorRead ;
|
||||||
QColor mTextColorUnread ;
|
QColor mTextColorUnread ;
|
||||||
|
@ -1193,7 +1193,7 @@ void GxsForumThreadWidget::insertMessage()
|
|||||||
|
|
||||||
// add/show combobox for versions, if applicable, and enable it. If no older versions of the post available, hide the combobox.
|
// add/show combobox for versions, if applicable, and enable it. If no older versions of the post available, hide the combobox.
|
||||||
|
|
||||||
std::vector<std::pair<time_t,RsGxsMessageId> > post_versions = mThreadModel->getPostVersions(mOrigThreadId);
|
std::vector<std::pair<rstime_t,RsGxsMessageId> > post_versions = mThreadModel->getPostVersions(mOrigThreadId);
|
||||||
|
|
||||||
#ifdef DEBUG_FORUMS
|
#ifdef DEBUG_FORUMS
|
||||||
std::cerr << "Looking into existing versions for post " << mOrigThreadId << ", thread history: " << post_versions.size() << std::endl;
|
std::cerr << "Looking into existing versions for post " << mOrigThreadId << ", thread history: " << post_versions.size() << std::endl;
|
||||||
|
Loading…
Reference in New Issue
Block a user