From bfb10355c9d9be2224057c402e04c9c4e58a9995 Mon Sep 17 00:00:00 2001 From: Fabio D'Urso Date: Thu, 15 Aug 2013 18:56:48 +0200 Subject: [PATCH] dolphin: Show full file info in statusbar when only one file is selected The purpose of this change is to give the user a chance to see hover file information if it doesn't fit in the status bar, by allowing to click on the file and hover on the status bar. As it's now possible to have status bar texts starting with "", DolphinPart::updateStatusBar() must escape strings. Otherwise, filenames such as "Test" would be rendered as HTML data in konqueror's status bar when selected. BUG: 260717 FIXED-IN: 4.12.0 REVIEW: 111934 --- src/dolphinpart.cpp | 3 ++- src/views/dolphinview.cpp | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/dolphinpart.cpp b/src/dolphinpart.cpp index 81fbacb77..de4c6070d 100644 --- a/src/dolphinpart.cpp +++ b/src/dolphinpart.cpp @@ -572,7 +572,8 @@ void DolphinPart::updateNewMenu() void DolphinPart::updateStatusBar() { - emit ReadOnlyPart::setStatusBarText(m_view->statusBarText()); + const QString escapedText = Qt::convertFromPlainText(m_view->statusBarText()); + emit ReadOnlyPart::setStatusBarText(QString("%1").arg(escapedText)); } void DolphinPart::updateProgress(int percent) diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index 375bd3ea2..c1d245301 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -556,8 +556,8 @@ QString DolphinView::statusBarText() const } if (folderCount + fileCount == 1) { - // If only one item is selected, show the filename - filesText = i18nc("@info:status", "%1 selected", list.first().text()); + // If only one item is selected, show info about it + return list.first().getStatusBarInfo(); } else { // At least 2 items are selected foldersText = i18ncp("@info:status", "1 Folder selected", "%1 Folders selected", folderCount); -- 2.47.3