fixed to attach multiple links for Create Forum Message

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2970 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2010-05-21 23:45:25 +00:00
parent 87d96059cc
commit 5b9b0aba96

View File

@ -371,27 +371,14 @@ void CreateForumMsg::fileHashingFinished(AttachFileItem* file) {
std::string fileSize = *(&fileSizeChar);
std::string mesgString = "<a href='retroshare://file|" + (file->FileName()) + "|" + fileSize + "|" + (file->FileHash()) + "'>"
+ "retroshare://file|" + (file->FileName()) + "|" + fileSize + "|" + (file->FileHash()) + "</a>";
+ "retroshare://file|" + (file->FileName()) + "|" + fileSize + "|" + (file->FileHash()) + "</a>" + "<br>";
#ifdef CHAT_DEBUG
std::cerr << "CreateForumMsg::anchorClicked mesgString : " << mesgString << std::endl;
#endif
const char * messageString = mesgString.c_str ();
ui.forumMessage->textCursor().insertHtml(QString::fromStdString(mesgString));
//convert char massageString to w_char
wchar_t* message;
int requiredSize = mbstowcs(NULL, messageString, 0); // C4996
/* Add one to leave room for the NULL terminator */
message = (wchar_t *)malloc( (requiredSize + 1) * sizeof( wchar_t ));
if (! message) {
std::cerr << ("Memory allocation failure.\n");
}
int size = mbstowcs( message, messageString, requiredSize + 1); // C4996
if (size == (size_t) (-1)) {
printf("Couldn't convert string--invalid multibyte character.\n");
}
ui.forumMessage->setHtml(QString::fromStdWString(message));
ui.forumMessage->setFocus( Qt::OtherFocusReason );
}