summaryrefslogtreecommitdiffstats
path: root/src/gui/messageform.cpp
diff options
context:
space:
mode:
authorLubos Dolezel <lubos@dolezel.info>2015-06-04 22:18:12 +0200
committerLubos Dolezel <lubos@dolezel.info>2015-06-04 22:18:12 +0200
commitbcbbdf0b79d52c5ef40d11615954de35eda184e3 (patch)
tree05283199f05ff204a26b9b6138fe0907cebd5db3 /src/gui/messageform.cpp
parent85a753d68eb8900ba94ce89f9638269858645e19 (diff)
downloadtwinkle-bcbbdf0b79d52c5ef40d11615954de35eda184e3.tar
twinkle-bcbbdf0b79d52c5ef40d11615954de35eda184e3.tar.gz
twinkle-bcbbdf0b79d52c5ef40d11615954de35eda184e3.tar.lz
twinkle-bcbbdf0b79d52c5ef40d11615954de35eda184e3.tar.xz
twinkle-bcbbdf0b79d52c5ef40d11615954de35eda184e3.zip
Qt 5 now supported
Diffstat (limited to 'src/gui/messageform.cpp')
-rw-r--r--src/gui/messageform.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/gui/messageform.cpp b/src/gui/messageform.cpp
index f4afec8..02c7a0e 100644
--- a/src/gui/messageform.cpp
+++ b/src/gui/messageform.cpp
@@ -318,7 +318,11 @@ void MessageForm::addMessage(const im::t_msg &msg, const QString &name)
// Timestamp and name of sender
if (msg.direction == im::MSG_DIR_IN) s += "<font color=\"blue\">";
s += time2str(msg.timestamp, "%H:%M:%S ").c_str();
+#if QT_VERSION >= 0x050000
+ s += name.toHtmlEscaped();
+#else
s += Qt::escape(name);
+#endif
if (msg.direction == im::MSG_DIR_IN) s += "</font>";
s += "</b>";
@@ -337,7 +341,11 @@ void MessageForm::addMessage(const im::t_msg &msg, const QString &name)
if (msg.format == im::TXT_HTML) {
s += msg.message.c_str();
} else {
+#if QT_VERSION >= 0x050000
+ s += QString::fromStdString(msg.message).toHtmlEscaped();
+#else
s += Qt::escape(msg.message.c_str());
+#endif
}
}
@@ -428,7 +436,11 @@ void MessageForm::displayError(const QString &errorMsg)
s += "<b>";
s += tr("Delivery failure");
s += ": </b>";
+#if QT_VERSION >= 0x050000
+ s += errorMsg.toHtmlEscaped();
+#else
s += Qt::escape(errorMsg);
+#endif
s += "</font>";
conversationBrowser->append(s);
@@ -440,7 +452,11 @@ void MessageForm::displayDeliveryNotification(const QString &notification)
s += "<b>";
s += tr("Delivery notification");
s += ": </b>";
+#if QT_VERSION >= 0x050000
+ s += notification.toHtmlEscaped();
+#else
s += Qt::escape(notification);
+#endif
s += "</font>";
conversationBrowser->append(s);
@@ -454,7 +470,7 @@ void MessageForm::setRemotePartyCaption(void) {
remote_party.display, remote_party.url).c_str());
}
-void MessageForm::showAttachmentPopupMenu(const QString &attachment) {
+void MessageForm::showAttachmentPopupMenu(const QUrl &attachment) {
#ifdef HAVE_KDE
vector<KService::Ptr> *serviceMap = (vector<KService::Ptr> *)_serviceMap;
@@ -471,7 +487,7 @@ void MessageForm::showAttachmentPopupMenu(const QString &attachment) {
// Store attachment. When the user selects an attachment we still
// know which attachment was clicked.
- clickedAttachment = attachment;
+ clickedAttachment = attachment.toLocalFile();
attachmentPopupMenu->clear();