Devtools Improvements
- Now has tabs setup as more features are added - First extra tab has basic server info - Use mobileform to make it look nicer - For the room data tab allow the room to be changed from within devtools - For the room data tab allow m.room.member events to be filtered out so other event types can be found easily - For the room data tab allow viewing room account data network/neochat#557
This commit is contained in:
committed by
Tobias Fella
parent
ca805917de
commit
85b40ca536
44
src/models/statefiltermodel.h
Normal file
44
src/models/statefiltermodel.h
Normal file
@@ -0,0 +1,44 @@
|
||||
// SPDX-FileCopyrightText: 2022 James Graham <james.h.graham@protonmail.com>
|
||||
// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QSortFilterProxyModel>
|
||||
|
||||
/**
|
||||
* @class StateFilterModel
|
||||
*
|
||||
* This class creates a custom QSortFilterProxyModel for filtering a list of state events.
|
||||
* Event types can be filtered out by adding them to m_stateEventTypesFiltered.
|
||||
*/
|
||||
class StateFilterModel : public QSortFilterProxyModel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Custom filter function checking if an event type has been filtered out.
|
||||
*
|
||||
* The filter rejects a row if the state event type has been added to m_stateEventTypesFiltered.
|
||||
*
|
||||
* @sa m_stateEventTypesFiltered
|
||||
*/
|
||||
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;
|
||||
|
||||
/**
|
||||
* @brief Add an event type to m_stateEventTypesFiltered.
|
||||
*
|
||||
* @sa m_stateEventTypesFiltered
|
||||
*/
|
||||
Q_INVOKABLE void addStateEventTypeFiltered(const QString &stateEventType);
|
||||
|
||||
/**
|
||||
* @brief Remove an event type from m_stateEventTypesFiltered.
|
||||
*
|
||||
* @sa m_stateEventTypesFiltered
|
||||
*/
|
||||
Q_INVOKABLE void removeStateEventTypeFiltered(const QString &stateEventType);
|
||||
|
||||
private:
|
||||
QStringList m_stateEventTypesFiltered;
|
||||
};
|
||||
Reference in New Issue
Block a user