mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
patch from AC to perform html optimization of forum posts using the canonical function optimizeHtml()
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5847 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
e6563eba52
commit
93501bdc12
@ -353,8 +353,6 @@ void ForumMsgItem::sendMsg()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString desc = textEdit->toHtml();
|
|
||||||
|
|
||||||
if(textEdit->toPlainText().isEmpty())
|
if(textEdit->toPlainText().isEmpty())
|
||||||
{ /* error message */
|
{ /* error message */
|
||||||
QMessageBox::warning(this, "RetroShare",tr("Please give a Text Message"),
|
QMessageBox::warning(this, "RetroShare",tr("Please give a Text Message"),
|
||||||
@ -382,6 +380,9 @@ void ForumMsgItem::sendMsg()
|
|||||||
msgInfo.title = L"Re: " + msg.title;
|
msgInfo.title = L"Re: " + msg.title;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString desc;
|
||||||
|
RsHtml::optimizeHtml(textEdit, desc);
|
||||||
|
|
||||||
msgInfo.msg = desc.toStdWString();
|
msgInfo.msg = desc.toStdWString();
|
||||||
msgInfo.msgflags = 0;
|
msgInfo.msgflags = 0;
|
||||||
|
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
#include "gui/RetroShareLink.h"
|
#include "gui/RetroShareLink.h"
|
||||||
#include "gui/common/Emoticons.h"
|
#include "gui/common/Emoticons.h"
|
||||||
|
|
||||||
|
#include "util/HandleRichText.h"
|
||||||
#include "util/misc.h"
|
#include "util/misc.h"
|
||||||
|
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
@ -153,10 +154,9 @@ void CreateForumMsg::newMsg()
|
|||||||
void CreateForumMsg::createMsg()
|
void CreateForumMsg::createMsg()
|
||||||
{
|
{
|
||||||
QString name = misc::removeNewLine(ui.forumSubject->text());
|
QString name = misc::removeNewLine(ui.forumSubject->text());
|
||||||
QString desc = ui.forumMessage->toHtml();
|
QString desc;
|
||||||
|
|
||||||
if(desc == QTextDocument(ui.forumMessage->toPlainText()).toHtml())
|
RsHtml::optimizeHtml(ui.forumMessage, desc);
|
||||||
desc = ui.forumMessage->toPlainText() ;
|
|
||||||
|
|
||||||
if(name.isEmpty())
|
if(name.isEmpty())
|
||||||
{ /* error message */
|
{ /* error message */
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
#include "gui/RetroShareLink.h"
|
#include "gui/RetroShareLink.h"
|
||||||
#include "gui/common/Emoticons.h"
|
#include "gui/common/Emoticons.h"
|
||||||
|
|
||||||
|
#include "util/HandleRichText.h"
|
||||||
#include "util/misc.h"
|
#include "util/misc.h"
|
||||||
|
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
@ -224,10 +225,9 @@ void CreateForumV2Msg::loadFormInformation()
|
|||||||
void CreateForumV2Msg::createMsg()
|
void CreateForumV2Msg::createMsg()
|
||||||
{
|
{
|
||||||
QString name = misc::removeNewLine(ui.forumSubject->text());
|
QString name = misc::removeNewLine(ui.forumSubject->text());
|
||||||
QString desc = ui.forumMessage->toHtml();
|
QString desc;
|
||||||
|
|
||||||
if(desc == QTextDocument(ui.forumMessage->toPlainText()).toHtml())
|
RsHtml::optimizeHtml(ui.forumMessage, desc);
|
||||||
desc = ui.forumMessage->toPlainText() ;
|
|
||||||
|
|
||||||
if(name.isEmpty())
|
if(name.isEmpty())
|
||||||
{ /* error message */
|
{ /* error message */
|
||||||
|
Loading…
Reference in New Issue
Block a user