diff options
| author | Peter Penz <[email protected]> | 2008-11-05 19:15:31 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2008-11-05 19:15:31 +0000 |
| commit | f2aae09edd023bb0bb4e56e6662bc0afc9550e54 (patch) | |
| tree | faefef0de6cd25a30dcfd0dae42d8900b8efb9d6 /src/dolphinview.cpp | |
| parent | d6dec597c00384089665e35eaca95e96c830cd29 (diff) | |
* use KIO::itemsSummaryString() again
* assure that the strings for selections can be translated in a correct manner
svn path=/trunk/KDE/kdebase/apps/; revision=880527
Diffstat (limited to 'src/dolphinview.cpp')
| -rw-r--r-- | src/dolphinview.cpp | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp index f381bf073..b74cbea53 100644 --- a/src/dolphinview.cpp +++ b/src/dolphinview.cpp @@ -529,25 +529,24 @@ 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)); + } else { + Q_ASSERT(folderCount > 0); + text = foldersText; + } } else { calculateItemCount(fileCount, folderCount, totalFileSize); + text = KIO::itemsSummaryString(fileCount + folderCount, + fileCount, folderCount, + totalFileSize, true); } - - if (folderCount > 0) { - text = hasSelection() ? - i18ncp("@info:status", "1 Folder selected", "%1 Folders selected", folderCount) : - i18ncp("@info:status", "1 Folder", "%1 Folders", folderCount); - if (fileCount > 0) { - text += i18nc("@info:status separator between 2 status infos", ", "); - } - } - - if (fileCount > 0) { - const QString sizeText = KIO::convertSize(totalFileSize); - text += hasSelection() ? - i18ncp("@info:status", "1 File selected (%2)", "%1 Files selected (%2)", fileCount, sizeText) : - i18ncp("@info:status", "1 File (%2)", "%1 Files (%2)", fileCount, sizeText); - } return text; } |
