Replaced KGlobal::config() by KSharedConfig::openConfig()

Remodified:   kded/kdedadaptor.cpp
This commit is contained in:
Claus Christensen 2012-03-24 19:33:54 +01:00
parent 7463dde514
commit 658fad620a
9 changed files with 16 additions and 16 deletions

View File

@ -82,7 +82,7 @@ KConfigGroup AbstractRunner::config() const
group = "UnnamedRunner"; group = "UnnamedRunner";
} }
KConfigGroup runners(KGlobal::config(), "Runners"); KConfigGroup runners(KSharedConfig::openConfig(), "Runners");
return KConfigGroup(&runners, group); return KConfigGroup(&runners, group);
} }

View File

@ -347,7 +347,7 @@ void Applet::saveState(KConfigGroup &group) const
KConfigGroup Applet::config() const KConfigGroup Applet::config() const
{ {
if (d->transient) { if (d->transient) {
return KConfigGroup(KGlobal::config(), "PlasmaTransientsConfig"); return KConfigGroup(KSharedConfig::openConfig(), "PlasmaTransientsConfig");
} }
if (d->isContainment) { if (d->isContainment) {
@ -367,7 +367,7 @@ KConfigGroup Applet::globalConfig() const
KSharedConfig::Ptr coronaConfig = corona->config(); KSharedConfig::Ptr coronaConfig = corona->config();
globalAppletConfig = KConfigGroup(coronaConfig, group); globalAppletConfig = KConfigGroup(coronaConfig, group);
} else { } else {
globalAppletConfig = KConfigGroup(KGlobal::config(), group); globalAppletConfig = KConfigGroup(KSharedConfig::openConfig(), group);
} }
return KConfigGroup(&globalAppletConfig, d->globalName()); return KConfigGroup(&globalAppletConfig, d->globalName());
@ -1443,7 +1443,7 @@ void Applet::createConfigurationInterface(KConfigDialog *parent)
bool Applet::hasAuthorization(const QString &constraint) const bool Applet::hasAuthorization(const QString &constraint) const
{ {
KConfigGroup constraintGroup(KGlobal::config(), "Constraints"); KConfigGroup constraintGroup(KSharedConfig::openConfig(), "Constraints");
return constraintGroup.readEntry(constraint, true); return constraintGroup.readEntry(constraint, true);
} }
@ -1541,7 +1541,7 @@ QStringList Applet::listCategories(const QString &parentApp, bool visibleOnly)
QString constraint = AppletPrivate::parentAppConstraint(parentApp); QString constraint = AppletPrivate::parentAppConstraint(parentApp);
constraint.append(" and exist [X-KDE-PluginInfo-Category]"); 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()); const QStringList excluded = group.readEntry("ExcludeCategories", QStringList());
foreach (const QString &category, excluded) { foreach (const QString &category, excluded) {
constraint.append(" and [X-KDE-PluginInfo-Category] != '").append(category).append("'"); constraint.append(" and [X-KDE-PluginInfo-Category] != '").append(category).append("'");

View File

@ -74,7 +74,7 @@ Corona::Corona(QObject *parent)
Corona::~Corona() Corona::~Corona()
{ {
KConfigGroup trans(KGlobal::config(), "PlasmaTransientsConfig"); KConfigGroup trans(KSharedConfig::openConfig(), "PlasmaTransientsConfig");
trans.deleteGroup(); trans.deleteGroup();
// FIXME: Same fix as in Plasma::View - make sure that when the focused widget is // FIXME: Same fix as in Plasma::View - make sure that when the focused widget is

View File

@ -72,7 +72,7 @@ CoronaBase::CoronaBase(QObject *parent)
CoronaBase::~CoronaBase() CoronaBase::~CoronaBase()
{ {
KConfigGroup trans(KGlobal::config(), "PlasmaTransientsConfig"); KConfigGroup trans(KSharedConfig::openConfig(), "PlasmaTransientsConfig");
trans.deleteGroup(); trans.deleteGroup();
delete d; delete d;

View File

@ -409,7 +409,7 @@ KPluginInfo::List PluginLoader::listAppletInfo(const QString &category, const QS
//note: constraint guaranteed non-empty from here down //note: constraint guaranteed non-empty from here down
if (category.isEmpty()) { //use all but the excluded categories 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()); QStringList excluded = group.readEntry("ExcludeCategories", QStringList());
foreach (const QString &category, excluded) { foreach (const QString &category, excluded) {
constraint.append(" and [X-KDE-PluginInfo-Category] != '").append(category).append("'"); constraint.append(" and [X-KDE-PluginInfo-Category] != '").append(category).append("'");

View File

@ -523,7 +523,7 @@ void AppletPrivate::propagateConfigChanged()
void AppletPrivate::filterOffers(QList<KService::Ptr> &offers) void AppletPrivate::filterOffers(QList<KService::Ptr> &offers)
{ {
KConfigGroup constraintGroup(KGlobal::config(), "Constraints"); KConfigGroup constraintGroup(KSharedConfig::openConfig(), "Constraints");
foreach (const QString &key, constraintGroup.keyList()) { foreach (const QString &key, constraintGroup.keyList()) {
//kDebug() << "security constraint" << key; //kDebug() << "security constraint" << key;
if (constraintGroup.readEntry(key, true)) { if (constraintGroup.readEntry(key, true)) {
@ -677,7 +677,7 @@ KConfigGroup *AppletPrivate::mainConfigGroup()
if (corona) { if (corona) {
containmentConfig = KConfigGroup(corona->config(), "Containments"); containmentConfig = KConfigGroup(corona->config(), "Containments");
} else { } else {
containmentConfig = KConfigGroup(KGlobal::config(), "Containments"); containmentConfig = KConfigGroup(KSharedConfig::openConfig(), "Containments");
} }
if (package && !containmentConfig.hasGroup(QString::number(appletId))) { if (package && !containmentConfig.hasGroup(QString::number(appletId))) {
@ -701,7 +701,7 @@ KConfigGroup *AppletPrivate::mainConfigGroup()
appletConfig = KConfigGroup(&appletConfig, "Applets"); appletConfig = KConfigGroup(&appletConfig, "Applets");
} else { } else {
kWarning() << "requesting config for" << q->name() << "without a containment!"; 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))) { if (package && !appletConfig.hasGroup(QString::number(appletId))) {

View File

@ -125,7 +125,7 @@ public:
KConfigGroup configGroup() KConfigGroup configGroup()
{ {
return conf.isValid() ? conf : KConfigGroup(KGlobal::config(), "PlasmaRunnerManager"); return conf.isValid() ? conf : KConfigGroup(KSharedConfig::openConfig(), "PlasmaRunnerManager");
} }
void clearSingleRunner() void clearSingleRunner()
@ -183,7 +183,7 @@ public:
if (conf.isValid()) { if (conf.isValid()) {
pluginConf = KConfigGroup(&conf, "Plugins"); pluginConf = KConfigGroup(&conf, "Plugins");
} else { } else {
pluginConf = KConfigGroup(KGlobal::config(), "Plugins"); pluginConf = KConfigGroup(KSharedConfig::openConfig(), "Plugins");
} }
advertiseSingleRunnerIds.clear(); advertiseSingleRunnerIds.clear();

View File

@ -843,7 +843,7 @@ QFont Theme::font(FontRole role) const
{ {
switch (role) { switch (role) {
case DesktopFont: { case DesktopFont: {
KConfigGroup cg(KGlobal::config(), "General"); KConfigGroup cg(KSharedConfig::openConfig(), "General");
return cg.readEntry("desktopFont", d->generalFont); return cg.readEntry("desktopFont", d->generalFont);
} }
break; break;

View File

@ -365,7 +365,7 @@ Containment *View::swapContainment(Plasma::Containment *existing, const QString
KConfigGroup View::config() const KConfigGroup View::config() const
{ {
KConfigGroup views(KGlobal::config(), "PlasmaViews"); KConfigGroup views(KSharedConfig::openConfig(), "PlasmaViews");
return KConfigGroup(&views, QString::number(d->viewId)); return KConfigGroup(&views, QString::number(d->viewId));
} }
@ -375,7 +375,7 @@ void View::configNeedsSaving() const
if (corona) { if (corona) {
corona->requestConfigSync(); corona->requestConfigSync();
} else { } else {
KGlobal::config()->sync(); KSharedConfig::openConfig()->sync();
} }
} }