Added when no Thread selected clear Forum Name ,Post Text and Thread Title

Added when switched Thread then clear last Post Text and  Thread Title

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1968 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2010-01-03 01:27:29 +00:00
parent 256ea3a282
commit 4cc7c5aae4

View File

@ -571,6 +571,12 @@ void ForumsDialog::insertThreads()
{ {
/* not an actual forum - clear */ /* not an actual forum - clear */
ui.threadTreeWidget->clear(); ui.threadTreeWidget->clear();
/* when no Thread selected - clear */
ui.forumName->clear();
ui.threadTitle->clear();
ui.postText->clear();
/* clear last stored forumID */
mCurrForumId = "";
std::cerr << "ForumsDialog::insertThreads() Current Thread Invalid" << std::endl; std::cerr << "ForumsDialog::insertThreads() Current Thread Invalid" << std::endl;
return; return;
@ -728,7 +734,6 @@ void ForumsDialog::insertThreads()
rsForums->getForumMessage(fId,mit->msgId,msginfo) ; rsForums->getForumMessage(fId,mit->msgId,msginfo) ;
child->setText(1, QString::fromStdWString(mit->title)); child->setText(1, QString::fromStdWString(mit->title));
//child->setText(2, QString::fromStdString(msginfo.srcId));
child->setText(2, QString::fromStdString(rsPeers->getPeerName(msginfo.srcId))); child->setText(2, QString::fromStdString(rsPeers->getPeerName(msginfo.srcId)));
child->setText(3, "signed"); child->setText(3, "signed");
child->setText(4, QString::fromStdString(mit->parentId)); child->setText(4, QString::fromStdString(mit->parentId));
@ -751,6 +756,8 @@ void ForumsDialog::insertThreads()
/* add all messages in! */ /* add all messages in! */
ui.threadTreeWidget->clear(); ui.threadTreeWidget->clear();
ui.postText->clear();
ui.threadTitle->clear();
ui.threadTreeWidget->insertTopLevelItems(0, items); ui.threadTreeWidget->insertTopLevelItems(0, items);
} }