diff options
author | Arno <am@disconnect.de> | 2013-03-22 09:18:52 +0100 |
---|---|---|
committer | Arno <am@disconnect.de> | 2013-03-22 09:18:52 +0100 |
commit | 153683e2e961b13c5e97e582563656851bce377c (patch) | |
tree | 5efd902813f059dfb76548f96e77558c58930d98 /smdirmodel.cpp | |
parent | 50b34092a45990000ba73409abd75377816b70e6 (diff) | |
download | SheMov-153683e2e961b13c5e97e582563656851bce377c.tar.gz SheMov-153683e2e961b13c5e97e582563656851bce377c.tar.bz2 SheMov-153683e2e961b13c5e97e582563656851bce377c.zip |
Show duration in statusBar
Show total duration of selected Movies in FileView. Created a new class
Helper::Duration for this and declared it as QMetaType.
Diffstat (limited to 'smdirmodel.cpp')
-rw-r--r-- | smdirmodel.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/smdirmodel.cpp b/smdirmodel.cpp index ea44ccd..00857ab 100644 --- a/smdirmodel.cpp +++ b/smdirmodel.cpp @@ -69,6 +69,16 @@ QVariant SmDirModel::data(const QModelIndex &index, int role) const{ return mIcons.value(mime.at(0).toLower()); } } + case Qt::DisplayRole: { + if(index.column() == Duration){ + Helper::Duration d = i->data(Duration).value<Helper::Duration>(); + if(d.isNull()){ + return QVariant(); + } + return d.toString(); + } + } + default: return SmTreeModel::data(index, role); } |