QTfrontend/model/ThemeModel.h
changeset 11754 2e4f0d0fec99
parent 11753 5c192a4751d8
child 11757 6874644a2d00
equal deleted inserted replaced
11753:5c192a4751d8 11754:2e4f0d0fec99
    23 
    23 
    24 #ifndef HEDGEWARS_THEMEMODEL_H
    24 #ifndef HEDGEWARS_THEMEMODEL_H
    25 #define HEDGEWARS_THEMEMODEL_H
    25 #define HEDGEWARS_THEMEMODEL_H
    26 
    26 
    27 #include <QAbstractListModel>
    27 #include <QAbstractListModel>
    28 #include <QSortFilterProxyModel>
       
    29 #include <QStringList>
    28 #include <QStringList>
    30 #include <QMap>
    29 #include <QMap>
    31 #include <QIcon>
    30 #include <QIcon>
    32 
    31 
    33 #include "DataManager.h"
    32 #include "DataManager.h"
    43         enum Roles { ActualNameRole = Qt::UserRole, IsDlcRole, IconPathRole };
    42         enum Roles { ActualNameRole = Qt::UserRole, IsDlcRole, IconPathRole };
    44         explicit ThemeModel(QObject *parent = 0);
    43         explicit ThemeModel(QObject *parent = 0);
    45 
    44 
    46         int rowCount(const QModelIndex &parent = QModelIndex()) const;
    45         int rowCount(const QModelIndex &parent = QModelIndex()) const;
    47         QVariant data(const QModelIndex &index, int role) const;
    46         QVariant data(const QModelIndex &index, int role) const;
    48         QSortFilterProxyModel * withoutDLC();
       
    49 
    47 
    50     private:
    48     private:
    51         mutable QList<QMap<int, QVariant> > m_data;
    49         mutable QList<QMap<int, QVariant> > m_data;
    52         mutable bool m_themesLoaded;
    50         mutable bool m_themesLoaded;
    53         mutable QSortFilterProxyModel * m_filteredNoDLC;
       
    54 
    51 
    55         void loadThemes() const;
    52         void loadThemes() const;
    56 };
    53 };
    57 
    54 
    58 #endif // HEDGEWARS_THEMEMODEL_H
    55 #endif // HEDGEWARS_THEMEMODEL_H