The RunnerManager class decides what installed runners are runnable, and their ratings.
More...
#include <KRunner/RunnerManager>
|
QStringList | history |
|
bool | historyEnabled |
|
QString | priorSearch |
|
bool | retainPriorSearch |
|
|
void | launchQuery (const QString &term) |
| Convenience version of above.
|
|
void | launchQuery (const QString &term, const QString &runnerId) |
| Launch a query, this will create threads and return immediately.
|
|
void | matchSessionComplete () |
| Call this method when the query session is finished for the time being.
|
|
void | reset () |
| Reset the current data and stops the query.
|
|
void | setupMatchSession () |
| Call this method when the runners should be prepared for a query session.
|
|
|
| RunnerManager (const QString &configFile, QObject *parent=nullptr) |
|
| RunnerManager (QObject *parent=nullptr) |
|
QList< QAction * > | actionsForMatch (const QueryMatch &match) |
| Retrieves the list of actions, if any, for a match.
|
|
void | enableKNotifyPluginWatcher () |
| If you call this method the manager will create a KConfigWatcher which reload its runners or the runner configuration when the settings in the KCM are edited.
|
|
QString | getHistorySuggestion (const QString &typedQuery) const |
| Get the suggested history entry for the typed query.
|
|
QStringList | history () const |
|
bool | historyEnabled () |
| If history completion is enabled, the default value is true.
|
|
void | loadRunner (const KPluginMetaData &pluginMetaData) |
| Attempts to add the AbstractRunner plugin represented by the plugin info passed in.
|
|
QList< QueryMatch > | matches () const |
| Retrieves all available matches found so far for the previously launched query.
|
|
QMimeData * | mimeDataForMatch (const QueryMatch &match) const |
|
QString | priorSearch () const |
| Get the suggested prior search for this runner.
|
|
QString | query () const |
|
void | reloadConfiguration () |
| Causes a reload of the current configuration.
|
|
void | removeFromHistory (int index) |
| Delete the given index from the history.
|
|
bool | retainPriorSearch () |
| If the prior search should be restored when KRunner is reopened.
|
|
void | run (const QueryMatch &match) |
| Runs a given match.
|
|
bool | runMatch (const QueryMatch &match) |
| Runs a given match.
|
|
AbstractRunner * | runner (const QString &pluginName) const |
| Finds and returns a loaded runner or NULL.
|
|
QList< AbstractRunner * > | runners () const |
|
RunnerContext * | searchContext () const |
| Retrieves the current context.
|
|
void | setAllowedRunners (const QStringList &runners) |
| Sets a whitelist for the plugins that can be loaded by this manager.
|
|
void | setPriorSearch (const QString &search) |
| Set the prior search for this runner.
|
|
The RunnerManager class decides what installed runners are runnable, and their ratings.
It is the main proxy to the runners.
◆ actionsForMatch()
QList< QAction * > Plasma::RunnerManager::actionsForMatch |
( |
const QueryMatch & |
match | ) |
|
Retrieves the list of actions, if any, for a match.
◆ enableKNotifyPluginWatcher()
void Plasma::RunnerManager::enableKNotifyPluginWatcher |
( |
| ) |
|
If you call this method the manager will create a KConfigWatcher which reload its runners or the runner configuration when the settings in the KCM are edited.
- Since
- 5.73
- See also
- reloadConfiguration
◆ getHistorySuggestion()
QString Plasma::RunnerManager::getHistorySuggestion |
( |
const QString & |
typedQuery | ) |
const |
Get the suggested history entry for the typed query.
If no entry is found an empty string is returned.
- Parameters
-
- Returns
- completion for typedQuery
- Since
- 5.78
◆ history()
QStringList Plasma::RunnerManager::history |
( |
| ) |
const |
- Returns
- History of this runner for the current activity. If the RunnerManager is not history aware the global entries will be returned.
- Since
- 5.78
◆ historyEnabled()
bool Plasma::RunnerManager::historyEnabled |
( |
| ) |
|
If history completion is enabled, the default value is true.
- Since
- 5.78
◆ historyEnabledChanged
void Plasma::RunnerManager::historyEnabledChanged |
( |
| ) |
|
|
signal |
- See also
historyEnabled
- Since
- 5.78
◆ launchQuery [1/2]
void Plasma::RunnerManager::launchQuery |
( |
const QString & |
term | ) |
|
|
slot |
Convenience version of above.
◆ launchQuery [2/2]
void Plasma::RunnerManager::launchQuery |
( |
const QString & |
term, |
|
|
const QString & |
runnerId |
|
) |
| |
|
slot |
Launch a query, this will create threads and return immediately.
When the information will be available can be known using the matchesChanged signal.
- Parameters
-
term | the term we want to find matches for |
runnerId | optional, if only one specific runner is to be used; providing an id will put the manager into single runner mode |
◆ loadRunner()
void Plasma::RunnerManager::loadRunner |
( |
const KPluginMetaData & |
pluginMetaData | ) |
|
Attempts to add the AbstractRunner plugin represented by the plugin info passed in.
Usually one can simply let the configuration of plugins handle loading Runner plugins, but in cases where specific runners should be loaded this allows for that to take place
- Parameters
-
pluginMetaData | the metaData to use to load the plugin |
- Since
- 5.72
◆ matches()
QList< QueryMatch > Plasma::RunnerManager::matches |
( |
| ) |
const |
Retrieves all available matches found so far for the previously launched query.
- Returns
- List of matches
◆ matchesChanged
Emitted each time a new match is added to the list.
◆ matchSessionComplete
void Plasma::RunnerManager::matchSessionComplete |
( |
| ) |
|
|
slot |
Call this method when the query session is finished for the time being.
- Since
- 4.4
- See also
- prepareForMatchSession
◆ mimeDataForMatch()
QMimeData * Plasma::RunnerManager::mimeDataForMatch |
( |
const QueryMatch & |
match | ) |
const |
- Returns
- mime data of the specified match
- Since
- 4.5
◆ priorSearch()
QString Plasma::RunnerManager::priorSearch |
( |
| ) |
const |
Get the suggested prior search for this runner.
Just like the history this value can be activity specific, depending on the build/config.
- Returns
- priorSearch
- Since
- 5.78
◆ query()
QString Plasma::RunnerManager::query |
( |
| ) |
const |
- Returns
- the current query term
◆ queryFinished
void Plasma::RunnerManager::queryFinished |
( |
| ) |
|
|
signal |
Emitted when the launchQuery finish.
- Since
- 4.5
◆ reloadConfiguration()
void Plasma::RunnerManager::reloadConfiguration |
( |
| ) |
|
Causes a reload of the current configuration.
◆ removeFromHistory()
void Plasma::RunnerManager::removeFromHistory |
( |
int |
index | ) |
|
Delete the given index from the history.
- Parameters
-
- Since
- 5.78
◆ reset
void Plasma::RunnerManager::reset |
( |
| ) |
|
|
slot |
Reset the current data and stops the query.
◆ retainPriorSearch()
bool Plasma::RunnerManager::retainPriorSearch |
( |
| ) |
|
If the prior search should be restored when KRunner is reopened.
- Since
- 5.78
◆ run()
void Plasma::RunnerManager::run |
( |
const QueryMatch & |
match | ) |
|
Runs a given match.
- Parameters
-
match | the match to be executed |
◆ runMatch()
bool Plasma::RunnerManager::runMatch |
( |
const QueryMatch & |
match | ) |
|
Runs a given match.
This also respects the extra handling for the InformationalMatch. This also handles the history automatically
- Parameters
-
match | the match to be executed |
- Returns
- if the RunnerWindow should close
- Since
- 5.78
◆ runner()
AbstractRunner * Plasma::RunnerManager::runner |
( |
const QString & |
pluginName | ) |
const |
Finds and returns a loaded runner or NULL.
- Parameters
-
pluginName | the name of the runner plugin |
- Returns
- Pointer to the runner
◆ runnerMetaDataList()
static QVector< KPluginMetaData > Plasma::RunnerManager::runnerMetaDataList |
( |
| ) |
|
|
static |
- Returns
- metadata list of all known Runner implementations
- Since
- 5.72
◆ runners()
- Returns
- the list of all currently loaded runners
◆ searchContext()
Retrieves the current context.
- Returns
- pointer to the current context
◆ setAllowedRunners()
void Plasma::RunnerManager::setAllowedRunners |
( |
const QStringList & |
runners | ) |
|
Sets a whitelist for the plugins that can be loaded by this manager.
- Parameters
-
plugins | the plugin names of allowed runners |
- Since
- 4.4
◆ setPriorSearch()
void Plasma::RunnerManager::setPriorSearch |
( |
const QString & |
search | ) |
|
Set the prior search for this runner.
Setting an empty string will clear this value.
- Since
- 5.78
◆ setSearchTerm
void Plasma::RunnerManager::setSearchTerm |
( |
const QString & |
term, |
|
|
int |
cursorPosition |
|
) |
| |
|
signal |
Put the given search term in the KRunner search field.
- Parameters
-
term | The term that should be displayed |
cursorPosition | Where the cursor should be positioned |
- Since
- 5.78
◆ setupMatchSession
void Plasma::RunnerManager::setupMatchSession |
( |
| ) |
|
|
slot |
Call this method when the runners should be prepared for a query session.
Call matchSessionComplete when the query session is finished for the time being.
- Since
- 4.4
- See also
- matchSessionComplete