File indexing completed on 2025-01-05 04:49:51
0001 /* 0002 SPDX-FileCopyrightText: 2017-2024 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #include "selectimaplineeditcompletermodel.h" 0008 #include "selectimapfoldermodel.h" 0009 0010 #include <KDescendantsProxyModel> 0011 #include <QStandardItemModel> 0012 0013 SelectImapLineEditCompleterModel::SelectImapLineEditCompleterModel(const KSieveCore::SieveImapAccountSettings &account, QObject *parent) 0014 : QObject(parent) 0015 , mFlatProxy(new KDescendantsProxyModel(this)) 0016 { 0017 mFlatProxy->setDisplayAncestorData(true); 0018 mFlatProxy->setAncestorSeparator(QStringLiteral("/")); 0019 bool modelIsInitalized = false; 0020 mFlatProxy->setSourceModel(SelectImapFolderModel::self()->folderModel(account, modelIsInitalized)); 0021 } 0022 0023 SelectImapLineEditCompleterModel::~SelectImapLineEditCompleterModel() = default; 0024 0025 QAbstractProxyModel *SelectImapLineEditCompleterModel::completerModel() const 0026 { 0027 return mFlatProxy; 0028 } 0029 0030 #include "moc_selectimaplineeditcompletermodel.cpp"