From: Marcus Eggenberger Date: Sun, 26 Jul 2009 16:08:39 +0000 (+0200) Subject: Fixes #741 - HTML escape characters in tooltips. X-Git-Tag: 0.4.3~4 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=2ec6f7e47994028d7eab9a3d2b83dc798fec55fb Fixes #741 - HTML escape characters in tooltips. Thanks to lastic for suplying the patch! --- diff --git a/src/client/networkmodel.cpp b/src/client/networkmodel.cpp index 23ab2616..0ca78114 100644 --- a/src/client/networkmodel.cpp +++ b/src/client/networkmodel.cpp @@ -21,6 +21,7 @@ #include "networkmodel.h" #include +#include // for Qt::escape() #include "buffermodel.h" #include "client.h" @@ -191,8 +192,8 @@ void NetworkItem::setCurrentServer(const QString &serverName) { QString NetworkItem::toolTip(int column) const { Q_UNUSED(column); - QStringList toolTip(QString("%1").arg(networkName())); - toolTip.append(tr("Server: %1").arg(currentServer())); + QStringList toolTip(QString("%1").arg(Qt::escape(networkName()))); + toolTip.append(tr("Server: %1").arg(Qt::escape(currentServer()))); toolTip.append(tr("Users: %1").arg(nickCount())); if(_network) { @@ -468,7 +469,7 @@ QString ChannelBufferItem::toolTip(int column) const { Q_UNUSED(column); QStringList toolTip; - toolTip.append(tr("Channel %1").arg(bufferName())); + toolTip.append(tr("Channel %1").arg(Qt::escape(bufferName()))); if(isActive()) { //TODO: add channel modes toolTip.append(tr("Users: %1").arg(nickCount())); @@ -484,8 +485,7 @@ QString ChannelBufferItem::toolTip(int column) const { QString _topic = topic(); if(_topic != "") { _topic = stripFormatCodes(_topic); - _topic.replace(QString("<"), QString("<")); - _topic.replace(QString(">"), QString(">")); + _topic = Qt::escape(_topic); toolTip.append(QString(" ")); toolTip.append(tr("Topic: %1").arg(_topic)); }