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

Improve manager

parent 1c9762e7
...@@ -20,15 +20,17 @@ ...@@ -20,15 +20,17 @@
#include "dkimmanagerauthenticationservertest.h" #include "dkimmanagerauthenticationservertest.h"
#include "dkim-verify/dkimmanagerauthenticationserver.h" #include "dkim-verify/dkimmanagerauthenticationserver.h"
#include <QTest> #include <QTest>
#include <QStandardPaths>
QTEST_GUILESS_MAIN(DKIMManagerAuthenticationServerTest) QTEST_GUILESS_MAIN(DKIMManagerAuthenticationServerTest)
DKIMManagerAuthenticationServerTest::DKIMManagerAuthenticationServerTest(QObject *parent) DKIMManagerAuthenticationServerTest::DKIMManagerAuthenticationServerTest(QObject *parent)
: QObject(parent) : QObject(parent)
{ {
QStandardPaths::setTestModeEnabled(true);
} }
void DKIMManagerAuthenticationServerTest::shouldHaveDefaultValue() void DKIMManagerAuthenticationServerTest::shouldHaveDefaultValue()
{ {
//TODO MessageViewer::DKIMManagerAuthenticationServer w;
QVERIFY(w.serverList().isEmpty());
} }
...@@ -18,6 +18,10 @@ ...@@ -18,6 +18,10 @@
*/ */
#include "dkimmanagerauthenticationserver.h" #include "dkimmanagerauthenticationserver.h"
#include "dkimutil.h"
#include <KConfigGroup>
#include <KSharedConfig>
using namespace MessageViewer; using namespace MessageViewer;
DKIMManagerAuthenticationServer::DKIMManagerAuthenticationServer(QObject *parent) DKIMManagerAuthenticationServer::DKIMManagerAuthenticationServer(QObject *parent)
...@@ -28,7 +32,7 @@ DKIMManagerAuthenticationServer::DKIMManagerAuthenticationServer(QObject *parent ...@@ -28,7 +32,7 @@ DKIMManagerAuthenticationServer::DKIMManagerAuthenticationServer(QObject *parent
DKIMManagerAuthenticationServer::~DKIMManagerAuthenticationServer() DKIMManagerAuthenticationServer::~DKIMManagerAuthenticationServer()
{ {
save();
} }
...@@ -37,3 +41,23 @@ DKIMManagerAuthenticationServer *DKIMManagerAuthenticationServer::self() ...@@ -37,3 +41,23 @@ DKIMManagerAuthenticationServer *DKIMManagerAuthenticationServer::self()
static DKIMManagerAuthenticationServer s_self; static DKIMManagerAuthenticationServer s_self;
return &s_self; return &s_self;
} }
QStringList DKIMManagerAuthenticationServer::serverList() const
{
return mServerList;
}
void DKIMManagerAuthenticationServer::setServerList(const QStringList &serverList)
{
mServerList = serverList;
}
void DKIMManagerAuthenticationServer::load()
{
//TODO
}
void DKIMManagerAuthenticationServer::save()
{
//TODO
}
...@@ -31,6 +31,14 @@ public: ...@@ -31,6 +31,14 @@ public:
explicit DKIMManagerAuthenticationServer(QObject *parent = nullptr); explicit DKIMManagerAuthenticationServer(QObject *parent = nullptr);
~DKIMManagerAuthenticationServer(); ~DKIMManagerAuthenticationServer();
static DKIMManagerAuthenticationServer *self(); static DKIMManagerAuthenticationServer *self();
Q_REQUIRED_RESULT QStringList serverList() const;
void setServerList(const QStringList &serverList);
private:
void load();
void save();
QStringList mServerList;
}; };
} }
......
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