From 5fc323b7dbea53091db8eb49a9e8ae3a46c944e1 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Tue, 11 Dec 2007 16:53:40 +0000 Subject: [PATCH] provide a place for runners to put their config. no, not overly performant but this really shouldn't need to be svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=747296 --- abstractrunner.cpp | 10 ++++++++++ abstractrunner.h | 7 +++++++ 2 files changed, 17 insertions(+) diff --git a/abstractrunner.cpp b/abstractrunner.cpp index 92391288c..0bb9b65ce 100644 --- a/abstractrunner.cpp +++ b/abstractrunner.cpp @@ -48,6 +48,16 @@ AbstractRunner::~AbstractRunner() delete d; } +KConfigGroup AbstractRunner::config() const +{ + QString group = objectName(); + if (group.isEmpty()) { + group = "UnnamedRunner"; + } + + return KConfigGroup(&KConfigGroup(KGlobal::config(), "Runners"), group); +} + void AbstractRunner::performMatch( Plasma::SearchContext &globalContext ) { Plasma::SearchContext localContext( 0, globalContext ); diff --git a/abstractrunner.h b/abstractrunner.h index 01a29734e..152dc191e 100644 --- a/abstractrunner.h +++ b/abstractrunner.h @@ -23,6 +23,8 @@ #include #include +#include + #include #include #include @@ -60,6 +62,11 @@ class PLASMA_EXPORT AbstractRunner : public QObject explicit AbstractRunner(QObject* parent = 0); virtual ~AbstractRunner(); + /** + * Provides access to the runner's configuration object. + */ + KConfigGroup config() const; + /** * If the runner can run precisely this term, return a QAction, else * return 0. The first runner that returns a QAction will be the