Messages with plain text (like the welcome message) are shown correctly.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4080 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2011-03-06 12:58:18 +00:00
parent 1027621e07
commit b245ad7cf7
2 changed files with 27 additions and 27 deletions

View file

@ -19,6 +19,7 @@
* Boston, MA 02110-1301, USA.
****************************************************************/
#include <QTextBrowser>
#include "HandleRichText.h"
@ -49,7 +50,12 @@ QString formatText(const QString &text, unsigned int flag)
}
QDomDocument doc;
doc.setContent(text);
if (doc.setContent(text) == false) {
// convert text with QTextBrowser
QTextBrowser textBrowser;
textBrowser.setText(text);
doc.setContent(textBrowser.toHtml());
}
QDomElement body = doc.documentElement();
if (flag & RSHTML_FORMATTEXT_EMBED_SMILEYS) {