diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index 024054cf5..ec022979b 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -202,7 +202,8 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget mThreadCompareRole = new RSTreeWidgetItemCompareRole; mThreadCompareRole->setRole(COLUMN_THREAD_DATE, ROLE_THREAD_SORT); - ui->threadTreeWidget->setModel(new RsGxsForumModel(this)); + mThreadModel = new RsGxsForumModel(this); + ui->threadTreeWidget->setModel(mThreadModel); ui->threadTreeWidget->setItemDelegateForColumn(COLUMN_THREAD_DISTRIBUTION,new DistributionItemDelegate()) ; connect(ui->versions_CB, SIGNAL(currentIndexChanged(int)), this, SLOT(changedVersion())); @@ -395,7 +396,8 @@ void GxsForumThreadWidget::groupIdChanged() emit groupChanged(this); - fillComplete(); + mThreadModel->setForum(groupId()); + //fillComplete(); } QString GxsForumThreadWidget::groupName(bool withUnreadCount) @@ -474,7 +476,7 @@ void GxsForumThreadWidget::updateDisplay(bool complete) if (complete) { /* Fill complete */ requestGroupData(); - insertThreads(); + //insertThreads(); insertMessage(); mIgnoredMsgId.clear(); @@ -492,7 +494,7 @@ void GxsForumThreadWidget::updateDisplay(bool complete) if (grpIds.find(groupId())!=grpIds.end()){ updateGroup = true; /* Update threads */ - insertThreads(); + //insertThreads(); } else { std::map > msgIds; getAllMsgIds(msgIds); @@ -504,7 +506,7 @@ void GxsForumThreadWidget::updateDisplay(bool complete) if (msgIds.find(groupId()) != msgIds.end()) { /* Update threads */ - insertThreads(); + //insertThreads(); } } @@ -1427,7 +1429,7 @@ QTreeWidgetItem *GxsForumThreadWidget::convertMsgToThreadWidget(const RsGxsForum return item; } - +#ifdef TO_REMOVE void GxsForumThreadWidget::insertThreads() { #ifdef DEBUG_FORUMS @@ -1502,9 +1504,9 @@ void GxsForumThreadWidget::insertThreads() ui->threadTreeWidget->setRootIsDecorated(!mFillThread->mFlatView); // connect thread - connect(mFillThread, SIGNAL(finished()), this, SLOT(fillThreadFinished()), Qt::BlockingQueuedConnection); - connect(mFillThread, SIGNAL(status(QString)), this, SLOT(fillThreadStatus(QString))); - connect(mFillThread, SIGNAL(progress(int,int)), this, SLOT(fillThreadProgress(int,int))); + // connect(mFillThread, SIGNAL(finished()), this, SLOT(fillThreadFinished()), Qt::BlockingQueuedConnection); + // connect(mFillThread, SIGNAL(status(QString)), this, SLOT(fillThreadStatus(QString))); + // connect(mFillThread, SIGNAL(progress(int,int)), this, SLOT(fillThreadProgress(int,int))); #ifdef DEBUG_FORUMS std::cerr << "ForumsDialog::insertThreads() Start fill thread" << std::endl; @@ -1535,7 +1537,6 @@ static void copyItem(QTreeWidgetItem *item, const QTreeWidgetItem *newItem) void GxsForumThreadWidget::fillThreads(QList &threadList, bool expandNewMessages, QList &itemToExpand) { -#ifdef TODO #ifdef DEBUG_FORUMS std::cerr << "GxsForumThreadWidget::fillThreads()" << std::endl; #endif @@ -1607,9 +1608,10 @@ void GxsForumThreadWidget::fillThreads(QList &threadList, boo #ifdef DEBUG_FORUMS std::cerr << "GxsForumThreadWidget::fillThreads() done" << std::endl; #endif -#endif } +#endif +#ifdef TO_REMOVE void GxsForumThreadWidget::fillChildren(QTreeWidgetItem *parentItem, QTreeWidgetItem *newParentItem, bool expandNewMessages, QList &itemToExpand) { int index = 0; @@ -1673,6 +1675,7 @@ void GxsForumThreadWidget::fillChildren(QTreeWidgetItem *parentItem, QTreeWidget } } } +#endif void GxsForumThreadWidget::insertMessage() { @@ -2487,7 +2490,7 @@ void GxsForumThreadWidget::filterColumnChanged(int column) if (column == COLUMN_THREAD_CONTENT) { // need content ... refill - insertThreads(); + //insertThreads(); } else { filterItems(ui->filterLineEdit->text()); } diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h index 40aa469cb..a3d227431 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h @@ -32,6 +32,7 @@ class RSTreeWidgetItemCompareRole; class RsGxsForumMsg; class GxsForumsFillThread; class RsGxsForumGroup; +class RsGxsForumModel; namespace Ui { class GxsForumThreadWidget; @@ -149,11 +150,11 @@ private slots: private: void insertMessageData(const RsGxsForumMsg &msg); - void insertThreads(); void insertMessage(); - void fillThreads(QList &threadList, bool expandNewMessages, QList &itemToExpand); - void fillChildren(QTreeWidgetItem *parentItem, QTreeWidgetItem *newParentItem, bool expandNewMessages, QList &itemToExpand); + //void insertThreads(); + //void fillThreads(QList &threadList, bool expandNewMessages, QList &itemToExpand); + //void fillChildren(QTreeWidgetItem *parentItem, QTreeWidgetItem *newParentItem, bool expandNewMessages, QList &itemToExpand); int getSelectedMsgCount(QList *pRows, QList *pRowsRead, QList *pRowsUnread); void setMsgReadStatus(QList &rows, bool read); @@ -225,6 +226,8 @@ private: QMap > > mPostVersions ; // holds older versions of posts + RsGxsForumModel *mThreadModel; + Ui::GxsForumThreadWidget *ui; };