From 8e9ad3cfcf2fb7db9cbb9a174157798d804dffda Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Wed, 14 Oct 2009 05:50:17 +0000 Subject: [PATCH] restore load/save behaviour for krunner; short term fix only, however. this needs to be fixed in krunner (and possibly have RunnerManager extended a bit to make this less error prone) but it would be nice for krunner to be useful to others while i work on fixing this up... svn path=/trunk/KDE/kdelibs/; revision=1034974 --- runnermanager.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/runnermanager.cpp b/runnermanager.cpp index a5a800608..4746000f8 100644 --- a/runnermanager.cpp +++ b/runnermanager.cpp @@ -116,9 +116,15 @@ public: KConfigGroup config = configGroup(); KService::List offers = KServiceTypeTrader::self()->query("Plasma/Runner"); - bool loadAll = config.readEntry("loadAll", false); + const bool loadAll = config.readEntry("loadAll", false); QStringList whiteList = config.readEntry("pluginWhiteList", QStringList()); - KConfigGroup pluginConf(&config, "Plugins"); + const bool noWhiteList = whiteList.isEmpty(); + KConfigGroup pluginConf; + if (conf.isValid()) { + pluginConf = KConfigGroup(&conf, "Plugins"); + } else { + pluginConf = KConfigGroup(KGlobal::config(), "Plugins"); + } foreach (const KService::Ptr &service, offers) { //kDebug() << "Loading runner: " << service->name() << service->storageId(); @@ -133,10 +139,11 @@ public: QString runnerName = description.pluginName(); description.load(pluginConf); - bool loaded = runners.contains(runnerName); - bool selected = loadAll || - description.isPluginEnabled() && (whiteList.isEmpty() || whiteList.contains(runnerName)); + const bool loaded = runners.contains(runnerName); + const bool selected = loadAll || + (description.isPluginEnabled() && (noWhiteList || whiteList.contains(runnerName))); + //kDebug() << loadAll << description.isPluginEnabled() << noWhiteList << whiteList.contains(runnerName); if (selected) { if (!loaded) { QString api = service->property("X-Plasma-API").toString();