diff options
| author | Peter Penz <[email protected]> | 2008-11-13 21:01:24 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2008-11-13 21:01:24 +0000 |
| commit | f5dafdc48add734a3d3399d987556de2164d0a96 (patch) | |
| tree | 1b06e1759997d76554351660a98f8916e968db0f /src | |
| parent | 040bdcea237e2576aad744bc4e7b5cadedcc98dc (diff) | |
When only one item is selected, show the item name in the statusbar instead of "1 Folder selected" or "1 File selected". This is useful in combination with the keyboard navigation.
BUG: 172564
svn path=/trunk/KDE/kdebase/apps/; revision=883928
Diffstat (limited to 'src')
| -rw-r--r-- | src/dolphinview.cpp | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp index aec798d31..31b9de785 100644 --- a/src/dolphinview.cpp +++ b/src/dolphinview.cpp @@ -534,16 +534,25 @@ QString DolphinView::statusBarText() const ++it; } - const QString foldersText = i18ncp("@info:status", "1 Folder selected", "%1 Folders selected", folderCount); - const QString filesText = i18ncp("@info:status", "1 File selected", "%1 Files selected", fileCount); - if ((folderCount > 0) && (fileCount > 0)) { - text = i18nc("@info:status folders, files (size)", "%1, %2 (%3)", - foldersText, filesText, KIO::convertSize(totalFileSize)); - } else if (fileCount > 0) { - text = i18nc("@info:status files (size)", "%1 (%2)", filesText, KIO::convertSize(totalFileSize)); + if (folderCount + fileCount == 1) { + // if only one item is selected, show the filename + const QString name = list.first().name(); + text = (folderCount == 1) ? i18nc("@info:status", "<filename>%1</filename> selected", name) : + i18nc("@info:status", "<filename>%1</filename> selected (%2)", + name, KIO::convertSize(totalFileSize)); } else { - Q_ASSERT(folderCount > 0); - text = foldersText; + // at least 2 items are selected + const QString foldersText = i18ncp("@info:status", "1 Folder selected", "%1 Folders selected", folderCount); + const QString filesText = i18ncp("@info:status", "1 File selected", "%1 Files selected", fileCount); + if ((folderCount > 0) && (fileCount > 0)) { + text = i18nc("@info:status folders, files (size)", "%1, %2 (%3)", + foldersText, filesText, KIO::convertSize(totalFileSize)); + } else if (fileCount > 0) { + text = i18nc("@info:status files (size)", "%1 (%2)", filesText, KIO::convertSize(totalFileSize)); + } else { + Q_ASSERT(folderCount > 0); + text = foldersText; + } } } else { calculateItemCount(fileCount, folderCount, totalFileSize); |
