From a56ce1d5be54b036344e1ce6236888536131984a Mon Sep 17 00:00:00 2001 From: thunder2 Date: Thu, 9 Jun 2011 23:16:56 +0000 Subject: [PATCH] Fixed refill of the threads tree after receiving a new message. Now the new message is expanded. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4245 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/ForumsDialog.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/retroshare-gui/src/gui/ForumsDialog.cpp b/retroshare-gui/src/gui/ForumsDialog.cpp index 048945ddf..a51ababce 100644 --- a/retroshare-gui/src/gui/ForumsDialog.cpp +++ b/retroshare-gui/src/gui/ForumsDialog.cpp @@ -491,6 +491,7 @@ static void CleanupItems (QList &Items) delete (*Item); } } + Items.clear(); } void ForumsDialog::forumInfoToGroupItemInfo(const ForumInfo &forumInfo, GroupItemInfo &groupItemInfo) @@ -585,6 +586,10 @@ void ForumsDialog::changedForum(const QString &id) void ForumsDialog::changedThread () { + if (fillThread) { + return; + } + /* just grab the ids of the current item */ QTreeWidgetItem *curr = ui.threadTreeWidget->currentItem(); @@ -718,13 +723,6 @@ void ForumsDialog::fillThreadFinished() // clear list fillThread->items.clear(); - - QList::iterator Item; - for (Item = fillThread->itemToExpand.begin(); Item != fillThread->itemToExpand.end(); Item++) { - if ((*Item)->isHidden() == false) { - (*Item)->setExpanded(true); - } - } } else { FillThreads (fillThread->items, fillThread->expandNewMessages, fillThread->itemToExpand); @@ -732,6 +730,12 @@ void ForumsDialog::fillThreadFinished() CleanupItems (fillThread->items); } + QList::iterator Item; + for (Item = fillThread->itemToExpand.begin(); Item != fillThread->itemToExpand.end(); Item++) { + if ((*Item)->isHidden() == false) { + (*Item)->setExpanded(true); + } + } fillThread->itemToExpand.clear(); if (ui.filterPatternLineEdit->text().isEmpty() == false) { @@ -808,7 +812,6 @@ void ForumsDialog::insertThreads() ui.forumName->setText(QString::fromStdWString(fi.forumName)); ui.progressBar->show(); - ui.threadTreeWidget->clear(); // create fill thread fillThread = new ForumsFillThread(this);