Plasma::AbstractRunner
#include <KRunner/AbstractRunner>

Public Types | |
typedef QList< AbstractRunner * > | List |
enum | Priority { LowestPriority = 0, LowPriority, NormalPriority, HighPriority, HighestPriority } |
enum | Speed { SlowSpeed, NormalSpeed } |
Properties | |
QString | description |
QIcon | icon |
QString | id |
bool | matchingSuspended |
QRegularExpression | matchRegex |
int | minLetterCount |
QString | name |
![]() | |
objectName | |
Signals | |
void | matchingSuspended (bool suspended) |
void | prepare () |
void | teardown () |
Public Member Functions | |
virtual QStringList | categories () const |
virtual QIcon | categoryIcon (const QString &category) const |
virtual void | createRunOptions (QWidget *widget) |
RunnerSyntax * | defaultSyntax () const |
QString | description () const |
bool | hasMatchRegex () const |
bool | hasRunOptions () |
QIcon | icon () const |
QString | id () const |
RunnerContext::Types | ignoredTypes () const |
bool | isMatchingSuspended () const |
virtual void | match (Plasma::RunnerContext &context) |
QRegularExpression | matchRegex () const |
KPluginInfo | metadata () const |
KPluginMetaData | metadata (RunnerReturnPluginMetaDataConstant) const |
int | minLetterCount () const |
QString | name () const |
Package | package () const |
void | performMatch (Plasma::RunnerContext &context) |
Priority | priority () const |
virtual void | reloadConfiguration () |
virtual void | run (const Plasma::RunnerContext &context, const Plasma::QueryMatch &match) |
void | setIgnoredTypes (RunnerContext::Types types) |
void | setMatchRegex (const QRegularExpression ®ex) |
void | setMinLetterCount (int count) |
void | setTriggerWords (const QStringList &triggerWords) |
Speed | speed () const |
QList< RunnerSyntax > | syntaxes () const |
![]() | |
QObject (QObject *parent) | |
bool | blockSignals (bool block) |
const QObjectList & | children () const const |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const |
void | deleteLater () |
void | destroyed (QObject *obj) |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) const const |
bool | disconnect (const QObject *receiver, const char *method) const const |
void | dumpObjectInfo () |
void | dumpObjectInfo () const const |
void | dumpObjectTree () |
void | dumpObjectTree () const const |
QList< QByteArray > | dynamicPropertyNames () const const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | findChild (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QRegExp ®Exp, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QString &name, Qt::FindChildOptions options) const const |
bool | inherits (const char *className) const const |
void | installEventFilter (QObject *filterObj) |
bool | isWidgetType () const const |
bool | isWindowType () const const |
void | killTimer (int id) |
virtual const QMetaObject * | metaObject () const const |
void | moveToThread (QThread *targetThread) |
QString | objectName () const const |
void | objectNameChanged (const QString &objectName) |
QObject * | parent () const const |
QVariant | property (const char *name) const const |
Q_CLASSINFO (Name, Value) | |
Q_DISABLE_COPY (Class) | |
Q_DISABLE_COPY_MOVE (Class) | |
Q_DISABLE_MOVE (Class) | |
Q_EMIT Q_EMIT | |
Q_ENUM (...) | |
Q_ENUM_NS (...) | |
Q_ENUMS (...) | |
Q_FLAG (...) | |
Q_FLAG_NS (...) | |
Q_FLAGS (...) | |
Q_GADGET Q_GADGET | |
Q_INTERFACES (...) | |
Q_INVOKABLE Q_INVOKABLE | |
Q_NAMESPACE Q_NAMESPACE | |
Q_NAMESPACE_EXPORT (EXPORT_MACRO) | |
Q_OBJECT Q_OBJECT | |
Q_PROPERTY (...) | |
Q_REVISION Q_REVISION | |
Q_SET_OBJECT_NAME (Object) | |
Q_SIGNAL Q_SIGNAL | |
Q_SIGNALS Q_SIGNALS | |
Q_SLOT Q_SLOT | |
Q_SLOTS Q_SLOTS | |
T | qFindChild (const QObject *obj, const QString &name) |
QList< T > | qFindChildren (const QObject *obj, const QRegExp ®Exp) |
QList< T > | qFindChildren (const QObject *obj, const QString &name) |
T | qobject_cast (const QObject *object) |
T | qobject_cast (QObject *object) |
QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT | |
void | removeEventFilter (QObject *obj) |
void | setObjectName (const QString &name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | signalsBlocked () const const |
int | startTimer (int interval, Qt::TimerType timerType) |
int | startTimer (std::chrono::milliseconds time, Qt::TimerType timerType) |
QThread * | thread () const const |
Protected Member Functions | |
AbstractRunner (const KPluginMetaData &pluginMetaData, QObject *parent=nullptr) | |
AbstractRunner (const KService::Ptr service, QObject *parent=nullptr) | |
AbstractRunner (QObject *parent, const KPluginMetaData &pluginMetaData, const QVariantList &args) | |
AbstractRunner (QObject *parent, const QVariantList &args) | |
AbstractRunner (QObject *parent=nullptr, const QString &path=QString()) | |
QAction * | action (const QString &id) const |
QHash< QString, QAction * > | actions () const |
virtual QList< QAction * > | actionsForMatch (const Plasma::QueryMatch &match) |
QAction * | addAction (const QString &id, const QIcon &icon, const QString &text) |
void | addAction (const QString &id, QAction *action) |
void | addSyntax (const RunnerSyntax &syntax) |
void | clearActions () |
KConfigGroup | config () const |
Q_INVOKABLE DataEngine * | dataEngine (const QString &name) const |
virtual void | init () |
virtual QMimeData * | mimeDataForMatch (const Plasma::QueryMatch &match) |
void | removeAction (const QString &id) |
void | setDefaultSyntax (const RunnerSyntax &syntax) |
void | setHasRunOptions (bool hasRunOptions) |
void | setPriority (Priority newPriority) |
void | setSpeed (Speed newSpeed) |
void | setSyntaxes (const QList< RunnerSyntax > &syns) |
void | suspendMatching (bool suspend) |
![]() | |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
bool | isSignalConnected (const QMetaMethod &signal) const const |
int | receivers (const char *signal) const const |
QObject * | sender () const const |
int | senderSignalIndex () const const |
virtual void | timerEvent (QTimerEvent *event) |
Related Functions | |
(Note that these are not member functions.) | |
#define | K_EXPORT_PLASMA_RUNNER(libname, classname) |
#define | K_EXPORT_PLASMA_RUNNER_WITH_JSON(classname, jsonFile) K_PLUGIN_FACTORY_WITH_JSON(classname ## Factory, jsonFile, registerPlugin<classname>();) |
Additional Inherited Members | |
![]() | |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, Functor functor) |
bool | disconnect (const QMetaObject::Connection &connection) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
bool | disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method) |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
![]() | |
typedef | QObjectList |
Detailed Description
An abstract base class for Plasma Runner plugins.
Be aware that runners have to be thread-safe. This is due to the fact that each runner is executed in its own thread for each new term. Thus, a runner may be executed more than once at the same time. See match() for details. To let krunner expose a global shortcut for the single runner query mode, the runner must set the "X-Plasma-AdvertiseSingleRunnerMode" key to true in the .desktop file and set a default syntax. See setDefaultSyntax() for details.
Definition at line 68 of file abstractrunner.h.
Member Typedef Documentation
◆ List
typedef QList<AbstractRunner *> Plasma::AbstractRunner::List |
An ordered list of runners.
Definition at line 98 of file abstractrunner.h.
Member Enumeration Documentation
◆ Priority
Specifies a priority for the runner.
Definition at line 89 of file abstractrunner.h.
◆ Speed
Specifies a nominal speed for the runner.
Definition at line 82 of file abstractrunner.h.
Constructor & Destructor Documentation
◆ AbstractRunner() [1/4]
|
protected |
Constructor for a KRunner plugin.
- Parameters
-
parent parent object for this runner pluginMetaData metadata that was embedded in the runner args for compatibility with KPluginFactory, should be passed on to the parent constructor
- Since
- 5.72
Definition at line 59 of file abstractrunner.cpp.
◆ AbstractRunner() [2/4]
|
explicitprotected |
- Deprecated:
- Since 5.72, use AbstractRunner(const KPluginMetaData &, QObject *)
◆ AbstractRunner() [3/4]
|
explicitprotected |
- Since
- 5.72
Definition at line 42 of file abstractrunner.cpp.
◆ AbstractRunner() [4/4]
|
protected |
Definition at line 69 of file abstractrunner.cpp.
Member Function Documentation
◆ action()
Returns the action associated with the id.
- Deprecated:
- Since 5.86, create the QAction instances manually and store them in a custom container instead
Definition at line 214 of file abstractrunner.cpp.
◆ actions()
Returns all registered actions.
- Deprecated:
- Since 5.86, create the QAction instances manually and store them in a custom container instead
Definition at line 219 of file abstractrunner.cpp.
◆ actionsForMatch()
|
protectedvirtual |
A given match can have more than action that can be performed on it.
For example, a song match returned by a music player runner can be queued, added to the playlist, or played.
Call this method to add actions that can be performed by the runner. Actions must first be added to the runner's action registry. Note: execution of correct action is left up to the runner.
Definition at line 190 of file abstractrunner.cpp.
◆ addAction() [1/2]
|
protected |
Creates and then adds an action to the action registry.
AbstractRunner assumes ownership of the created action.
- Parameters
-
id A unique identifier string icon The icon to display text The text to display
- Returns
- the created QAction
- Deprecated:
- Since 5.86 create the QAction instance manually
Definition at line 196 of file abstractrunner.cpp.
◆ addAction() [2/2]
Adds an action to the runner's action registry.
The QAction must be created within the GUI thread; do not create it within the match method of AbstractRunner.
- Parameters
-
id A unique identifier string action The QAction to be stored
- Deprecated:
- Since 5.86, create the QAction instance manually
Definition at line 203 of file abstractrunner.cpp.
◆ addSyntax()
|
protected |
Adds a registered syntax that this runner understands.
This is used to display to the user what this runner can understand and how it can be used.
- Parameters
-
syntax the syntax to register
- Since
- 4.3
Definition at line 115 of file abstractrunner.cpp.
◆ categories()
|
virtual |
Return a list of categories that this runner provides.
By default this list just contains the runners name. It is used by the runner manager to disable certain runners if all the categories they provide have been disabled.
This list of categories is also used to provide a better way to configure the runner instead of the typical on / off switch.
- Deprecated:
- Since 5.76, feature is unused. You can still set the category property in the QueryMatch
Definition at line 318 of file abstractrunner.cpp.
◆ categoryIcon()
Returns the icon which accurately describes the category category
.
This is meant to be used in a configuration dialog when showing all the categories.
By default this returns the icon of the AbstractRunner
- Deprecated:
- Since 5.0, feature removed
Definition at line 325 of file abstractrunner.cpp.
◆ clearActions()
|
protected |
Clears the action registry.
The action pool deletes the actions.
- Deprecated:
- Since 5.86, use a custom container to store the QAction instances instead
Definition at line 224 of file abstractrunner.cpp.
◆ config()
|
protected |
Provides access to the runner's configuration object.
Definition at line 100 of file abstractrunner.cpp.
◆ createRunOptions()
|
virtual |
If hasRunOptions() returns true, this method may be called to get a widget displaying the options the user can interact with to modify the behaviour of what happens when a given match is selected.
- Parameters
-
widget the parent of the options widgets.
- Deprecated:
- Since 5.0, this feature has been defunct
Definition at line 256 of file abstractrunner.cpp.
◆ dataEngine()
|
protected |
Loads the given DataEngine.
Tries to load the data engine given by name
. Each engine is only loaded once, and that instance is re-used on all subsequent requests.
If the data engine was not found, an invalid data engine is returned (see DataEngine::isValid()).
Note that you should not delete the returned engine.
- Parameters
-
name Name of the data engine to load
- Returns
- pointer to the data engine if it was loaded, or an invalid data engine if the requested engine could not be loaded
- Since
- 4.4
- Deprecated:
- Since 5.73, DataEngines are deprecated, use e.g. a shared library to provide the data instead.
Definition at line 403 of file abstractrunner.cpp.
◆ defaultSyntax()
RunnerSyntax * Plasma::AbstractRunner::defaultSyntax | ( | ) | const |
- Returns
- the default syntax for the runner or
nullptr
if no default syntax has been defined
- Since
- 4.4
- Deprecated:
- Since 5.76, feature is unused.
Definition at line 149 of file abstractrunner.cpp.
◆ description()
QString Plasma::AbstractRunner::description | ( | ) | const |
- Returns
- the description of this Runner
◆ hasMatchRegex()
bool Plasma::AbstractRunner::hasMatchRegex | ( | ) | const |
If the runner has a valid regex and non empty regex.
- Returns
- hasMatchRegex
- Since
- 5.75
Definition at line 465 of file abstractrunner.cpp.
◆ hasRunOptions()
bool Plasma::AbstractRunner::hasRunOptions | ( | ) |
If the runner has options that the user can interact with to modify what happens when run or one of the actions created in match is called, the runner should return true.
- Deprecated:
- Since 5.0, this feature has been defunct
Definition at line 242 of file abstractrunner.cpp.
◆ icon()
QIcon Plasma::AbstractRunner::icon | ( | ) | const |
- Returns
- the icon for this Runner
◆ id()
QString Plasma::AbstractRunner::id | ( | ) | const |
- Returns
- an id string for the Runner
◆ ignoredTypes()
RunnerContext::Types Plasma::AbstractRunner::ignoredTypes | ( | ) | const |
Returns the OR'ed value of all the Information types (as defined in RunnerContext::Type) this runner is not interested in.
- Returns
- OR'ed value of black listed types
- Deprecated:
- This feature is deprecated
Definition at line 298 of file abstractrunner.cpp.
◆ init()
|
protectedvirtual |
Reimplement this slot to run any initialization routines on first load.
By default, it calls reloadConfiguration(); for scripted Runners this method also sets up the ScriptEngine.
Definition at line 397 of file abstractrunner.cpp.
◆ isMatchingSuspended()
bool Plasma::AbstractRunner::isMatchingSuspended | ( | ) | const |
- Returns
- true if the runner is currently busy with non-interuptable work, signaling that new threads should not be created for it at this time
- Since
- 4.6
Definition at line 409 of file abstractrunner.cpp.
◆ match()
|
virtual |
This is the main query method.
It should trigger creation of QueryMatch instances through RunnerContext::addMatch and RunnerContext::addMatches.
If the runner can run precisely the requested term (RunnerContext::query()), it should create an exact match by setting the type to RunnerContext::ExactMatch. The first runner that creates a QueryMatch will be the default runner. Other runner's matches will be suggested in the interface. Non-exact matches should be offered via RunnerContext::PossibleMatch.
The match will be activated via run() if the user selects it.
Each runner is executed in its own thread. Whenever the user input changes this method is called again. Thus, it needs to be thread-safe. Also, all matches need to be reported once this method returns. Asynchronous runners therefore need to make use of a local event loop to wait for all matches.
It is recommended to use local status data in async runners. The simplest way is to have a separate class doing all the work like so:
Here MyAsyncWorker creates all the matches and calls RunnerContext::addMatch in some internal slot. It emits the finished() signal once done which will quit the loop and make the match() method return. The local status is kept entirely in MyAsyncWorker which makes match() trivially thread-safe.
If a particular match supports multiple actions, set up the corresponding actions in the actionsForMatch method. Do not call any of the action methods within this method!
Execution of the correct action should be handled in the run method. @caution This method needs to be thread-safe since KRunner will simply start a new thread for each new term.
- Warning
- Returning from this method means to end execution of the runner.
Definition at line 331 of file abstractrunner.cpp.
◆ matchingSuspended
|
signal |
Emitted when the runner enters or exits match suspension.
- See also
- matchingSuspended
- Since
- 4.6
◆ matchRegex()
QRegularExpression Plasma::AbstractRunner::matchRegex | ( | ) | const |
If this regex is set with a not empty pattern it must match the query in order for the performMatch/match being called.
Just like the minLetterCount property this check is ignored when the runner is in the singleRunnerMode. In case both the regex and the letter count is set the letter count is checked first.
- Returns
- matchRegex property
- See also
- hasMatchRegex
- Since
- 5.75
◆ metadata() [1/2]
KPluginInfo Plasma::AbstractRunner::metadata | ( | ) | const |
- Returns
- the plugin info for this runner
- Deprecated:
- since 5.72, use metaData(Plasma::RunnerReturnPluginMetaDataConstant) instead, see its API docs
Definition at line 372 of file abstractrunner.cpp.
◆ metadata() [2/2]
KPluginMetaData Plasma::AbstractRunner::metadata | ( | RunnerReturnPluginMetaDataConstant | ) | const |
- Returns
- the plugin metadata for this runner
Overload to get non-deprecated metadata format. Use like this:
If you disable the deprecated version using the KRUNNER_DISABLE_DEPRECATED_BEFORE_AND_AT macro, then you can omit Plasma::RunnerReturnPluginMetaDataConstant and use it like this:
- Since
- 5.72
Definition at line 381 of file abstractrunner.cpp.
◆ mimeDataForMatch()
|
protectedvirtual |
Reimplement this slot if you want your runner to support serialization and drag and drop.
- Since
- 4.5
Definition at line 231 of file abstractrunner.cpp.
◆ minLetterCount()
int Plasma::AbstractRunner::minLetterCount | ( | ) | const |
This is the minimum letter count for the query.
If the query is shorter than this value and KRunner is not in the singleRunnerMode, the performMatch and consequently match method is not called. This can be set using the X-Plasma-Runner-Min-Letter-Count property or the setMinLetterCount method.
- See also
- setMinLetterCount
- match
- performMatch
- Returns
- minLetterCount property
- Since
- 5.75
◆ name()
QString Plasma::AbstractRunner::name | ( | ) | const |
- Returns
- the user visible engine name for the Runner
◆ package()
Package Plasma::AbstractRunner::package | ( | ) | const |
Accessor for the associated Package object if any.
Note that the returned pointer is only valid for the lifetime of the runner.
- Returns
- the Package object, which may be invalid
- Deprecated:
- since 5.28, use KPackage::Package instead, no accessor in this class
Definition at line 387 of file abstractrunner.cpp.
◆ performMatch()
void Plasma::AbstractRunner::performMatch | ( | Plasma::RunnerContext & | context | ) |
Triggers a call to match.
This will call match() internally.
- Parameters
-
context the search context used in executing this match.
- Deprecated:
- Since 5.81, use match(Plasma::RunnerContext &context) instead. This method contains logic to delay slow runners, which is now deprecated. Consequently you should call match(Plasma::RunnerContext &context) directly.
Definition at line 156 of file abstractrunner.cpp.
◆ prepare
|
signal |
This signal is emitted when matching is about to commence, giving runners an opportunity to prepare themselves, e.g.
loading data sets or preparing IPC or network connections. This method should be fast so as not to cause slow downs. Things that take longer or which should be loaded once and remain extant for the lifespan of the AbstractRunner should be done in init().
- See also
- init()
- Since
- 4.4
◆ priority()
AbstractRunner::Priority Plasma::AbstractRunner::priority | ( | ) | const |
◆ reloadConfiguration()
|
virtual |
Signal runner to reload its configuration.
Definition at line 111 of file abstractrunner.cpp.
◆ removeAction()
|
protected |
Removes the action from the action registry.
AbstractRunner deletes the action once removed.
- Parameters
-
id The id of the action to be removed
- Deprecated:
- Since 5.86, deprecated for lack of usage
Definition at line 208 of file abstractrunner.cpp.
◆ run()
|
virtual |
Called whenever an exact or possible match associated with this runner is triggered.
- Parameters
-
context The context in which the match is triggered, i.e. for which the match was created. match The actual match to run/execute.
Definition at line 311 of file abstractrunner.cpp.
◆ setDefaultSyntax()
|
protected |
Set syntax
as the default syntax for the runner; the default syntax will be substituted to the empty query in single runner mode.
This is also used to display to the user what this runner can understand and how it can be used. The default syntax is automatically added to the list of registered syntaxes, there is no need to add it using addSyntax. Note that there can be only one default syntax; if called more than once, the last call will determine the default syntax. A default syntax (even trivial) is required to advertise single runner mode
- Parameters
-
syntax the syntax to register and to set as default
- Since
- 4.4
- Deprecated:
- Since 5.76, feature is unused. Use addSyntax() instead.
Definition at line 131 of file abstractrunner.cpp.
◆ setHasRunOptions()
|
protected |
Sets whether or not the runner has options for matches.
- Deprecated:
- Since 5.0, this feature has been defunct
Definition at line 249 of file abstractrunner.cpp.
◆ setIgnoredTypes()
void Plasma::AbstractRunner::setIgnoredTypes | ( | RunnerContext::Types | types | ) |
Sets the types this runner will ignore.
If the value from RunnerContext::type() is contained in the ignored types the match() method won't be called. This way there is no unnecessary thread spawned. The same RunnerContext from which the type gets read is later passed into the match(Plasma::RunnerContext &context) method call.
- Parameters
-
types OR'ed listed of ignored types
- Deprecated:
- feature is deprecated. Consider using the minLetterCount and matchRegex properties instead. These properties also prevent thread spawning, but can be used far more precise. If you want to have this kind of optimization for older KRunner versions you could wrap this inside of an version if statement:
The minLetterCount and matchRegex can be set with a similar version check or added to the desktop file. If an older KRunner version loads such a desktop file these unknown properties are just ignored.
- See also
- minLetterCount
- matchRegex
Definition at line 305 of file abstractrunner.cpp.
◆ setMatchRegex()
void Plasma::AbstractRunner::setMatchRegex | ( | const QRegularExpression & | regex | ) |
Set the matchRegex property.
- Parameters
-
regex
- Since
- 5.75
Definition at line 439 of file abstractrunner.cpp.
◆ setMinLetterCount()
void Plasma::AbstractRunner::setMinLetterCount | ( | int | count | ) |
Set the minLetterCount property.
- Parameters
-
count
- Since
- 5.75
Definition at line 429 of file abstractrunner.cpp.
◆ setPriority()
|
protected |
Sets the priority of the runner.
Lower priority runners are executed only after higher priority runners.
Definition at line 292 of file abstractrunner.cpp.
◆ setSpeed()
|
protected |
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 D-Bus should call this within their constructors.
- Deprecated:
- Since 5.81, the concept of delayed runners is deprecated. If you have resource or memory intensive tasks consider porting the runner to a D-Bus runner. Otherwise you can set the priority of the runner to LowPriority and implement the wait using a QTimer and an event loop. It is important to check if the RunnerContext is still valid after the waiting interval.
Definition at line 279 of file abstractrunner.cpp.
◆ setSyntaxes()
|
protected |
Sets the list of syntaxes; passing in an empty list effectively clears the syntaxes.
- Parameters
-
the syntaxes to register for this runner
- Since
- 4.3
Definition at line 138 of file abstractrunner.cpp.
◆ setTriggerWords()
void Plasma::AbstractRunner::setTriggerWords | ( | const QStringList & | triggerWords | ) |
Constructs internally a regex which requires the query to start with the trigger words.
Multiple words are concatenated with or, for instance: "^word1|word2|word3". The trigger words are internally escaped. Also the minLetterCount is set to the shortest word in the list.
- Since
- 5.75
- See also
- matchRegex
Definition at line 445 of file abstractrunner.cpp.
◆ speed()
AbstractRunner::Speed Plasma::AbstractRunner::speed | ( | ) | const |
The nominal speed of the runner.
- See also
- setSpeed
Definition at line 263 of file abstractrunner.cpp.
◆ suspendMatching()
|
protected |
Sets whether or not the runner is available for match requests.
Useful to prevent more thread spawning when the thread is in a busy state.
Definition at line 414 of file abstractrunner.cpp.
◆ syntaxes()
QList< RunnerSyntax > Plasma::AbstractRunner::syntaxes | ( | ) | const |
- Returns
- the syntaxes the runner has registered that it accepts and understands
- Since
- 4.3
Definition at line 143 of file abstractrunner.cpp.
◆ teardown
|
signal |
This signal is emitted when a session of matches is complete, giving runners the opportunity to tear down anything set up as a result of the prepare() method.
- Since
- 4.4
Friends And Related Function Documentation
◆ K_EXPORT_PLASMA_RUNNER
|
related |
Registers a runner plugin.
- Deprecated:
- Since 5.72, use K_EXPORT_PLASMA_RUNNER_WITH_JSON(classname, jsonFile) instead
Definition at line 723 of file abstractrunner.h.
◆ K_EXPORT_PLASMA_RUNNER_WITH_JSON
|
related |
Registers a runner plugin with JSON metadata.
- Parameters
-
classname name of the AbstractRunner derived class. jsonFile name of the JSON file to be compiled into the plugin as metadata
- Since
- 5.72
- Deprecated:
- Since 5.88 use K_PLUGIN_CLASS_WITH_JSON instead
Definition at line 740 of file abstractrunner.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 6 2023 04:18:08 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.