equal
deleted
inserted
replaced
23 |
23 |
24 #ifndef HEDGEWARS_MAPMODEL_H |
24 #ifndef HEDGEWARS_MAPMODEL_H |
25 #define HEDGEWARS_MAPMODEL_H |
25 #define HEDGEWARS_MAPMODEL_H |
26 |
26 |
27 #include <QStandardItemModel> |
27 #include <QStandardItemModel> |
|
28 #include <QSortFilterProxyModel> |
28 #include <QStringList> |
29 #include <QStringList> |
29 #include <QTextStream> |
30 #include <QTextStream> |
30 #include <QHash> |
31 #include <QHash> |
31 #include <QMap> |
32 #include <QMap> |
32 #include <QIcon> |
33 #include <QIcon> |
103 static MapInfo MapInfoRandom, MapInfoMaze, MapInfoPerlin, MapInfoDrawn, MapInfoForts; |
104 static MapInfo MapInfoRandom, MapInfoMaze, MapInfoPerlin, MapInfoDrawn, MapInfoForts; |
104 |
105 |
105 /// Loads the maps |
106 /// Loads the maps |
106 bool loadMaps(); |
107 bool loadMaps(); |
107 |
108 |
|
109 /// returns this model but excluding DLC themes |
|
110 QSortFilterProxyModel * withoutDLC(); |
108 |
111 |
109 private: |
112 private: |
110 /// map index lookup table. QPair<int, int> contains: <column, index> |
113 /// map index lookup table. QPair<int, int> contains: <column, index> |
111 //QHash<QString, QPair<int, int> > m_mapIndexes; |
114 //QHash<QString, QPair<int, int> > m_mapIndexes; |
112 QHash<QString, int> m_mapIndexes; |
115 QHash<QString, int> m_mapIndexes; |
113 MapType m_maptype; |
116 MapType m_maptype; |
114 bool m_loaded; |
117 bool m_loaded; |
|
118 QSortFilterProxyModel * m_filteredNoDLC; |
115 |
119 |
116 /** |
120 /** |
117 * @brief Creates a QStandardItem, that holds the map info and item appearance. |
121 * @brief Creates a QStandardItem, that holds the map info and item appearance. |
118 * The used role for the data is Qt::UserRole + 1. |
122 * The used role for the data is Qt::UserRole + 1. |
119 * @param icon the icon to be displayed (can be an empty QIcon()). |
123 * @param icon the icon to be displayed (can be an empty QIcon()). |