Plasma::RunnerManager

Search for usage in LXR

#include <KRunner/RunnerManager>

Inheritance diagram for Plasma::RunnerManager:

Properties

QStringList history
 
bool historyEnabled
 
QString priorSearch
 
bool retainPriorSearch
 
- Properties inherited from QObject
 objectName
 

Signals

void historyEnabledChanged ()
 
void matchesChanged (const QList< Plasma::QueryMatch > &matches)
 
void queryFinished ()
 
void setSearchTerm (const QString &term, int cursorPosition)
 

Public Slots

void launchQuery (const QString &term)
 
void launchQuery (const QString &term, const QString &runnerId)
 
void matchSessionComplete ()
 
void reset ()
 
void setupMatchSession ()
 

Public Member Functions

 RunnerManager (const QString &configFile, QObject *parent=nullptr)
 
 RunnerManager (KConfigGroup &config, QObject *parent=nullptr)
 
 RunnerManager (QObject *parent=nullptr)
 
QList< QAction * > actionsForMatch (const QueryMatch &match)
 
QStringList allowedRunners () const
 
QStringList enabledCategories () const
 
void enableKNotifyPluginWatcher ()
 
Q_INVOKABLE QString getHistorySuggestion (const QString &typedQuery) const
 
QStringList history () const
 
bool historyEnabled ()
 
void loadRunner (const KPluginMetaData &pluginMetaData)
 
void loadRunner (const KService::Ptr service)
 
void loadRunner (const QString &path)
 
QList< QueryMatchmatches () const
 
QMimeDatamimeDataForMatch (const QString &matchId) const
 
QMimeDatamimeDataForMatch (const QueryMatch &match) const
 
QString priorSearch () const
 
QString query () const
 
void reloadConfiguration ()
 
Q_INVOKABLE void removeFromHistory (int index)
 
bool retainPriorSearch ()
 
void run (const QString &id)
 
void run (const QueryMatch &match)
 
bool runMatch (const QueryMatch &match)
 
AbstractRunnerrunner (const QString &pluginName) const
 
QString runnerName (const QString &id) const
 
QList< AbstractRunner * > runners () const
 
RunnerContextsearchContext () const
 
void setAllowedRunners (const QStringList &runners)
 
void setEnabledCategories (const QStringList &categories)
 
void setPriorSearch (const QString &search)
 
void setSingleMode (bool singleMode)
 
void setSingleModeRunnerId (const QString &id)
 
bool singleMode () const
 
QStringList singleModeAdvertisedRunnerIds () const
 
AbstractRunnersingleModeRunner () const
 
QString singleModeRunnerId () const
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
bool blockSignals (bool block)
 
const QObjectListchildren () 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< QByteArraydynamicPropertyNames () const const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegExp &regExp, 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 QMetaObjectmetaObject () const const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const const
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () 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
 
qFindChild (const QObject *obj, const QString &name)
 
QList< T > qFindChildren (const QObject *obj, const QRegExp &regExp)
 
QList< T > qFindChildren (const QObject *obj, const QString &name)
 
qobject_cast (const QObject *object)
 
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)
 
QThreadthread () const const
 

Static Public Member Functions

static KPluginInfo::List listRunnerInfo (const QString &parentApp=QString())
 
static QVector< KPluginMetaDatarunnerMetaDataList ()
 
static QVector< KPluginMetaDatarunnerMetaDataList (const QString &parentApp)
 
- Static Public Member Functions inherited from QObject
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)
 

Additional Inherited Members

- Public Attributes inherited from QObject
typedef QObjectList
 
- Protected Member Functions inherited from QObject
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
 
QObjectsender () const const
 
int senderSignalIndex () const const
 
virtual void timerEvent (QTimerEvent *event)
 

Detailed Description

The RunnerManager class decides what installed runners are runnable, and their ratings. It is the main proxy to the runners.

Definition at line 46 of file runnermanager.h.

Constructor & Destructor Documentation

◆ RunnerManager()

Plasma::RunnerManager::RunnerManager ( KConfigGroup config,
QObject parent = nullptr 
)
explicit
Deprecated:
Since 5.76, use "RunnerManager(const QString &configFile, QObject *parent)" instead.

Definition at line 558 of file runnermanager.cpp.

Member Function Documentation

◆ actionsForMatch()

QList< QAction * > Plasma::RunnerManager::actionsForMatch ( const QueryMatch match)

Retrieves the list of actions, if any, for a match.

Definition at line 792 of file runnermanager.cpp.

◆ allowedRunners()

QStringList Plasma::RunnerManager::allowedRunners ( ) const
Returns
the list of allowed plugins
Since
4.4
Deprecated:
Since 5.88, reading allowed runners from the config is deprecated, use runners() and get their AbstractRunner::id instead

Definition at line 611 of file runnermanager.cpp.

◆ enabledCategories()

