From 7048a0ac084e35947eca7cb684dd4ade15de90ca Mon Sep 17 00:00:00 2001 From: miruka Date: Sun, 10 May 2020 15:00:09 -0400 Subject: [PATCH] Remove now unused HFilterModel --- src/gui/Base/HFilterModel.qml | 50 ----------------------------------- 1 file changed, 50 deletions(-) delete mode 100644 src/gui/Base/HFilterModel.qml diff --git a/src/gui/Base/HFilterModel.qml b/src/gui/Base/HFilterModel.qml deleted file mode 100644 index cc81bb0f..00000000 --- a/src/gui/Base/HFilterModel.qml +++ /dev/null @@ -1,50 +0,0 @@ -// SPDX-License-Identifier: LGPL-3.0-or-later - -import QtQuick 2.12 -import QtQml.Models 2.12 - -DelegateModel { - filterOnGroup: "filtered" - - groups: DelegateModelGroup { - id: filtered - name: "filtered" - includeByDefault: false - } - - onAcceptItemChanged: refilterAll() - - items.onChanged: { - for (let i = 0; i < inserted.length; i++) - for (let offset = 0; offset <= inserted[i].count - 1; offset++) - refilterAt(inserted[i].index + offset) - } - - - property var acceptItem: item => true - readonly property alias filtered: filtered - - - function refilterAt(index) { - const item = items.get(index) - item.inFiltered = acceptItem(item.model) - } - - function refilterAll() { - for (let i = 0; i < items.count; i++) refilterAt(i) - } - - function filteredFindIndex(id, default_=null) { - for (let i = 0; i < filtered.count; i++) - if (filtered.get(i).id === id) return i - - return default_ - } - - function filteredFind(id, default_=null) { - for (let i = 0; i < filtered.count; i++) - if (filtered.get(i).id === id) return get(i) - - return default_ - } -}