┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMéven Car <[email protected]>2020-11-05 08:50:55 +0100
committerMéven Car <[email protected]>2020-11-05 08:50:55 +0100
commit61bf84c13d203840d4ffeb55ce92dc8b660871a1 (patch)
tree7ced2868ab5ca194360d5c3f616cbf1eb80a6dc2
parent6a196bf69d106931777cd372765d3de993d97564 (diff)
Details view: display empty text instead of unknown for sizeless dirs
BUG: 420037 BUG: 420040 FIXED-IN: 20.12
-rw-r--r--src/kitemviews/kfileitemlistwidget.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/kitemviews/kfileitemlistwidget.cpp b/src/kitemviews/kfileitemlistwidget.cpp
index e5b0a4957..69a40ddf3 100644
--- a/src/kitemviews/kfileitemlistwidget.cpp
+++ b/src/kitemviews/kfileitemlistwidget.cpp
@@ -56,17 +56,13 @@ QString KFileItemListWidgetInformant::roleText(const QByteArray& role,
// The item represents a directory.
if (!roleValue.isNull()) {
const int count = values.value("count").toInt();
- if (count < 0) {
- text = i18nc("@item:intable", "Unknown");
- } else {
+ if (count > 0) {
if (DetailsModeSettings::directorySizeCount()) {
// Show the number of sub directories instead of the file size of the directory.
text = i18ncp("@item:intable", "%1 item", "%1 items", count);
} else {
// if we have directory size available
- if (roleValue == -1) {
- text = i18nc("@item:intable", "Unknown");
- } else {
+ if (roleValue != -1) {
const KIO::filesize_t size = roleValue.value<KIO::filesize_t>();
text = KFormat().formatByteSize(size);
}