selectimaplineeditcompletermodel.cpp 907 Bytes
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1
/*
2
   SPDX-FileCopyrightText: 2017-2020 Laurent Montel <montel@kde.org>
Laurent Montel's avatar
Laurent Montel committed
3

4
   SPDX-License-Identifier: GPL-2.0-or-later
Laurent Montel's avatar
Laurent Montel committed
5
6
7
8
9
10
11
12
13
14
*/

#include "selectimaplineeditcompletermodel.h"
#include "selectimapfoldermodel.h"

#include <QStandardItemModel>
#include <KDescendantsProxyModel>

SelectImapLineEditCompleterModel::SelectImapLineEditCompleterModel(const KSieveUi::SieveImapAccountSettings &account, QObject *parent)
    : QObject(parent)
15
    , mFlatProxy(new KDescendantsProxyModel(this))
Laurent Montel's avatar
Laurent Montel committed
16
17
18
{
    mFlatProxy->setDisplayAncestorData(true);
    mFlatProxy->setAncestorSeparator(QStringLiteral("/"));
Laurent Montel's avatar
Laurent Montel committed
19
20
    bool modelIsInitalized = false;
    mFlatProxy->setSourceModel(SelectImapFolderModel::self()->folderModel(account, modelIsInitalized));
Laurent Montel's avatar
Laurent Montel committed
21
22
23
24
25
26
27
28
29
30
}

SelectImapLineEditCompleterModel::~SelectImapLineEditCompleterModel()
{
}

QAbstractProxyModel *SelectImapLineEditCompleterModel::completerModel() const
{
    return mFlatProxy;
}