File indexing completed on 2024-02-18 15:43:50

0001 /*
0002    SPDX-FileCopyrightText: 2021-2024 Laurent Montel <montel@kde.org>
0003 
0004    SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #include "directoryusersproxymodel.h"
0008 #include "directoryusersmodel.h"
0009 
0010 DirectoryUsersProxyModel::DirectoryUsersProxyModel(QAbstractListModel *model, QObject *parent)
0011     : SearchTreeBaseFilterProxyModel(model, parent)
0012 {
0013 }
0014 
0015 DirectoryUsersProxyModel::~DirectoryUsersProxyModel() = default;
0016 
0017 bool DirectoryUsersProxyModel::lessThan(const QModelIndex &left, const QModelIndex &right) const
0018 {
0019     const int leftColumn{left.column()};
0020     if (leftColumn == DirectoryUsersModel::JoinAt) {
0021         const QModelIndex leftMessageModelIndex = sourceModel()->index(left.row(), DirectoryUsersModel::JoinAtDateTime);
0022         const QModelIndex rightMessageModelIndex = sourceModel()->index(right.row(), DirectoryUsersModel::JoinAtDateTime);
0023         return SearchTreeBaseFilterProxyModel::lessThan(leftMessageModelIndex, rightMessageModelIndex);
0024     }
0025     return SearchTreeBaseFilterProxyModel::lessThan(left, right);
0026 }
0027 
0028 #include "moc_directoryusersproxymodel.cpp"