From 1041f340a2ddb634476c5d84585a56c29e5a70fd Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Fri, 3 Feb 2012 23:07:33 +0100 Subject: Show the value "Unknown" for the item-count only after it has been verified During determining the item-count for directories just show an empty string until either the item-count has been calculated or if the item-count is unknown. Thanks to Nikita Skovoroda for the initial proof-of-concept patch. BUG: 291823 FIXED-IN: 4.8.1 --- src/kitemviews/kfileitemlistwidget.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/kitemviews/kfileitemlistwidget.cpp') diff --git a/src/kitemviews/kfileitemlistwidget.cpp b/src/kitemviews/kfileitemlistwidget.cpp index 7e28c5d37..d93e434da 100644 --- a/src/kitemviews/kfileitemlistwidget.cpp +++ b/src/kitemviews/kfileitemlistwidget.cpp @@ -231,11 +231,13 @@ QString KFileItemListWidget::roleText(const QByteArray& role, const QHash(); - text = i18ncp("@item:intable", "%1 item", "%1 items", size); + if (!roleValue.isNull()) { + const int count = roleValue.toInt(); + if (count < 0) { + text = i18nc("@item:intable", "Unknown"); + } else { + text = i18ncp("@item:intable", "%1 item", "%1 items", count); + } } } else { // Show the size in kilobytes (always round up) -- cgit v1.3