mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-28 18:42:20 -04:00
GxsForums:
- Fixed expand new messages - Fixed creating of thread/post messages git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6065 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
84c910672e
commit
f12473f7f7
5 changed files with 402 additions and 362 deletions
|
@ -25,6 +25,7 @@
|
|||
#include "GxsForumsFillThread.h"
|
||||
#include "GxsForumThreadWidget.h"
|
||||
|
||||
#include "gxs/rsgxsflags.h"
|
||||
#include <retroshare/rsgxsforums.h>
|
||||
|
||||
#include <iostream>
|
||||
|
@ -74,6 +75,18 @@ void GxsForumsFillThread::stop()
|
|||
wait();
|
||||
}
|
||||
|
||||
void GxsForumsFillThread::calculateExpand(const RsGxsForumMsg &msg, QTreeWidgetItem *item)
|
||||
{
|
||||
if (mFillComplete && mExpandNewMessages && IS_MSG_UNREAD(msg.mMeta.mMsgStatus)) {
|
||||
QTreeWidgetItem *parentItem = item;
|
||||
while ((parentItem = parentItem->parent()) != NULL) {
|
||||
if (std::find(mItemToExpand.begin(), mItemToExpand.end(), parentItem) == mItemToExpand.end()) {
|
||||
mItemToExpand.push_back(parentItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GxsForumsFillThread::run()
|
||||
{
|
||||
RsTokenService *service = rsGxsForums->getTokenService();
|
||||
|
@ -162,6 +175,7 @@ void GxsForumsFillThread::run()
|
|||
|
||||
QTreeWidgetItem *item = mParent->convertMsgToThreadWidget(msg, mUseChildTS, mFilterColumn);
|
||||
threadList.push_back(QPair<std::string, QTreeWidgetItem*>(msg.mMeta.mMsgId, item));
|
||||
calculateExpand(msg, item);
|
||||
|
||||
mItems.append(item);
|
||||
emit progress(++pos, count);
|
||||
|
@ -202,6 +216,7 @@ void GxsForumsFillThread::run()
|
|||
threadPair.second->addChild(item);
|
||||
}
|
||||
|
||||
calculateExpand(msg, item);
|
||||
|
||||
/* add item to process list */
|
||||
threadList.push_back(QPair<std::string, QTreeWidgetItem*>(msg.mMeta.mMsgId, item));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue