Commit 4931647f authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Avoid potential problem

parent 3b2aad70
...@@ -23,11 +23,12 @@ ...@@ -23,11 +23,12 @@
#include <KSharedConfig> #include <KSharedConfig>
using namespace MessageViewer; using namespace MessageViewer;
namespace {
static const char myConfigGroupName[] = "AuthenticationServer";
}
DKIMManagerAuthenticationServer::DKIMManagerAuthenticationServer(QObject *parent) DKIMManagerAuthenticationServer::DKIMManagerAuthenticationServer(QObject *parent)
: QObject(parent) : QObject(parent)
{ {
} }
DKIMManagerAuthenticationServer::~DKIMManagerAuthenticationServer() DKIMManagerAuthenticationServer::~DKIMManagerAuthenticationServer()
...@@ -35,7 +36,6 @@ DKIMManagerAuthenticationServer::~DKIMManagerAuthenticationServer() ...@@ -35,7 +36,6 @@ DKIMManagerAuthenticationServer::~DKIMManagerAuthenticationServer()
save(); save();
} }
DKIMManagerAuthenticationServer *DKIMManagerAuthenticationServer::self() DKIMManagerAuthenticationServer *DKIMManagerAuthenticationServer::self()
{ {
static DKIMManagerAuthenticationServer s_self; static DKIMManagerAuthenticationServer s_self;
...@@ -55,13 +55,13 @@ void DKIMManagerAuthenticationServer::setServerList(const QStringList &serverLis ...@@ -55,13 +55,13 @@ void DKIMManagerAuthenticationServer::setServerList(const QStringList &serverLis
void DKIMManagerAuthenticationServer::load() void DKIMManagerAuthenticationServer::load()
{ {
const KSharedConfig::Ptr &config = KSharedConfig::openConfig(MessageViewer::DKIMUtil::defaultConfigFileName(), KConfig::NoGlobals); const KSharedConfig::Ptr &config = KSharedConfig::openConfig(MessageViewer::DKIMUtil::defaultConfigFileName(), KConfig::NoGlobals);
KConfigGroup grp(config, "AuthenticationServer"); KConfigGroup grp(config, myConfigGroupName);
mServerList = grp.readEntry("ServerList", QStringList()); mServerList = grp.readEntry("ServerList", QStringList());
} }
void DKIMManagerAuthenticationServer::save() void DKIMManagerAuthenticationServer::save()
{ {
const KSharedConfig::Ptr &config = KSharedConfig::openConfig(MessageViewer::DKIMUtil::defaultConfigFileName(), KConfig::NoGlobals); const KSharedConfig::Ptr &config = KSharedConfig::openConfig(MessageViewer::DKIMUtil::defaultConfigFileName(), KConfig::NoGlobals);
KConfigGroup grp(config, "AuthenticationServer"); KConfigGroup grp(config, myConfigGroupName);
grp.writeEntry("ServerList", mServerList); grp.writeEntry("ServerList", 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