File indexing completed on 2024-11-24 04:42:09

0001 // SPDX-FileCopyrightText: 2023 Volker Krause <vkrause@kde.org>
0002 // SPDX-License-Identifier: LGPL-2.0-or-later
0003 
0004 #ifndef MATRIXROOMSSORTPROXYMODEL_H
0005 #define MATRIXROOMSSORTPROXYMODEL_H
0006 
0007 #include <QSortFilterProxyModel>
0008 
0009 /** Sorting proxy for matrix rooms. */
0010 // TODO this probably should have configurable sorting modes (activity, alphabetically, etc)
0011 class MatrixRoomsSortProxyModel :  public QSortFilterProxyModel
0012 {
0013     Q_OBJECT
0014 public:
0015     explicit MatrixRoomsSortProxyModel(QObject *parent = nullptr);
0016     ~MatrixRoomsSortProxyModel();
0017 
0018     void setSourceModel(QAbstractItemModel *sourceModel) override;
0019     bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const override;
0020 };
0021 
0022 #endif // MATRIXROOMSSORTPROXYMODEL_H