diff --git a/libnotificationmanager/settings.h b/libnotificationmanager/settings.h --- a/libnotificationmanager/settings.h +++ b/libnotificationmanager/settings.h @@ -227,6 +227,9 @@ public: explicit Settings(QObject *parent = nullptr); + /** + * @deprecated + */ Settings(const KSharedConfig::Ptr &config, QObject *parent = nullptr); ~Settings() override; diff --git a/libnotificationmanager/settings.cpp b/libnotificationmanager/settings.cpp --- a/libnotificationmanager/settings.cpp +++ b/libnotificationmanager/settings.cpp @@ -35,6 +35,11 @@ #include "jobsettings.h" #include "badgesettings.h" +namespace NotificationManager +{ +constexpr const char s_configFile[] = "plasmanotifyrc"; +} + using namespace NotificationManager; class Q_DECL_HIDDEN Settings::Private @@ -69,7 +74,6 @@ bool live = false; // set to true initially in constructor bool dirty = false; - }; Settings::Private::Private(Settings *q) @@ -161,17 +165,10 @@ } Settings::Settings(QObject *parent) - // FIXME static thing for config file name - : Settings(KSharedConfig::openConfig(QStringLiteral("plasmanotifyrc")), parent) -{ - -} - -Settings::Settings(const KSharedConfig::Ptr &config, QObject *parent) : QObject(parent) , d(new Private(this)) { - d->config = config; + d->config = KSharedConfig::openConfig(s_configFile); setLive(true); @@ -186,6 +183,12 @@ } } +Settings::Settings(const KSharedConfig::Ptr &config, QObject *parent) + : Settings(parent) +{ + d->config = config; +} + Settings::~Settings() { d->config->markAsClean();