QTfrontend/model/ThemeFilterProxyModel.cpp
changeset 13248 b0022324fb4e
parent 13247 4df9d8cedf7f
child 13257 7d7eb27dab31
--- a/QTfrontend/model/ThemeFilterProxyModel.cpp	Sun Mar 18 14:38:48 2018 +0100
+++ b/QTfrontend/model/ThemeFilterProxyModel.cpp	Sun Mar 18 15:24:54 2018 +0100
@@ -28,15 +28,20 @@
     : QSortFilterProxyModel(parent)
 {
     isFilteringDLC = false;
+    isFilteringHidden = false;
 }
 
 bool ThemeFilterProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex & sourceParent) const
 {
-    if(isFilteringDLC)
+    if(isFilteringDLC || isFilteringHidden)
     {
         QModelIndex index = sourceModel()->index(sourceRow, 0, sourceParent);
         bool isDLC = index.data(ThemeModel::IsDlcRole).toBool();
-        return !isDLC;
+        bool isHidden = index.data(ThemeModel::IsHiddenRole).toBool();
+        return (
+            ((isFilteringDLC && !isDLC) || !isFilteringDLC) &&
+            ((isFilteringHidden && !isHidden) || !isFilteringHidden));
+
     }
     else
     {
@@ -49,3 +54,9 @@
     isFilteringDLC = enable;
     invalidateFilter();
 }
+
+void ThemeFilterProxyModel::setFilterHidden(bool enable)
+{
+    isFilteringHidden = enable;
+    invalidateFilter();
+}