Add runner speed functions to abstractrunner

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=746915
This commit is contained in:
Ryan P. Bitanga 2007-12-10 16:20:46 +00:00
parent 8d84a43513
commit f1df93c794
2 changed files with 32 additions and 0 deletions

View File

@ -31,6 +31,10 @@ class AbstractRunner::Private
public:
bool hasMatchOptions;
bool hasConfig;
Speed speed;
Private()
: speed(NormalSpeed)
{}
};
AbstractRunner::AbstractRunner(QObject* parent)
@ -96,6 +100,16 @@ void AbstractRunner::createConfigurationInterface(QWidget *widget)
Q_UNUSED(widget)
}
AbstractRunner::Speed AbstractRunner::speed() const
{
return d->speed;
}
void AbstractRunner::setSpeed(Speed speed)
{
d->speed = speed;
}
void AbstractRunner::exec(Plasma::SearchMatch *action)
{
Q_UNUSED(action)

View File

@ -39,10 +39,15 @@ class PLASMA_EXPORT AbstractRunner : public QObject
Q_OBJECT
public:
enum Speed { NormalSpeed,
SlowSpeed };
typedef QList<AbstractRunner*> List;
/**
* Static method is called to load and get a list available of Runners.
*
* @param whitelist An optional whitelist of runners to load
*/
static List loadRunners(QObject* parent, const QStringList& whitelist = QStringList() );
@ -109,6 +114,11 @@ class PLASMA_EXPORT AbstractRunner : public QObject
*/
virtual void exec(Plasma::SearchMatch *action);
/**
* The nominal speed of the runner.
*/
Speed speed() const;
protected:
/**
* Sets whether or not the the runner has options for matches
@ -120,6 +130,14 @@ class PLASMA_EXPORT AbstractRunner : public QObject
*/
void setIsConfigurable(bool canBeConfigured);
/**
* Sets the nominal speed of the runner. Only slow runners need
* to call this within their constructor because the default
* speed is NormalSpeed. Runners that use DBUS should call
* this within their constructors.
*/
void setSpeed(Speed newSpeed);
private:
class Private;
Private* const d;