summaryrefslogtreecommitdiffstats
path: root/wizardtreemodel.h
blob: 8053f5b25047c67d74771f225cc82b989b1d6fcf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
  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 WIZARDTREEMODEL_H
#define WIZARDTREEMODEL_H

#include "smtreemodel.h"

class WizardTreeModel : public SmTreeModel {
    Q_OBJECT
    public:
        enum CustomRoles { FileNameRole = Qt::UserRole + 1, FileSizeRole = Qt::UserRole + 2, FileTypeRole = Qt::UserRole + 3, FilePartRole = Qt::UserRole + 4, FullPathRole = Qt::UserRole + 5 };
        enum Fields { FileName = 0, FileSize = 1, FileType = 2, FilePart = 3, FullPath = 4 };
        enum { NumFields = 5 };
        enum Types { Movie = 1, FrontCover = 2, BackCover = 3, GeneralCover = 4, Origin = 5 };
        explicit WizardTreeModel(QStringList &headers, QObject *parent = nullptr);

        //data + flags
        virtual QVariant data(const QModelIndex &index, int role) const;
        virtual bool setData(const QModelIndex &index, const QVariant &value, int role);
        virtual Qt::ItemFlags flags(const QModelIndex &index) const;
        QList<QVariant> fileData(const QModelIndex &idx) const;
        void clear();

    private:
        QHash<int, QString> mFiletypeMap;
        QHash<QString, int> mFilePartMap;
};

#endif // WIZARDTREEMODEL_H