summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2016-06-06 13:36:10 +0200
committerMontel Laurent <[email protected]>2016-06-06 13:36:10 +0200
commitdccef896bb772e6341090fadc6e61982d2f38f44 (patch)
treedbe0f52e4ed5412c9c7dba846921ff477b6e2cc5
parent4cbe0247125d2ac7b013b5dbee3ec9967a42b619 (diff)
Load/Save settings
-rw-r--r--kmail/editorsendcheckplugins/confirm-address/confirmaddressconfigurewidget.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/kmail/editorsendcheckplugins/confirm-address/confirmaddressconfigurewidget.cpp b/kmail/editorsendcheckplugins/confirm-address/confirmaddressconfigurewidget.cpp
index 9c70b5e..65ff1d0 100644
--- a/kmail/editorsendcheckplugins/confirm-address/confirmaddressconfigurewidget.cpp
+++ b/kmail/editorsendcheckplugins/confirm-address/confirmaddressconfigurewidget.cpp
@@ -23,6 +23,8 @@
#include <QVBoxLayout>
#include <QLabel>
#include <QGroupBox>
+#include <KConfigGroup>
+#include <KSharedConfig>
#include <PimCommon/SimpleStringlistEditor>
ConfirmAddressConfigureWidget::ConfirmAddressConfigureWidget(QWidget *parent)
@@ -82,21 +84,29 @@ ConfirmAddressConfigureWidget::~ConfirmAddressConfigureWidget()
void ConfirmAddressConfigureWidget::loadSettings()
{
- //TODO
+ KConfigGroup grp(KSharedConfig::openConfig(), "Confirm Address");
+ mEnable->setChecked(grp.readEntry("Enabled", false));
+ mDomainNameListEditor->setStringList(grp.readEntry("Domains", QStringList()));
+ mWhiteListEditor->setStringList(grp.readEntry("Emails", QStringList()));
}
void ConfirmAddressConfigureWidget::saveSettings()
{
- //TODO
+ KConfigGroup grp(KSharedConfig::openConfig(), "Confirm Address");
+ grp.writeEntry("Enabled", mEnable->isChecked());
+ grp.writeEntry("Domains", mDomainNameListEditor->stringList());
+ grp.writeEntry("Emails", mWhiteListEditor->stringList());
}
void ConfirmAddressConfigureWidget::resetSettings()
{
- //TODO
+ mDomainNameListEditor->setStringList({});
+ mWhiteListEditor->setStringList({});
+ mEnable->setChecked(false);
}
void ConfirmAddressConfigureWidget::slotEnableChanged(bool state)
{
+ Q_UNUSED(state);
Q_EMIT configureChanged();
- //TODO
}