update display of the profilewidget tab in peersdialog

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2087 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
joss17 2010-01-19 21:43:13 +00:00
parent 0b736d9f28
commit 2f13d31725
3 changed files with 20 additions and 18 deletions

View file

@ -297,7 +297,16 @@ void PeersDialog::keyPressEvent(QKeyEvent *e)
void PeersDialog::updateDisplay()
{
insertPeers() ;
// add self nick and Avatar to Friends.
RsPeerDetails pd ;
if (rsPeers->getPeerDetails(rsPeers->getOwnId(),pd)) {
QString titleStr("<span style=\"font-size:16pt; font-weight:500;"
"color:#32cd32;\">%1</span>");
ui.nicklabel->setText(titleStr.arg(QString::fromStdString(pd.name) + tr(" (me)") + QString::fromStdString(pd.location))) ;
}
insertPeers() ;
}
/* get the list of peers from the RsIface. */
@ -308,6 +317,7 @@ void PeersDialog::insertPeers()
if (!rsPeers) {
/* not ready yet! */
std::cerr << "PeersDialog::insertPeers() not ready yet : rsPeers unintialized." << std::endl;
return;
}
@ -323,14 +333,6 @@ void PeersDialog::insertPeers()
/* get a link to the table */
QTreeWidget *peertreeWidget = ui.peertreeWidget;
// add self nick and Avatar to Friends.
RsPeerDetails pd ;
if (rsPeers->getPeerDetails(rsPeers->getOwnId(),pd)) {
QString titleStr("<span style=\"font-size:16pt; font-weight:500;"
"color:#32cd32;\">%1</span>");
ui.nicklabel->setText(titleStr.arg(QString::fromStdString(pd.name) + tr(" (me)"))) ;
}
//remove items that are not fiends anymore
int index = 0;
while (index < peertreeWidget->topLevelItemCount()) {