Commit 55e90656 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix save/load header size

parent 38255e3e
......@@ -76,7 +76,7 @@ set(LIBKLEO_LIB_VERSION "5.13.40")
set(AKONADI_LIB_VERSION "5.13.40")
set(INCIDENCEEDITOR_LIB_VERSION "5.13.40")
set(KTNEF_LIB_VERSION "5.13.40")
set(MESSAGELIB_LIB_VERSION "5.13.47")
set(MESSAGELIB_LIB_VERSION "5.13.50")
set(AKONADICALENDAR_LIB_VERSION "5.13.40")
set(CALENDAR_UTILS_VERSION "5.13.40")
set(KPIMTEXTEDIT_LIB_VERSION "5.13.40")
......
......@@ -19,8 +19,14 @@
#include "dkimkeyrecordwidget.h"
#include <MessageViewer/DKIMManagerKeyWidget>
#include <KConfigGroup>
#include <KSharedConfig>
#include <QHBoxLayout>
namespace {
static const char myConfigGroupName[] = "DKIMKeyRecordWidget";
}
DKIMKeyRecordWidget::DKIMKeyRecordWidget(QWidget *parent)
: QWidget(parent)
{
......@@ -31,10 +37,25 @@ DKIMKeyRecordWidget::DKIMKeyRecordWidget(QWidget *parent)
mManagerKeyWidget = new MessageViewer::DKIMManagerKeyWidget(this);
mManagerKeyWidget->setObjectName(QStringLiteral("mManagerKeyWidget"));
mainLayout->addWidget(mManagerKeyWidget);
readConfig();
}
DKIMKeyRecordWidget::~DKIMKeyRecordWidget()
{
writeConfig();
}
void DKIMKeyRecordWidget::readConfig()
{
KConfigGroup group(KSharedConfig::openConfig(), myConfigGroupName);
mManagerKeyWidget->restoreHeaders(group.readEntry("Header", QByteArray()));
}
void DKIMKeyRecordWidget::writeConfig()
{
KConfigGroup group(KSharedConfig::openConfig(), myConfigGroupName);
group.writeEntry("Header", mManagerKeyWidget->saveHeaders());
group.sync();
}
void DKIMKeyRecordWidget::loadSettings()
......
......@@ -35,6 +35,8 @@ public:
void saveSettings();
void resetSettings();
private:
void readConfig();
void writeConfig();
MessageViewer::DKIMManagerKeyWidget *mManagerKeyWidget = nullptr;
};
......
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