equal
deleted
inserted
replaced
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 |
|
32 #include "ThemeFilterProxyModel.h" |
33 #include "DataManager.h" |
33 #include "DataManager.h" |
34 |
34 |
35 /** |
35 /** |
36 * @brief A model listing available themes |
36 * @brief A model listing available themes |
37 */ |
37 */ |
43 enum Roles { ActualNameRole = Qt::UserRole, IsDlcRole, IconPathRole }; |
43 enum Roles { ActualNameRole = Qt::UserRole, IsDlcRole, IconPathRole }; |
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 QSortFilterProxyModel * withoutDLC(); |
48 ThemeFilterProxyModel * withoutDLC(); |
49 |
49 |
50 private: |
50 private: |
51 mutable QList<QMap<int, QVariant> > m_data; |
51 mutable QList<QMap<int, QVariant> > m_data; |
52 mutable bool m_themesLoaded; |
52 mutable bool m_themesLoaded; |
53 mutable QSortFilterProxyModel * m_filteredNoDLC; |
53 mutable ThemeFilterProxyModel * m_filteredNoDLC; |
54 |
54 |
55 void loadThemes() const; |
55 void loadThemes() const; |
56 }; |
56 }; |
57 |
57 |
58 #endif // HEDGEWARS_THEMEMODEL_H |
58 #endif // HEDGEWARS_THEMEMODEL_H |