Commit b3581b07 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Start to implement rules

parent 8eb7526f
......@@ -27,11 +27,11 @@ ConfirmBeforeDeletingDialog::ConfirmBeforeDeletingDialog(QWidget *parent)
mConfirmBeforeDeletingWidget->setObjectName(QStringLiteral("mConfirmBeforeDeletingWidget"));
mainLayout->addWidget(mConfirmBeforeDeletingWidget);
auto box = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
box->setObjectName(QStringLiteral("box"));
mainLayout->addWidget(box);
connect(box, &QDialogButtonBox::accepted, this, &ConfirmBeforeDeletingDialog::accept);
connect(box, &QDialogButtonBox::rejected, this, &ConfirmBeforeDeletingDialog::reject);
auto buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
buttonBox->setObjectName(QStringLiteral("buttonBox"));
mainLayout->addWidget(buttonBox);
connect(buttonBox, &QDialogButtonBox::accepted, this, &ConfirmBeforeDeletingDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &ConfirmBeforeDeletingDialog::reject);
readConfig();
}
......
......@@ -6,8 +6,10 @@
#pragma once
#include "confirmbeforedeletingrule.h"
#include "kmailconfirmbeforedeleting_export.h"
#include <QObject>
#include <QVector>
class KMAILCONFIRMBEFOREDELETING_EXPORT ConfirmBeforeDeletingManager : public QObject
{
......@@ -17,4 +19,7 @@ public:
~ConfirmBeforeDeletingManager() override;
static ConfirmBeforeDeletingManager *self();
private:
QVector<ConfirmBeforeDeletingRule> mRules;
};
......@@ -13,3 +13,13 @@ ConfirmBeforeDeletingRule::ConfirmBeforeDeletingRule()
ConfirmBeforeDeletingRule::~ConfirmBeforeDeletingRule()
{
}
const QString &ConfirmBeforeDeletingRule::pattern() const
{
return mPattern;
}
void ConfirmBeforeDeletingRule::setPattern(const QString &newPattern)
{
mPattern = newPattern;
}
......@@ -5,10 +5,17 @@
*/
#pragma once
#include <QString>
class ConfirmBeforeDeletingRule
{
public:
ConfirmBeforeDeletingRule();
~ConfirmBeforeDeletingRule();
Q_REQUIRED_RESULT const QString &pattern() const;
void setPattern(const QString &newPattern);
private:
QString mPattern;
};
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