QTfrontend/model/ThemeModel.h
changeset 13248 b0022324fb4e
parent 13247 4df9d8cedf7f
child 13267 48b23e6f26d9
equal deleted inserted replaced
13247:4df9d8cedf7f 13248:b0022324fb4e
    38 class ThemeModel : public QAbstractListModel
    38 class ThemeModel : public QAbstractListModel
    39 {
    39 {
    40         Q_OBJECT
    40         Q_OBJECT
    41 
    41 
    42     public:
    42     public:
    43         enum Roles { ActualNameRole = Qt::UserRole, IsDlcRole, IconPathRole };
    43         enum Roles { ActualNameRole = Qt::UserRole, IsDlcRole, IconPathRole, IsHiddenRole };
    44         explicit ThemeModel(QObject *parent = 0);
    44         explicit ThemeModel(QObject *parent = 0);
    45 
    45 
    46         int rowCount(const QModelIndex &parent = QModelIndex()) const;
    46         int rowCount(const QModelIndex &parent = QModelIndex()) const;
    47         QVariant data(const QModelIndex &index, int role) const;
    47         QVariant data(const QModelIndex &index, int role) const;
    48         ThemeFilterProxyModel * withoutDLC();
    48         ThemeFilterProxyModel * withoutDLC();
       
    49         ThemeFilterProxyModel * withoutHidden();
       
    50         ThemeFilterProxyModel * withoutDLCOrHidden();
    49 
    51 
    50     private:
    52     private:
    51         mutable QList<QMap<int, QVariant> > m_data;
    53         mutable QList<QMap<int, QVariant> > m_data;
    52         mutable bool m_themesLoaded;
    54         mutable bool m_themesLoaded;
    53         mutable ThemeFilterProxyModel * m_filteredNoDLC;
    55         mutable ThemeFilterProxyModel * m_filteredNoDLC;
       
    56         mutable ThemeFilterProxyModel * m_filteredNoHidden;
       
    57         mutable ThemeFilterProxyModel * m_filteredNoDLCOrHidden;
    54 
    58 
    55         void loadThemes() const;
    59         void loadThemes() const;
    56 };
    60 };
    57 
    61 
    58 #endif // HEDGEWARS_THEMEMODEL_H
    62 #endif // HEDGEWARS_THEMEMODEL_H