From 658fad620aaea46e303911b6e2654735c6373e77 Mon Sep 17 00:00:00 2001 From: Claus Christensen Date: Sat, 24 Mar 2012 19:33:54 +0100 Subject: [PATCH] Replaced KGlobal::config() by KSharedConfig::openConfig() Remodified: kded/kdedadaptor.cpp --- abstractrunner.cpp | 2 +- applet.cpp | 8 ++++---- corona.cpp | 2 +- coronabase.cpp | 2 +- pluginloader.cpp | 2 +- private/appletprivate.cpp | 6 +++--- runnermanager.cpp | 4 ++-- theme.cpp | 2 +- view.cpp | 4 ++-- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/abstractrunner.cpp b/abstractrunner.cpp index 0967114a7..dc19198f5 100644 --- a/abstractrunner.cpp +++ b/abstractrunner.cpp @@ -82,7 +82,7 @@ KConfigGroup AbstractRunner::config() const group = "UnnamedRunner"; } - KConfigGroup runners(KGlobal::config(), "Runners"); + KConfigGroup runners(KSharedConfig::openConfig(), "Runners"); return KConfigGroup(&runners, group); } diff --git a/applet.cpp b/applet.cpp index 133a4faaf..d95de5b9c 100644 --- a/applet.cpp +++ b/applet.cpp @@ -347,7 +347,7 @@ void Applet::saveState(KConfigGroup &group) const KConfigGroup Applet::config() const { if (d->transient) { - return KConfigGroup(KGlobal::config(), "PlasmaTransientsConfig"); + return KConfigGroup(KSharedConfig::openConfig(), "PlasmaTransientsConfig"); } if (d->isContainment) { @@ -367,7 +367,7 @@ KConfigGroup Applet::globalConfig() const KSharedConfig::Ptr coronaConfig = corona->config(); globalAppletConfig = KConfigGroup(coronaConfig, group); } else { - globalAppletConfig = KConfigGroup(KGlobal::config(), group); + globalAppletConfig = KConfigGroup(KSharedConfig::openConfig(), group); } return KConfigGroup(&globalAppletConfig, d->globalName()); @@ -1443,7 +1443,7 @@ void Applet::createConfigurationInterface(KConfigDialog *parent) bool Applet::hasAuthorization(const QString &constraint) const { - KConfigGroup constraintGroup(KGlobal::config(), "Constraints"); + KConfigGroup constraintGroup(KSharedConfig::openConfig(), "Constraints"); return constraintGroup.readEntry(constraint, true); } @@ -1541,7 +1541,7 @@ QStringList Applet::listCategories(const QString &parentApp, bool visibleOnly) QString constraint = AppletPrivate::parentAppConstraint(parentApp); constraint.append(" and exist [X-KDE-PluginInfo-Category]"); - KConfigGroup group(KGlobal::config(), "General"); + KConfigGroup group(KSharedConfig::openConfig(), "General"); const QStringList excluded = group.readEntry("ExcludeCategories", QStringList()); foreach (const QString &category, excluded) { constraint.append(" and [X-KDE-PluginInfo-Category] != '").append(category).append("'"); diff --git a/corona.cpp b/corona.cpp index 4982f872a..bbe694a65 100644 --- a/corona.cpp +++ b/corona.cpp @@ -74,7 +74,7 @@ Corona::Corona(QObject *parent) Corona::~Corona() { - KConfigGroup trans(KGlobal::config(), "PlasmaTransientsConfig"); + KConfigGroup trans(KSharedConfig::openConfig(), "PlasmaTransientsConfig"); trans.deleteGroup(); // FIXME: Same fix as in Plasma::View - make sure that when the focused widget is diff --git a/coronabase.cpp b/coronabase.cpp index d50b14217..3873a4242 100644 --- a/coronabase.cpp +++ b/coronabase.cpp @@ -72,7 +72,7 @@ CoronaBase::CoronaBase(QObject *parent) CoronaBase::~CoronaBase() { - KConfigGroup trans(KGlobal::config(), "PlasmaTransientsConfig"); + KConfigGroup trans(KSharedConfig::openConfig(), "PlasmaTransientsConfig"); trans.deleteGroup(); delete d; diff --git a/pluginloader.cpp b/pluginloader.cpp index 4d752daa9..092090dbf 100644 --- a/pluginloader.cpp +++ b/pluginloader.cpp @@ -409,7 +409,7 @@ KPluginInfo::List PluginLoader::listAppletInfo(const QString &category, const QS //note: constraint guaranteed non-empty from here down if (category.isEmpty()) { //use all but the excluded categories - KConfigGroup group(KGlobal::config(), "General"); + KConfigGroup group(KSharedConfig::openConfig(), "General"); QStringList excluded = group.readEntry("ExcludeCategories", QStringList()); foreach (const QString &category, excluded) { constraint.append(" and [X-KDE-PluginInfo-Category] != '").append(category).append("'"); diff --git a/private/appletprivate.cpp b/private/appletprivate.cpp index aa6566b63..1b790c546 100644 --- a/private/appletprivate.cpp +++ b/private/appletprivate.cpp @@ -523,7 +523,7 @@ void AppletPrivate::propagateConfigChanged() void AppletPrivate::filterOffers(QList &offers) { - KConfigGroup constraintGroup(KGlobal::config(), "Constraints"); + KConfigGroup constraintGroup(KSharedConfig::openConfig(), "Constraints"); foreach (const QString &key, constraintGroup.keyList()) { //kDebug() << "security constraint" << key; if (constraintGroup.readEntry(key, true)) { @@ -677,7 +677,7 @@ KConfigGroup *AppletPrivate::mainConfigGroup() if (corona) { containmentConfig = KConfigGroup(corona->config(), "Containments"); } else { - containmentConfig = KConfigGroup(KGlobal::config(), "Containments"); + containmentConfig = KConfigGroup(KSharedConfig::openConfig(), "Containments"); } if (package && !containmentConfig.hasGroup(QString::number(appletId))) { @@ -701,7 +701,7 @@ KConfigGroup *AppletPrivate::mainConfigGroup() appletConfig = KConfigGroup(&appletConfig, "Applets"); } else { kWarning() << "requesting config for" << q->name() << "without a containment!"; - appletConfig = KConfigGroup(KGlobal::config(), "Applets"); + appletConfig = KConfigGroup(KSharedConfig::openConfig(), "Applets"); } if (package && !appletConfig.hasGroup(QString::number(appletId))) { diff --git a/runnermanager.cpp b/runnermanager.cpp index a7e537f54..9324fd4ad 100644 --- a/runnermanager.cpp +++ b/runnermanager.cpp @@ -125,7 +125,7 @@ public: KConfigGroup configGroup() { - return conf.isValid() ? conf : KConfigGroup(KGlobal::config(), "PlasmaRunnerManager"); + return conf.isValid() ? conf : KConfigGroup(KSharedConfig::openConfig(), "PlasmaRunnerManager"); } void clearSingleRunner() @@ -183,7 +183,7 @@ public: if (conf.isValid()) { pluginConf = KConfigGroup(&conf, "Plugins"); } else { - pluginConf = KConfigGroup(KGlobal::config(), "Plugins"); + pluginConf = KConfigGroup(KSharedConfig::openConfig(), "Plugins"); } advertiseSingleRunnerIds.clear(); diff --git a/theme.cpp b/theme.cpp index 1e3771fca..d197029b9 100644 --- a/theme.cpp +++ b/theme.cpp @@ -843,7 +843,7 @@ QFont Theme::font(FontRole role) const { switch (role) { case DesktopFont: { - KConfigGroup cg(KGlobal::config(), "General"); + KConfigGroup cg(KSharedConfig::openConfig(), "General"); return cg.readEntry("desktopFont", d->generalFont); } break; diff --git a/view.cpp b/view.cpp index c3b666da3..b82bc5498 100644 --- a/view.cpp +++ b/view.cpp @@ -365,7 +365,7 @@ Containment *View::swapContainment(Plasma::Containment *existing, const QString KConfigGroup View::config() const { - KConfigGroup views(KGlobal::config(), "PlasmaViews"); + KConfigGroup views(KSharedConfig::openConfig(), "PlasmaViews"); return KConfigGroup(&views, QString::number(d->viewId)); } @@ -375,7 +375,7 @@ void View::configNeedsSaving() const if (corona) { corona->requestConfigSync(); } else { - KGlobal::config()->sync(); + KSharedConfig::openConfig()->sync(); } }