if (values.value("isDir").toBool()) {
// The item represents a directory. Show the number of sub directories
// instead of the file size of the directory.
- if (roleValue.isNull()) {
- text = i18nc("@item:intable", "Unknown");
- } else {
- const KIO::filesize_t size = roleValue.value<KIO::filesize_t>();
- 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)