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
This commit is contained in:
Aaron J. Seigo 2007-12-11 16:53:40 +00:00
parent bf9bd90ec8
commit 5fc323b7db
2 changed files with 17 additions and 0 deletions

View File

@ -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 );

View File

@ -23,6 +23,8 @@
#include <QtCore/QObject>
#include <QtCore/QStringList>
#include <KConfigGroup>
#include <plasma/plasma_export.h>
#include <plasma/searchmatch.h>
#include <plasma/searchcontext.h>
@ -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