Move message filtering to C++

The filter callback is called very often (O(messages)). The current
filter model shows some significant overhead in QML internals. Moving
that to C++ makes it quite a bit faster.
This commit is contained in:
Nicolas Fella
2021-02-02 19:49:25 +01:00
parent 92e00587f7
commit 7aedfd0e17
5 changed files with 53 additions and 16 deletions

15
src/messagefiltermodel.h Normal file
View File

@@ -0,0 +1,15 @@
/*
* SPDX-FileCopyrightText: 2021 Nicolas Fella <nicolas.fella@gmx.de>
* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#pragma once
#include <QSortFilterProxyModel>
class MessageFilterModel : public QSortFilterProxyModel
{
Q_OBJECT
public:
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;
};