]> cloud.milkyroute.net Git - dolphin.git/commitdiff
dolphin: Show full file info in statusbar when only one file is selected
authorFabio D'Urso <fabiodurso@hotmail.it>
Thu, 15 Aug 2013 16:56:48 +0000 (18:56 +0200)
committerFabio D'Urso <fabiodurso@hotmail.it>
Sun, 18 Aug 2013 20:08:28 +0000 (22:08 +0200)
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 "<qt>",
DolphinPart::updateStatusBar() must escape strings. Otherwise,
filenames such as "<qt>Tes<font color=red>t" 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
src/views/dolphinview.cpp

index 81fbacb77519e32bd57a66918ef818060d8c997e..de4c6070d1948c769fe625fe3122eff4ea92743d 100644 (file)
@@ -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("<qt>%1</qt>").arg(escapedText));
 }
 
 void DolphinPart::updateProgress(int percent)
index 375bd3ea208f2b800467079154743419c3c153b8..c1d245301c7f09764e386a21643ccc6ad95f09a2 100644 (file)
@@ -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", "<filename>%1</filename> 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);