diff options
author | Arno <am@disconnect.de> | 2014-02-06 18:53:53 +0100 |
---|---|---|
committer | Arno <am@disconnect.de> | 2014-02-06 18:53:53 +0100 |
commit | e0b8f04b18ababa819e2e0f019c76dcca971b51a (patch) | |
tree | 58a1b0143fc6f06111cf21717fa9b43f932114cd /archivebrowsermodel.h | |
parent | e07de4e0a1bd56aab8f4ee81d6db252e442c3d7a (diff) | |
download | SheMov-e0b8f04b18ababa819e2e0f019c76dcca971b51a.tar.gz SheMov-e0b8f04b18ababa819e2e0f019c76dcca971b51a.tar.bz2 SheMov-e0b8f04b18ababa819e2e0f019c76dcca971b51a.zip |
First version of Archive Browser
First try to reimplement "Move to archive" in another way.
Implement an archive browser showing only Series with local parts in
another tab. This part works for now :)
Diffstat (limited to 'archivebrowsermodel.h')
-rw-r--r-- | archivebrowsermodel.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/archivebrowsermodel.h b/archivebrowsermodel.h new file mode 100644 index 0000000..3b7fc14 --- /dev/null +++ b/archivebrowsermodel.h @@ -0,0 +1,31 @@ +/* + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version + 2 of the License, or (at your option) any later version. +*/ + +#ifndef ARCHIVEBROWSERMODEL_H +#define ARCHIVEBROWSERMODEL_H + +#include <QSqlDatabase> + +#include "smtreemodel.h" + +class ArchiveBrowserModel : public SmTreeModel { + Q_OBJECT + public: + enum CustomRoles { NameRole = Qt::UserRole + 1, GenericIdRole = Qt::UserRole + 2, NodeTypeRole = Qt::UserRole + 3, TotalSizeRole = Qt::UserRole + 4, QualityRole = 5, FileTypeRole = Qt::UserRole + 6, FullPathRole = Qt::UserRole + 7 }; + enum Fields { Name = 0, GenericId = 1, NodeType = 2, TotalSize = 3, Quality = 4, FileType = 5, FullPath = 6 }; + enum NodeTypes { SeriesPartNode = 1, FileNode = 2 }; + explicit ArchiveBrowserModel(const QStringList &headers, QObject *parent = 0); + virtual QVariant data(const QModelIndex &index, int role) const; + virtual Qt::ItemFlags flags(const QModelIndex &index) const; + + private: + void populate(); + int mNumFields; + QSqlDatabase mDb; +}; + +#endif // ARCHIVEBROWSERMODEL_H |