#include <QAbstractItemView>
#include <QMimeData>
+#if QT_VERSION < 0x050000
#include <QTextDocument> // for Qt::escape()
+#endif
#include "buffermodel.h"
#include "buffersettings.h"
{
Q_UNUSED(column);
+#if QT_VERSION < 0x050000
QStringList toolTip(QString("<b>%1</b>").arg(Qt::escape(networkName())));
toolTip.append(tr("Server: %1").arg(Qt::escape(currentServer())));
+#else
+ QStringList toolTip(QString("<b>%1</b>").arg(networkName().toHtmlEscaped()));
+ toolTip.append(tr("Server: %1").arg(currentServer().toHtmlEscaped()));
+#endif
toolTip.append(tr("Users: %1").arg(nickCount()));
if (_network) {
Q_UNUSED(column);
QStringList toolTip;
+#if QT_VERSION < 0x050000
toolTip.append(tr("<b>Channel %1</b>").arg(Qt::escape(bufferName())));
+#else
+ toolTip.append(tr("<b>Channel %1</b>").arg(bufferName().toHtmlEscaped()));
+#endif
if (isActive()) {
//TODO: add channel modes
toolTip.append(tr("<b>Users:</b> %1").arg(nickCount()));
QString _topic = topic();
if (_topic != "") {
_topic = stripFormatCodes(_topic);
+#if QT_VERSION < 0x050000
_topic = Qt::escape(_topic);
+#else
+ _topic = _topic.toHtmlEscaped();
+#endif
toolTip.append(QString("<font size='-2'> </font>"));
toolTip.append(tr("<b>Topic:</b> %1").arg(_topic));
}
type = "PrivMsgFocused"; break;
}
+#if QT_VERSION < 0x050000
QString message = QString("<b><%1></b> %2").arg(n.sender, Qt::escape(n.message));
+#else
+ QString message = QString("<b><%1></b> %2").arg(n.sender, n.message.toHtmlEscaped());
+#endif
KNotification *notification = KNotification::event(type, message, DesktopIcon("dialog-information"), QtUi::mainWindow(),
KNotification::RaiseWidgetOnActivation
|KNotification::CloseWhenWidgetActivated
QString message = message_;
if (_notificationsClient->isValid()) {
if (_notificationsClientSupportsMarkup)
+#if QT_VERSION < 0x050000
message = Qt::escape(message);
+#else
+ message = message.toHtmlEscaped();
+#endif
QStringList actions;
if (_notificationsClientSupportsActions)
switch (Client::networkModel()->bufferType(id)) {
case BufferInfo::StatusBuffer:
if (network) {
+#if QT_VERSION < 0x050000
newtopic = QString("%1 (%2) | %3 | %4")
.arg(Qt::escape(network->networkName()))
.arg(Qt::escape(network->currentServer()))
.arg(tr("Users: %1").arg(network->ircUsers().count()))
.arg(tr("Lag: %1 msecs").arg(network->latency()));
+#else
+ newtopic = QString("%1 (%2) | %3 | %4")
+ .arg(network->networkName().toHtmlEscaped())
+ .arg(network->currentServer().toHtmlEscaped())
+ .arg(tr("Users: %1").arg(network->ircUsers().count()))
+ .arg(tr("Lag: %1 msecs").arg(network->latency()));
+#endif
}
else {
newtopic = index0.data(Qt::DisplayRole).toString();
QString msg = tr("Do you really want to paste %n line(s)?", "", lines.count());
msg += "<p>";
for (int i = 0; i < 4; i++) {
+#if QT_VERSION < 0x050000
msg += Qt::escape(lines[i].left(40));
+#else
+ msg += lines[i].left(40).toHtmlEscaped();
+#endif
if (lines[i].count() > 40)
msg += "...";
msg += "<br />";
void StyledLabel::updateToolTip()
{
if (frameRect().width() - 2*frameWidth() < _layout.minimumWidth())
+#if QT_VERSION < 0x050000
setToolTip(QString("<qt>%1</qt>").arg(Qt::escape(_layout.text()))); // only rich text gets wordwrapped!
+#else
+ setToolTip(QString("<qt>%1</qt>").arg(_layout.text().toHtmlEscaped())); // only rich text gets wordwrapped!
+#endif
else
setToolTip(QString());
}