#include "kfileitemmodel.h"
#include "kitemlistview.h"
-#include <KLocalizedString>
-#include <KIO/MetaData>
-#include <QDateTime>
#include <KFormat>
+#include <KLocalizedString>
+
#include <QMimeDatabase>
-#include <QLocale>
KFileItemListWidgetInformant::KFileItemListWidgetInformant() :
KStandardItemListWidgetInformant()
const KIO::filesize_t size = roleValue.value<KIO::filesize_t>();
text = KFormat().formatByteSize(size);
}
- } else if (role == "date") {
+ } else if (role == "modificationtime" || role == "creationtime" || role == "accesstime") {
+ bool ok;
+ const long long time = roleValue.toLongLong(&ok);
+ if (ok && time != -1) {
+ return QLocale().toString(QDateTime::fromSecsSinceEpoch(time), QLocale::ShortFormat);
+ }
+ } else if (role == "deletiontime" || role == "imageDateTime") {
const QDateTime dateTime = roleValue.toDateTime();
text = QLocale().toString(dateTime, QLocale::ShortFormat);
} else {
bool KFileItemListWidget::isHidden() const
{
- return data().value("text").toString().startsWith(QLatin1Char('.'));
+ return data().value("isHidden").toBool();
}
QFont KFileItemListWidget::customizedFont(const QFont& baseFont) const