summaryrefslogtreecommitdiffstats
path: root/filestreemodel.h
diff options
context:
space:
mode:
Diffstat (limited to 'filestreemodel.h')
-rw-r--r--filestreemodel.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/filestreemodel.h b/filestreemodel.h
index 1e3f40e..b5c11e8 100644
--- a/filestreemodel.h
+++ b/filestreemodel.h
@@ -21,11 +21,13 @@ class FilesTreeModel : public SmTreeModel {
enum CustomRoles { FileNameRole = Qt::UserRole + 1, FullPathRole = Qt::UserRole + 2, SizeRole = Qt::UserRole + 3, DvdNoRole = Qt::UserRole + 4, SizeDisplayRole = Qt::UserRole + 5, FileTypeRole = Qt::UserRole + 6, Md5SumRole = Qt::UserRole + 7, PartNoRole = Qt::UserRole + 8, SeriesPartIdRole = Qt::UserRole + 9, QualityRole = Qt::UserRole + 10, FilesIdRole = Qt::UserRole + 11, SeriesPartRole = Qt::UserRole + 12, DisplayNameRole = Qt::UserRole + 13 };
enum FileTypes { Movie = 1, FrontCover = 2, BackCover = 3, GeneralCover = 4 };
enum Fields { FileName = 0, PartNo = 1, SizeDisplay = 2, Quality = 3, DvdNo = 4, FullPath = 5, Size = 6, FileType = 7, Md5Sum = 8, SeriesPartId = 9, FilesId = 10, SeriesPart = 11, DisplayName = 12 };
+ enum Mode { Archived, Local };
explicit FilesTreeModel(QStringList &headers, QObject *parent = 0);
~FilesTreeModel();
//data + flags
void setIds(const QList<int> &seriesPartIds);
+ void setMode(int mode);
QVariant data(const QModelIndex &index, int role) const;
bool setData(const QModelIndex &index, const QVariant &value, int role);
Qt::ItemFlags flags(const QModelIndex &index) const;
@@ -34,6 +36,7 @@ class FilesTreeModel : public SmTreeModel {
bool addFile(const QString &fullPath, int type, int quality, int filePart, int seriesPartId, int dvd = -1);
private:
+ void populate(QSqlQuery &filesQuery);
QSqlDatabase mDb;
QSqlQuery *mUpdateDvdQuery;
QSqlQuery *mUpdateQualityQuery;