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
This commit is contained in:
thunder2 2011-06-09 23:16:56 +00:00
parent f1e96c839e
commit a56ce1d5be

View File

@ -491,6 +491,7 @@ static void CleanupItems (QList<QTreeWidgetItem *> &Items)
delete (*Item); delete (*Item);
} }
} }
Items.clear();
} }
void ForumsDialog::forumInfoToGroupItemInfo(const ForumInfo &forumInfo, GroupItemInfo &groupItemInfo) void ForumsDialog::forumInfoToGroupItemInfo(const ForumInfo &forumInfo, GroupItemInfo &groupItemInfo)
@ -585,6 +586,10 @@ void ForumsDialog::changedForum(const QString &id)
void ForumsDialog::changedThread () void ForumsDialog::changedThread ()
{ {
if (fillThread) {
return;
}
/* just grab the ids of the current item */ /* just grab the ids of the current item */
QTreeWidgetItem *curr = ui.threadTreeWidget->currentItem(); QTreeWidgetItem *curr = ui.threadTreeWidget->currentItem();
@ -718,13 +723,6 @@ void ForumsDialog::fillThreadFinished()
// clear list // clear list
fillThread->items.clear(); fillThread->items.clear();
QList<QTreeWidgetItem*>::iterator Item;
for (Item = fillThread->itemToExpand.begin(); Item != fillThread->itemToExpand.end(); Item++) {
if ((*Item)->isHidden() == false) {
(*Item)->setExpanded(true);
}
}
} else { } else {
FillThreads (fillThread->items, fillThread->expandNewMessages, fillThread->itemToExpand); FillThreads (fillThread->items, fillThread->expandNewMessages, fillThread->itemToExpand);
@ -732,6 +730,12 @@ void ForumsDialog::fillThreadFinished()
CleanupItems (fillThread->items); CleanupItems (fillThread->items);
} }
QList<QTreeWidgetItem*>::iterator Item;
for (Item = fillThread->itemToExpand.begin(); Item != fillThread->itemToExpand.end(); Item++) {
if ((*Item)->isHidden() == false) {
(*Item)->setExpanded(true);
}
}
fillThread->itemToExpand.clear(); fillThread->itemToExpand.clear();
if (ui.filterPatternLineEdit->text().isEmpty() == false) { if (ui.filterPatternLineEdit->text().isEmpty() == false) {
@ -808,7 +812,6 @@ void ForumsDialog::insertThreads()
ui.forumName->setText(QString::fromStdWString(fi.forumName)); ui.forumName->setText(QString::fromStdWString(fi.forumName));
ui.progressBar->show(); ui.progressBar->show();
ui.threadTreeWidget->clear();
// create fill thread // create fill thread
fillThread = new ForumsFillThread(this); fillThread = new ForumsFillThread(this);