diff options
| author | Arno <arno@disconnect.de> | 2016-11-06 06:07:07 +0100 |
|---|---|---|
| committer | Arno <arno@disconnect.de> | 2016-11-06 06:07:07 +0100 |
| commit | aea54efd00c1cbd0f66bcda83e9c7a196d3c317b (patch) | |
| tree | 26b3e7586420f5ef490faf60a466a51560446a44 /archivemodel.cpp | |
| parent | 6274b353c2f22703371e4751b6cb7f96a38d94e9 (diff) | |
| download | SheMov-aea54efd00c1cbd0f66bcda83e9c7a196d3c317b.tar.gz SheMov-aea54efd00c1cbd0f66bcda83e9c7a196d3c317b.tar.bz2 SheMov-aea54efd00c1cbd0f66bcda83e9c7a196d3c317b.zip | |
Kinda fix display of metadata
If a seriespart is selected in the tree, display a summary.
When a file is selected, display the actual metadata.
It's much more consistent. Before, the metadata of the first *item in the
selected list was displayed.
Diffstat (limited to 'archivemodel.cpp')
| -rw-r--r-- | archivemodel.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/archivemodel.cpp b/archivemodel.cpp index d08b7ce..cace26b 100644 --- a/archivemodel.cpp +++ b/archivemodel.cpp @@ -776,7 +776,7 @@ const QString ArchiveModel::cacheFile(int o) const{ /* * ArchiveFilesModel BEGIN */ -ArchiveFilesModel::ArchiveFilesModel(const QStringList &headers, QObject *parent) : SmTreeModel(headers, parent) { +ArchiveFilesModel::ArchiveFilesModel(const QStringList &headers, QObject *parent) : SmTreeModel(headers, parent), mTotalSize(0), mTotalDuration(0), mTotalMovies(0), mTotalOthers(0) { mDb = QSqlDatabase::database("treedb"); mRoleDbColumnMap.insert(FilenameRole, "tfilename"); mRoleDbColumnMap.insert(DvdNoRole, "idvd"); @@ -968,6 +968,8 @@ void ArchiveFilesModel::populate(const QSet<int> &seriesPartIds){ QList<QVariant> data; data << QVariant(); //expansion (empty) data << q.value(0) << q.value(1) << q.value(2) << q.value(3) << q.value(4) << q.value(5) << q.value(6) << q.value(7) << q.value(8); + mTotalSize += q.value(3).toULongLong(); + mTotalDuration += q.value(10).toULongLong(); if(!q.value(9).isNull()){ data << q.value(9); }else if(!q.value(10).isNull()){ @@ -986,6 +988,7 @@ void ArchiveFilesModel::populate(const QSet<int> &seriesPartIds){ } data << fullPath << q.value(11) << q.value(12) << q.value(13); if(data.at(FileType).toInt() == FT_MOVIE){ + ++mTotalMovies; SmTreeItem *newItem = new SmTreeItem(data, movies); movies->appendChild(newItem); if((data.at(DvdNo).toInt() < 0) && (data.at(SizeDur) == 0)){ @@ -1001,6 +1004,7 @@ void ArchiveFilesModel::populate(const QSet<int> &seriesPartIds){ } } }else{ + ++mTotalOthers; SmTreeItem *newItem = new SmTreeItem(data, pictures); pictures->appendChild(newItem); } |
