diff options
author | Arno <am@disconnect.de> | 2013-04-06 06:12:00 +0200 |
---|---|---|
committer | Arno <am@disconnect.de> | 2013-04-06 06:12:00 +0200 |
commit | 511d1f9cd61586336014c55e32f67872e5e4ee10 (patch) | |
tree | 1b1b7b15b5aedbcb97438e872eb813b1186455a1 /smdirwatcher.cpp | |
parent | 17a14b44b97af461eef2ec4f7da8f762588f1d32 (diff) | |
download | SheMov-511d1f9cd61586336014c55e32f67872e5e4ee10.tar.gz SheMov-511d1f9cd61586336014c55e32f67872e5e4ee10.tar.bz2 SheMov-511d1f9cd61586336014c55e32f67872e5e4ee10.zip |
Put duration and size in one Field (SmDirModel)
Consolidate duration and size in one Field, like in the archive, to be
consistent. Also rename the Role and Field accordingly.
Diffstat (limited to 'smdirwatcher.cpp')
-rw-r--r-- | smdirwatcher.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/smdirwatcher.cpp b/smdirwatcher.cpp index eaff3b3..2db94d9 100644 --- a/smdirwatcher.cpp +++ b/smdirwatcher.cpp @@ -144,13 +144,11 @@ const QList<QVariant> SmDataColletor::fileData(const QFileInfo &fi) const{ QList<QVariant> si = QList<QVariant>() << QVariant() << QVariant(); if(mime.startsWith("video")){ si = Helper::duration(fi.absoluteFilePath()); + }else if(mime.startsWith("image")){ + QImage img(fi.absoluteFilePath()); + si[0] = img.size(); } data << Helper::md5Sum(fi.absoluteFilePath()); data << si << fi.absoluteFilePath(); - if(mime.startsWith("image")){ - data << QImage(fi.absoluteFilePath()).size(); - }else{ - data << QVariant(); - } return data; } |