From: Fabio D'Urso Date: Thu, 1 Aug 2013 12:17:26 +0000 (+0200) Subject: dolphin: Escape text in statusbar tooltip X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/87f830302347e9773404f51de73afc7041829374?hp=-c dolphin: Escape text in statusbar tooltip This fixes the same issue as 4450f8449af91e491636728a4669e2a9e27b49fa, but for the status bar's tooltip text. BUG: 323170 FIXED-IN: 4.11.0 REVIEW: 111836 --- 87f830302347e9773404f51de73afc7041829374 diff --git a/src/statusbar/dolphinstatusbar.cpp b/src/statusbar/dolphinstatusbar.cpp index 148919172..bff956642 100644 --- a/src/statusbar/dolphinstatusbar.cpp +++ b/src/statusbar/dolphinstatusbar.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -324,10 +325,17 @@ void DolphinStatusBar::updateLabelText() { const QString text = m_text.isEmpty() ? m_defaultText : m_text; + // Set status bar text and elide it if too long QFontMetrics fontMetrics(m_label->font()); const QString elidedText = fontMetrics.elidedText(text, Qt::ElideRight, m_label->width()); m_label->setText(elidedText); - m_label->setToolTip(text == elidedText ? QString() : text); + + // If the text has been elided, set the original text as tooltip + if (text != elidedText) { + m_label->setToolTip(Qt::convertFromPlainText(text)); + } else { + m_label->setToolTip(QString()); + } } void DolphinStatusBar::slotResetToDefaultText()