From 4450f8449af91e491636728a4669e2a9e27b49fa Mon Sep 17 00:00:00 2001 From: Fabio D'Urso Date: Mon, 1 Jul 2013 02:02:21 +0200 Subject: [PATCH] Don't let HTML-like filenames be interpreted as HTML strings So that filenames that look like HTML don't get fancy-formatted when we show info about them (i.e. on hover) This patch fixes the same issue in two places: - dolphin, by setting Qt::PlainText on the status bar's label - konqueror, by escaping setStatusBarText strings emitted by DolphinPart BUG: 321778 FIXED-IN: 4.11.0 REVIEW: 111746 --- dolphin/src/dolphinpart.cpp | 4 +++- dolphin/src/statusbar/dolphinstatusbar.cpp | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/dolphin/src/dolphinpart.cpp b/dolphin/src/dolphinpart.cpp index e8138eb8e9..fc7b74dc0c 100644 --- a/dolphin/src/dolphinpart.cpp +++ b/dolphin/src/dolphinpart.cpp @@ -58,6 +58,7 @@ #include #include #include +#include K_PLUGIN_FACTORY(DolphinPartFactory, registerPlugin();) K_EXPORT_PLUGIN(DolphinPartFactory("dolphinpart", "dolphin")) @@ -355,7 +356,8 @@ void DolphinPart::slotRequestItemInfo(const KFileItem& item) if (item.isNull()) { updateStatusBar(); } else { - ReadOnlyPart::setStatusBarText(item.getStatusBarInfo()); + const QString escapedText = Qt::escape(item.getStatusBarInfo()); + ReadOnlyPart::setStatusBarText(QString("%1").arg(escapedText)); } } diff --git a/dolphin/src/statusbar/dolphinstatusbar.cpp b/dolphin/src/statusbar/dolphinstatusbar.cpp index 6f734ed4d5..1489191720 100644 --- a/dolphin/src/statusbar/dolphinstatusbar.cpp +++ b/dolphin/src/statusbar/dolphinstatusbar.cpp @@ -62,6 +62,7 @@ DolphinStatusBar::DolphinStatusBar(QWidget* parent) : // Initialize text label m_label = new QLabel(this); m_label->setWordWrap(true); + m_label->setTextFormat(Qt::PlainText); m_label->installEventFilter(this); // Initialize zoom widget