summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2013-03-04 13:23:10 (GMT)
committerRemko Tronçon <git@el-tramo.be>2013-03-04 16:03:53 (GMT)
commitca7a45a25c2fe332fad1ee3f7a2822415c249206 (patch)
tree268c6d37f087935a307061f9d5ef507ddd5162cf /Swift/QtUI/QtHistoryWindow.cpp
parent836925a5cdc7017da7fb84416c803e652b48e399 (diff)
downloadswift-ca7a45a25c2fe332fad1ee3f7a2822415c249206.zip
swift-ca7a45a25c2fe332fad1ee3f7a2822415c249206.tar.bz2
Qt5 support & warning fixes.
Change-Id: I62c7d5ca44c915e36c797c798294b7c34b465514
Diffstat (limited to 'Swift/QtUI/QtHistoryWindow.cpp')
-rw-r--r--Swift/QtUI/QtHistoryWindow.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/Swift/QtUI/QtHistoryWindow.cpp b/Swift/QtUI/QtHistoryWindow.cpp
index 875235d..23621c6 100644
--- a/Swift/QtUI/QtHistoryWindow.cpp
+++ b/Swift/QtUI/QtHistoryWindow.cpp
@@ -21,6 +21,7 @@
#include <QDateTime>
#include <Swift/QtUI/QtScaledAvatarCache.h>
#include <QLineEdit>
+#include "QtUtilities.h"
#include <boost/smart_ptr/make_shared.hpp>
#include <boost/numeric/conversion/cast.hpp>
@@ -108,7 +109,7 @@ void QtHistoryWindow::addMessage(const std::string &message, const std::string &
QString scaledAvatarPath = QtScaledAvatarCache(32).getScaledAvatarPath(avatarPath.c_str());
QString messageHTML(P2QSTRING(message));
- messageHTML = Qt::escape(messageHTML);
+ messageHTML = QtUtilities::htmlEscape(messageHTML);
QString searchTerm = ui_.searchBox_->lineEdit()->text();
if (searchTerm.length()) {
messageHTML.replace(searchTerm, "<span style='background-color: yellow'>" + searchTerm + "</span>");
@@ -125,14 +126,14 @@ void QtHistoryWindow::addMessage(const std::string &message, const std::string &
if (addAtTheTop) {
bool appendToPrevious = ((senderIsSelf && previousTopMessageWasSelf_) || (!senderIsSelf && !previousTopMessageWasSelf_&& previousTopSenderName_ == P2QSTRING(senderName)));
- conversation_->addMessageTop(boost::shared_ptr<ChatSnippet>(new MessageSnippet(messageHTML, Qt::escape(P2QSTRING(senderName)), qTime, qAvatarPath, senderIsSelf, appendToPrevious, theme_, P2QSTRING(id))));
+ conversation_->addMessageTop(boost::shared_ptr<ChatSnippet>(new MessageSnippet(messageHTML, QtUtilities::htmlEscape(P2QSTRING(senderName)), qTime, qAvatarPath, senderIsSelf, appendToPrevious, theme_, P2QSTRING(id))));
previousTopMessageWasSelf_ = senderIsSelf;
previousTopSenderName_ = P2QSTRING(senderName);
}
else {
bool appendToPrevious = ((senderIsSelf && previousBottomMessageWasSelf_) || (!senderIsSelf && !previousBottomMessageWasSelf_&& previousBottomSenderName_ == P2QSTRING(senderName)));
- conversation_->addMessageBottom(boost::shared_ptr<ChatSnippet>(new MessageSnippet(messageHTML, Qt::escape(P2QSTRING(senderName)), qTime, qAvatarPath, senderIsSelf, appendToPrevious, theme_, P2QSTRING(id))));
+ conversation_->addMessageBottom(boost::shared_ptr<ChatSnippet>(new MessageSnippet(messageHTML, QtUtilities::htmlEscape(P2QSTRING(senderName)), qTime, qAvatarPath, senderIsSelf, appendToPrevious, theme_, P2QSTRING(id))));
previousBottomMessageWasSelf_ = senderIsSelf;
previousBottomSenderName_ = P2QSTRING(senderName);
}