]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/kfileitemlistwidget.cpp
Merge branch 'release/20.12'
[dolphin.git] / src / kitemviews / kfileitemlistwidget.cpp
index e5b0a4957fafdb25b33eb616ac3e45a46e29503b..69a40ddf3641d8626e498c504fc7ea334fbcae37 100644 (file)
@@ -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);
                         }