From a79c5eca10e6f36162173358bedce4fc9fa28fbe Mon Sep 17 00:00:00 2001 From: defnax Date: Mon, 29 Mar 2010 15:27:37 +0000 Subject: [PATCH] Fixed to display when Peer name is not avaible with a default string. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2663 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/MessagesDialog.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/retroshare-gui/src/gui/MessagesDialog.cpp b/retroshare-gui/src/gui/MessagesDialog.cpp index 5a462769f..ac46c6f37 100644 --- a/retroshare-gui/src/gui/MessagesDialog.cpp +++ b/retroshare-gui/src/gui/MessagesDialog.cpp @@ -887,13 +887,24 @@ void MessagesDialog::insertMsgTxtAndFiles(QModelIndex Index) QString msgTxt; for(pit = msgInfo.msgto.begin(); pit != msgInfo.msgto.end(); pit++) { - msgTxt += " " + QString::fromStdString(rsPeers->getPeerName(*pit)) + "" + " "; + if (QString::fromStdString(rsPeers->getPeerName(*pit)) == "") + { + msgTxt += " " + tr("Anonymous") + "" + " "; + } + else + msgTxt += " " + QString::fromStdString(rsPeers->getPeerName(*pit)) + "" + " "; + } if (msgInfo.msgcc.size() > 0) msgTxt += "\nCc: "; for(pit = msgInfo.msgcc.begin(); pit != msgInfo.msgcc.end(); pit++) { + if (QString::fromStdString(rsPeers->getPeerName(*pit)) == "") + { + msgTxt += " " + tr("Anonymous") + "" + " "; + } + else msgTxt += " " + QString::fromStdString(rsPeers->getPeerName(*pit)) + "" + " "; } @@ -901,6 +912,11 @@ void MessagesDialog::insertMsgTxtAndFiles(QModelIndex Index) msgTxt += "\nBcc: "; for(pit = msgInfo.msgbcc.begin(); pit != msgInfo.msgbcc.end(); pit++) { + if (QString::fromStdString(rsPeers->getPeerName(*pit)) == "") + { + msgTxt += " " + tr("Anonymous") + "" + " "; + } + else msgTxt += " " + QString::fromStdString(rsPeers->getPeerName(*pit)) + "" + " "; }