QTfrontend/model/ThemeModel.cpp
changeset 11758 5c192a4751d8
parent 11046 47a8c19ecb60
child 11759 2e4f0d0fec99
--- a/QTfrontend/model/ThemeModel.cpp	Thu Apr 28 00:41:09 2016 +0200
+++ b/QTfrontend/model/ThemeModel.cpp	Thu Apr 28 02:06:35 2016 +0200
@@ -31,6 +31,21 @@
     m_data = QList<QMap<int, QVariant> >();
 
     m_themesLoaded = false;
+
+    m_filteredNoDLC = NULL;
+}
+
+QSortFilterProxyModel * ThemeModel::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;
 }
 
 int ThemeModel::rowCount(const QModelIndex &parent) const