QStringList Plasma::RunnerManager::enabledCategories ( ) const
Returns
the list of enabled categories
Deprecated:
Since 5.76, feature is unused and not supported by most runners

Definition at line 618 of file runnermanager.cpp.

◆ 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

Definition at line 1086 of file runnermanager.cpp.

◆ 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
typedQuery
Returns
completion for typedQuery
Since
5.78

Definition at line 1050 of file runnermanager.cpp.

◆ 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.

Definition at line 950 of file runnermanager.cpp.

◆ 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
termthe term we want to find matches for
runnerIdoptional, if only one specific runner is to be used; providing an id will put the manager into single runner mode

Definition at line 955 of file runnermanager.cpp.

◆ listRunnerInfo()

KPluginInfo::List Plasma::RunnerManager::listRunnerInfo ( const QString parentApp = QString())
static

Returns a list of all known Runner implementations.

Parameters
parentAppthe application to filter applets on. Uses the X-KDE-ParentApp entry (if any) in the plugin info. The default value of QString() will result in a list containing only applets not specifically registered to an application.
Returns
list of AbstractRunners
Since
4.6
Deprecated:
since 5.72, use runnerMetaDataList() instead

Definition at line 903 of file runnermanager.cpp.

◆ loadRunner() [1/3]

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
pluginMetaDatathe metaData to use to load the plugin
Since
5.72

Definition at line 644 of file runnermanager.cpp.

◆ loadRunner() [2/3]

void Plasma::RunnerManager::loadRunner ( const KService::Ptr  service)

Attempts to add the AbstractRunner plugin represented by the KService 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
servicethe service to use to load the plugin
Since
4.5
Deprecated:
Since 5.72, use loadRunner(const KPluginMetaData &)

◆ loadRunner() [3/3]

void Plasma::RunnerManager::loadRunner ( const QString path)

Attempts to add the AbstractRunner from a Plasma::Package on disk.

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
paththe path to a Runner package to load
Since
4.5
Deprecated:
Since 5.0, the KPackage support was removed in Plasma 5.0

Definition at line 655 of file runnermanager.cpp.

◆ matches()

QList< QueryMatch > Plasma::RunnerManager::matches ( ) const

Retrieves all available matches found so far for the previously launched query.

Returns
List of matches

Definition at line 748 of file runnermanager.cpp.

◆ matchesChanged

void Plasma::RunnerManager::matchesChanged ( const QList< Plasma::QueryMatch > &  matches)
signal

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

Definition at line 937 of file runnermanager.cpp.

◆ mimeDataForMatch() [1/2]

QMimeData * Plasma::RunnerManager::mimeDataForMatch ( const QString matchId) const
Returns
mime data of the specified match
Since
4.5
Deprecated:
Since 5.79, use mimeDataForMatch(const QueryMatch &match) instead

Definition at line 802 of file runnermanager.cpp.

◆ mimeDataForMatch() [2/2]

QMimeData * Plasma::RunnerManager::mimeDataForMatch ( const QueryMatch match) const
Returns
mime data of the specified match
Since
4.5

Definition at line 808 of file runnermanager.cpp.

◆ 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

Definition at line 1031 of file runnermanager.cpp.

◆ 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.

Definition at line 581 of file runnermanager.cpp.

◆ removeFromHistory()

void Plasma::RunnerManager::removeFromHistory ( int  index)

Delete the given index from the history.

Parameters
historyEntry
Since
5.78

Definition at line 1041 of file runnermanager.cpp.

◆ reset

void Plasma::RunnerManager::reset ( )
slot

Reset the current data and stops the query.

Definition at line 1061 of file runnermanager.cpp.

◆ retainPriorSearch()

bool Plasma::RunnerManager::retainPriorSearch ( )

If the prior search should be restored when KRunner is reopened.

Since
5.78

◆ run() [1/2]

void Plasma::RunnerManager::run ( const QString id)

Runs a given match.

Parameters
idthe id of the match to run
Deprecated:
Since 5.79, use run(const QueryMatch &match) instead

Definition at line 754 of file runnermanager.cpp.

◆ run() [2/2]

void Plasma::RunnerManager::run ( const QueryMatch match)

Runs a given match.

Parameters
matchthe match to be executed

Definition at line 760 of file runnermanager.cpp.

◆ 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
matchthe match to be executed
Returns
if the RunnerWindow should close
Since
5.78

Definition at line 767 of file runnermanager.cpp.

◆ runner()

AbstractRunner * Plasma::RunnerManager::runner ( const QString pluginName) const

Finds and returns a loaded runner or NULL.

Parameters
pluginNamethe name of the runner plugin
Returns
Pointer to the runner

Definition at line 667 of file runnermanager.cpp.

◆ runnerMetaDataList() [1/2]

QVector< KPluginMetaData > Plasma::RunnerManager::runnerMetaDataList ( )
static
Returns
metadata list of all known Runner implementations
Since
5.72

Definition at line 863 of file runnermanager.cpp.

