From 78b013b2ac92ccff5589c5abd18b90a5eec28900 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Thu, 2 Sep 2010 12:00:33 +0200 Subject: This commit hopes to definitely fix troubles with HTML encodings. It needs manual testing (waiting for some automatic ones..) I tested it with the following strings: plan b i b kde a & b fix & fit and it seems working well. Let me know if it is really true :) CCBUG: 249736 CCMAIL: pierre.rossi@nokia.com --- src/urlbar/listitem.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/urlbar') diff --git a/src/urlbar/listitem.cpp b/src/urlbar/listitem.cpp index 0df080ae..99b2423d 100644 --- a/src/urlbar/listitem.cpp +++ b/src/urlbar/listitem.cpp @@ -212,12 +212,11 @@ TextLabel::TextLabel(const QString &text, const QString &textToPointOut, QWidget const bool wasItalic = t.startsWith(""); if (wasItalic) t.remove(QRegExp("<[/ib]*>")); + t = Qt::escape(t); - QStringList words = textToPointOut.split(" "); - foreach (const QString &wordToPointOut, words) { - if (!wordToPointOut.isEmpty()) - t.replace(QRegExp('(' + wordToPointOut + ')', Qt::CaseInsensitive), "\\1"); - } + QString ss = Qt::escape(textToPointOut); + t.replace(QRegExp('(' + ss + ')', Qt::CaseInsensitive), "\\1"); + if (wasItalic) t = QL1S("") + t + QL1S(""); @@ -318,7 +317,7 @@ QString SearchListItem::text() QString SearchListItem::searchItemTitle(QString engine, QString text) { - return QString(i18nc("%1=search engine, e.g. Google, Wikipedia %2=text to search for", "Search %1 for %2", engine, Qt::escape(text))); + return QString(i18nc("%1=search engine, e.g. Google, Wikipedia %2=text to search for", "Search %1 for %2", engine, text)); } -- cgit v1.2.1