File indexing completed on 2024-02-25 16:44:36

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 "directoryteamsproxymodel.h"
0008 #include "directoryteamsmodel.h"
0009 
0010 DirectoryTeamsProxyModel::DirectoryTeamsProxyModel(QAbstractListModel *model, QObject *parent)
0011     : SearchTreeBaseFilterProxyModel(model, parent)
0012 {
0013 }
0014 
0015 DirectoryTeamsProxyModel::~DirectoryTeamsProxyModel() = default;
0016 
0017 bool DirectoryTeamsProxyModel::lessThan(const QModelIndex &left, const QModelIndex &right) const
0018 {
0019     const int leftColumn{left.column()};
0020     if (leftColumn == DirectoryTeamsModel::CreateTeam) {
0021         const QModelIndex leftMessageModelIndex = sourceModel()->index(left.row(), DirectoryTeamsModel::CreateTeamDateTime);
0022         const QModelIndex rightMessageModelIndex = sourceModel()->index(right.row(), DirectoryTeamsModel::CreateTeamDateTime);
0023         return SearchTreeBaseFilterProxyModel::lessThan(leftMessageModelIndex, rightMessageModelIndex);
0024     }
0025     return SearchTreeBaseFilterProxyModel::lessThan(left, right);
0026 }
0027 
0028 #include "moc_directoryteamsproxymodel.cpp"