◆ runnerMetaDataList() [2/2]

QVector< KPluginMetaData > Plasma::RunnerManager::runnerMetaDataList ( const QString parentApp)
static

Returns a list of all known Runner implementations.

Parameters
parentAppthe application to filter runners on. Uses the X-KDE-ParentApp entry (if any) in the plugin metadata. The default value of QString() will result in a list containing only runners not specifically registered to an application.
Returns
list of metadata of known runners
Since
5.72
Deprecated:
Since 5.85, the concept of parent apps for runners is deprecated, use no-arg overload instead

Definition at line 814 of file runnermanager.cpp.

◆ runnerName()

QString Plasma::RunnerManager::runnerName ( const QString id) const

Returns the translated name of a runner.

Parameters
idthe id of the runner
Since
4.4
Deprecated:
Since 5.81, call runner(const QString &id) and fetch the name from the returned object instead

Definition at line 731 of file runnermanager.cpp.

◆ runners()

QList< AbstractRunner * > Plasma::RunnerManager::runners ( ) const
Returns
the list of all currently loaded runners

Definition at line 737 of file runnermanager.cpp.

◆ searchContext()

RunnerContext * Plasma::RunnerManager::searchContext ( ) const

Retrieves the current context.

Returns
pointer to the current context

Definition at line 742 of file runnermanager.cpp.

◆ setAllowedRunners()

void Plasma::RunnerManager::setAllowedRunners ( const QStringList runners)

Sets a whitelist for the plugins that can be loaded by this manager.

Parameters
pluginsthe plugin names of allowed runners
Since
4.4

Definition at line 589 of file runnermanager.cpp.

◆ setEnabledCategories()

void Plasma::RunnerManager::setEnabledCategories ( const QStringList categories)

Sets the list of categories which matches should be returned for.

It also internally tries not to execute the runners which do not fall in this category.

Deprecated:
Since 5.76, feature is unused and not supported by most runners

Definition at line 599 of file runnermanager.cpp.

◆ 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

Definition at line 1118 of file runnermanager.cpp.

◆ setSearchTerm

void Plasma::RunnerManager::setSearchTerm ( const QString term,
int  cursorPosition 
)
signal

Put the given search term in the KRunner search field.

Parameters
termThe term that should be displayed
cursorPositionWhere the cursor should be positioned
Since
5.78

◆ setSingleMode()

void Plasma::RunnerManager::setSingleMode ( bool  singleMode)

Sets whether or not the manager is in single mode.

Parameters
singleModetrue if the manager should be in single mode, false otherwise
Since
4.4
Deprecated:
Since 5.82, the dedicated singleRunnerMode methods are deprecated, the single mode is set to true when launchQuery is called with a non empty and existing runnerId

Definition at line 698 of file runnermanager.cpp.

◆ setSingleModeRunnerId()

void Plasma::RunnerManager::setSingleModeRunnerId ( const QString id)

Puts the manager into "single runner" mode using the given runner; if the runner does not exist or can not be loaded then the single runner mode will not be started and singleModeRunner() will return NULL.

Parameters
idthe id of the runner to use
Since
4.4
Deprecated:
Since 5.82, the dedicated singleRunnerMode methods are deprecated, pass in the singleModeRunnerId into the launchQuery overload instead

Definition at line 682 of file runnermanager.cpp.

◆ 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

Definition at line 912 of file runnermanager.cpp.

◆ singleMode()

bool Plasma::RunnerManager::singleMode ( ) const
Returns
true if the manager is set to run in single runner mode
Since
4.4
Deprecated:
Since 5.82, the dedicated singleRunnerMode methods are deprecated, call the RunnerContext::singleRunnerQueryMode on the searchContext instead

Definition at line 693 of file runnermanager.cpp.

◆ singleModeAdvertisedRunnerIds()

QStringList Plasma::RunnerManager::singleModeAdvertisedRunnerIds ( ) const
Returns
the names of all runners that advertise single query mode
Since
4.4
Deprecated:
Since 5.81, filter the runners manually using the X-Plasma-AdvertiseSingleRunnerQueryMode of the metadata

Definition at line 720 of file runnermanager.cpp.

◆ singleModeRunner()

AbstractRunner * Plasma::RunnerManager::singleModeRunner ( ) const
Returns
the currently active "single mode" runner, or null if none
Since
4.4
Deprecated:
Since 5.81, the dedicated singleRunnerMode methods are deprecated, use runner(const QString &pluginName) with the singleRunnerId instead"

Definition at line 677 of file runnermanager.cpp.

◆ singleModeRunnerId()

QString Plasma::RunnerManager::singleModeRunnerId ( ) const
Returns
the id of the runner to use in single mode
Since
4.4
Deprecated:
Since 5.82, the dedicated singleRunnerMode methods are deprecated, use runner(const QString &pluginName) with the singleRunnerId instead

Definition at line 688 of file runnermanager.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Fri Dec 1 2023 03:51:24 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.