diff options
| author | Frank Reininghaus <[email protected]> | 2013-08-08 23:39:28 +0200 |
|---|---|---|
| committer | Frank Reininghaus <[email protected]> | 2013-08-08 23:39:28 +0200 |
| commit | 68520f55f0b6b2fc450f646477bf3c535324aa2b (patch) | |
| tree | 8ae84ca215bf6663ec13221039ad84ca6752bd0e | |
| parent | 6524bf701a04e09ce31a7793ccccbedefc11e514 (diff) | |
| parent | 87f830302347e9773404f51de73afc7041829374 (diff) | |
Merge remote-tracking branch 'origin/KDE/4.11'
| -rw-r--r-- | src/dolphinpart.cpp | 2 | ||||
| -rw-r--r-- | src/statusbar/dolphinstatusbar.cpp | 10 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/dolphinpart.cpp b/src/dolphinpart.cpp index fc7b74dc0..81fbacb77 100644 --- a/src/dolphinpart.cpp +++ b/src/dolphinpart.cpp @@ -356,7 +356,7 @@ void DolphinPart::slotRequestItemInfo(const KFileItem& item) if (item.isNull()) { updateStatusBar(); } else { - const QString escapedText = Qt::escape(item.getStatusBarInfo()); + const QString escapedText = Qt::convertFromPlainText(item.getStatusBarInfo()); ReadOnlyPart::setStatusBarText(QString("<qt>%1</qt>").arg(escapedText)); } } 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 <QHBoxLayout> #include <QLabel> #include <QProgressBar> +#include <QTextDocument> #include <QToolButton> #include <QTime> #include <QTimer> @@ -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() |
