Commit 21d05cf5 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Prepare create rule

parent e5875665
Pipeline #68061 passed with stage
in 53 minutes and 36 seconds
......@@ -5,6 +5,8 @@ target_sources(kmailconfirmbeforedeleting PRIVATE
confirmbeforedeletingwidget.cpp
confirmbeforedeletingmanager.cpp
confirmbeforedeletingrule.cpp
confirmbeforedeletingcreateruledialog.cpp
confirmbeforedeletingcreateruledialog.h
)
ecm_qt_declare_logging_category(kmailconfirmbeforedeleting HEADER confirmbeforedeletingplugin_debug.h IDENTIFIER KMAIL_CONFIRMBEFOREDELETING_PLUGIN_LOG CATEGORY_NAME org.kde.pim.kmail_confirmbeforedeletingplugin
DESCRIPTION "kdepim-addons (Confirm Before Deleting email)"
......
/*
SPDX-FileCopyrightText: 2021 Laurent Montel <montel@kde.org>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#include "confirmbeforedeletingcreateruledialog.h"
ConfirmBeforeDeletingCreateRuleDialog::ConfirmBeforeDeletingCreateRuleDialog(QWidget *parent)
: QDialog(parent)
{
}
ConfirmBeforeDeletingCreateRuleDialog::~ConfirmBeforeDeletingCreateRuleDialog()
{
}
/*
SPDX-FileCopyrightText: 2021 Laurent Montel <montel@kde.org>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#pragma once
#include "confirmbeforedeleting_private_export.h"
#include <QDialog>
class KMAILCONFIRMBEFOREDELETING_TESTS_EXPORT ConfirmBeforeDeletingCreateRuleDialog : public QDialog
{
Q_OBJECT
public:
explicit ConfirmBeforeDeletingCreateRuleDialog(QWidget *parent = nullptr);
~ConfirmBeforeDeletingCreateRuleDialog() override;
};
/*
SPDX-FileCopyrightText: 2021 Laurent Montel <montel@kde.org>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#include "confirmbeforedeletingcreaterulewidget.h"
ConfirmBeforeDeletingCreateRuleWidget::ConfirmBeforeDeletingCreateRuleWidget(QWidget *parent)
: QWidget(parent)
{
}
ConfirmBeforeDeletingCreateRuleWidget::~ConfirmBeforeDeletingCreateRuleWidget()
{
}
/*
SPDX-FileCopyrightText: 2021 Laurent Montel <montel@kde.org>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#pragma once
#include <QWidget>
#include "confirmbeforedeleting_private_export.h"
class KMAILCONFIRMBEFOREDELETING_TESTS_EXPORT ConfirmBeforeDeletingCreateRuleWidget : public QWidget
{
Q_OBJECT
public:
explicit ConfirmBeforeDeletingCreateRuleWidget(QWidget *parent = nullptr);
~ConfirmBeforeDeletingCreateRuleWidget() override;
};
......@@ -5,7 +5,7 @@
*/
#include "confirmbeforedeletingmanager.h"
#include "confirmbeforedeletingrule.h"
ConfirmBeforeDeletingManager::ConfirmBeforeDeletingManager(QObject *parent)
: QObject(parent)
{
......@@ -28,7 +28,10 @@ void ConfirmBeforeDeletingManager::loadRules()
void ConfirmBeforeDeletingManager::saveRules()
{
// TODO
for (const auto &r : qAsConst(mRules)) {
// TODO
// r.save();
}
}
bool ConfirmBeforeDeletingManager::deletingNeedToConfirm(const Akonadi::Item &item) const
......
......@@ -28,6 +28,9 @@ public:
Q_REQUIRED_RESULT const QString &pattern() const;
void setPattern(const QString &newPattern);
void save();
void load();
// TODO save/Load
Q_REQUIRED_RESULT RuleType ruleType() const;
void setRuleType(RuleType newRuleType);
......
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