summaryrefslogtreecommitdiffstats
blob: b8cf15a7ccdf6fd34847ca98db1de501873c7f32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
 * Copyright (c) 2016 Isode Limited.
 * All rights reserved.
 * See the COPYING file for more information.
 */

#include <Swift/QtUI/MUCSearch/QtLeafSortFilterProxyModel.h>

namespace Swift {

QtLeafSortFilterProxyModel::QtLeafSortFilterProxyModel(QObject* parent) : QSortFilterProxyModel(parent) {

}

QtLeafSortFilterProxyModel::~QtLeafSortFilterProxyModel() {

}

bool QtLeafSortFilterProxyModel::filterAcceptsRow(int source_row, const QModelIndex& source_parent) const {
    if (!sourceModel()->hasChildren(sourceModel()->index(source_row, 0, source_parent))) {
        return QSortFilterProxyModel::filterAcceptsRow(source_row, source_parent);
    }
    else {
        return true;
    }
}

}