mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
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:
parent
87d96059cc
commit
5b9b0aba96
@ -371,27 +371,14 @@ void CreateForumMsg::fileHashingFinished(AttachFileItem* file) {
|
|||||||
std::string fileSize = *(&fileSizeChar);
|
std::string fileSize = *(&fileSizeChar);
|
||||||
|
|
||||||
std::string mesgString = "<a href='retroshare://file|" + (file->FileName()) + "|" + fileSize + "|" + (file->FileHash()) + "'>"
|
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
|
#ifdef CHAT_DEBUG
|
||||||
std::cerr << "CreateForumMsg::anchorClicked mesgString : " << mesgString << std::endl;
|
std::cerr << "CreateForumMsg::anchorClicked mesgString : " << mesgString << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const char * messageString = mesgString.c_str ();
|
ui.forumMessage->textCursor().insertHtml(QString::fromStdString(mesgString));
|
||||||
|
|
||||||
//convert char massageString to w_char
|
ui.forumMessage->setFocus( Qt::OtherFocusReason );
|
||||||
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));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user