FolderListModel: use QDateTime for file times
authorAlberto Mardegan <mardy@users.sourceforge.net>
Thu, 27 Dec 2012 10:41:08 +0000 (11:41 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Fri, 1 Feb 2013 09:09:01 +0000 (10:09 +0100)
Make the "fileModified" and "fileAccessed" roles return times as
a QDateTime, and not as an already formatted string.

Change-Id: I1c114477a31e65007ad7bac87b11cb8b0dc7de01
Reviewed-by: Alan Alpert <aalpert@rim.com>
src/imports/folderlistmodel/qquickfolderlistmodel.cpp

index 6cb014a..3e3a824 100644 (file)
@@ -334,10 +334,10 @@ QVariant QQuickFolderListModel::data(const QModelIndex &index, int role) const
             rv = d->data.at(index.row()).size();
             break;
         case FileLastModifiedRole:
-            rv = d->data.at(index.row()).lastModified().date().toString(Qt::ISODate) + " " + d->data.at(index.row()).lastModified().time().toString();
+            rv = d->data.at(index.row()).lastModified();
             break;
         case FileLastReadRole:
-            rv = d->data.at(index.row()).lastRead().date().toString(Qt::ISODate) + " " + d->data.at(index.row()).lastRead().time().toString();
+            rv = d->data.at(index.row()).lastRead();
             break;
         case FileIsDirRole:
             rv = d->data.at(index.row()).isDir();