QTfrontend/model/MapModel.cpp
changeset 11762 6874644a2d00
parent 11749 ac58a063d26a
child 11904 0b6baf802b3d
--- a/QTfrontend/model/MapModel.cpp	Thu Apr 28 17:42:43 2016 +0200
+++ b/QTfrontend/model/MapModel.cpp	Thu Apr 28 18:32:50 2016 +0200
@@ -38,6 +38,20 @@
 {
     m_maptype = maptype;
     m_loaded = false;
+    m_filteredNoDLC = NULL;
+}
+
+QSortFilterProxyModel * MapModel::withoutDLC()
+{
+    if (m_filteredNoDLC == NULL)
+    {
+        m_filteredNoDLC = new QSortFilterProxyModel(this);
+        m_filteredNoDLC->setSourceModel(this);
+        // filtering based on IsDlcRole would be nicer
+        // but seems this model can only do string-based filtering :|
+        m_filteredNoDLC->setFilterRegExp(QRegExp("^[^*]"));
+    }
+    return m_filteredNoDLC;
 }
 
 bool MapModel::loadMaps()