Commit 739dd45a authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Add proxymodel

parent 9869ba6e
Pipeline #28003 canceled with stage
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
*/ */
#include "folderconfiguresettingswidget.h" #include "folderconfiguresettingswidget.h"
#include "foldersettingfilterproxymodel.h"
#include <KCheckableProxyModel> #include <KCheckableProxyModel>
#include <QHBoxLayout> #include <QHBoxLayout>
#include <MailCommon/FolderTreeWidget> #include <MailCommon/FolderTreeWidget>
...@@ -27,20 +28,32 @@ FolderConfigureSettingsWidget::FolderConfigureSettingsWidget(QWidget *parent) ...@@ -27,20 +28,32 @@ FolderConfigureSettingsWidget::FolderConfigureSettingsWidget(QWidget *parent)
: QWidget(parent) : QWidget(parent)
{ {
QHBoxLayout *mainLayout = new QHBoxLayout(this); QHBoxLayout *mainLayout = new QHBoxLayout(this);
mainLayout->setObjectName(QStringLiteral("mainLayout"));
mainLayout->setContentsMargins(0, 0, 0, 0); mainLayout->setContentsMargins(0, 0, 0, 0);
auto ftw = new MailCommon::FolderTreeWidget(this, nullptr, auto ftw = new MailCommon::FolderTreeWidget(this, nullptr,
MailCommon::FolderTreeWidget::TreeViewOptions(MailCommon::FolderTreeWidget::UseDistinctSelectionModel MailCommon::FolderTreeWidget::TreeViewOptions(MailCommon::FolderTreeWidget::UseDistinctSelectionModel
|MailCommon::FolderTreeWidget::HideStatistics |MailCommon::FolderTreeWidget::HideStatistics
|MailCommon::FolderTreeWidget::HideHeaderViewMenu)); |MailCommon::FolderTreeWidget::HideHeaderViewMenu));
ftw->setObjectName(QStringLiteral("foldertreewidget"));
ftw->folderTreeView()->setDragEnabled(false); ftw->folderTreeView()->setDragEnabled(false);
auto ftv = ftw->folderTreeView(); auto ftv = ftw->folderTreeView();
auto sourceModel = ftv->model(); auto sourceModel = ftv->model();
auto selectionModel = ftw->selectionModel(); auto selectionModel = ftw->selectionModel();
auto checkable = new KCheckableProxyModel(this); auto checkable = new KCheckableProxyModel(this);
checkable->setObjectName(QStringLiteral("checkable"));
checkable->setSourceModel(sourceModel); checkable->setSourceModel(sourceModel);
checkable->setSelectionModel(selectionModel); checkable->setSelectionModel(selectionModel);
auto folderSettingFilterProxyModel = new FolderSettingFilterProxyModel(this);
folderSettingFilterProxyModel->setObjectName(QStringLiteral("folderSettingFilterProxyModel"));
folderSettingFilterProxyModel->setSourceModel(checkable);
ftv->setModel(folderSettingFilterProxyModel);
ftv->expandAll();
mainLayout->addWidget(ftw); mainLayout->addWidget(ftw);
} }
...@@ -48,3 +61,8 @@ FolderConfigureSettingsWidget::~FolderConfigureSettingsWidget() ...@@ -48,3 +61,8 @@ FolderConfigureSettingsWidget::~FolderConfigureSettingsWidget()
{ {
} }
void FolderConfigureSettingsWidget::save()
{
//TODO
}
...@@ -28,6 +28,7 @@ class FolderConfigureSettingsWidget : public QWidget ...@@ -28,6 +28,7 @@ class FolderConfigureSettingsWidget : public QWidget
public: public:
explicit FolderConfigureSettingsWidget(QWidget *parent = nullptr); explicit FolderConfigureSettingsWidget(QWidget *parent = nullptr);
~FolderConfigureSettingsWidget(); ~FolderConfigureSettingsWidget();
void save();
}; };
#endif // FOLDERCONFIGURESETTINGSWIDGET_H #endif // FOLDERCONFIGURESETTINGSWIDGET_H
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment