KRunner::RunnerManager

Search for usage in LXR

#include <KRunner/RunnerManager>

Inheritance diagram for KRunner::RunnerManager:

Properties

QStringList history
 
bool historyEnabled
 
bool querying
 
- Properties inherited from QObject
 objectName
 

Signals

void historyEnabledChanged ()
 
void matchesChanged (const QList< KRunner::QueryMatch > &matches)
 
void queryFinished ()
 
void queryingChanged ()
 
void requestUpdateQueryString (const QString &term, int cursorPosition)
 

Public Slots

void launchQuery (const QString &term, const QString &runnerId=QString())
 
void matchSessionComplete ()
 
void reset ()
 
Q_INVOKABLE void setHistoryEnvironmentIdentifier (const QString &identifier)
 
void setupMatchSession ()
 

Public Member Functions

 RunnerManager (const KConfigGroup &pluginConfigGroup, const KConfigGroup &stateGroup, QObject *parent)
 
 RunnerManager (QObject *parent=nullptr)
 
Q_INVOKABLE QString getHistorySuggestion (const QString &typedQuery) const
 
QStringList history () const
 
bool historyEnabled ()
 
AbstractRunnerloadRunner (const KPluginMetaData &pluginMetaData)
 
QList< QueryMatchmatches () const
 
QMimeDatamimeDataForMatch (const QueryMatch &match) const
 
QString query () const
 
bool querying () const
 
void reloadConfiguration ()
 
Q_INVOKABLE void removeFromHistory (int index)
 
bool run (const QueryMatch &match, const KRunner::Action &action={})
 
AbstractRunnerrunner (const QString &pluginId) const
 
QList< AbstractRunner * > runners () const
 
RunnerContextsearchContext () const
 
void setAllowedRunners (const QStringList &runners)
 
void setHistoryEnabled (bool enabled)
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
QBindable< QStringbindableObjectName ()
 
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 () const const
 
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 QRegularExpression &re, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isQuickItemType () const const
 
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_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_GADGET_EXPORT (EXPORT_MACRO)
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_MOC_INCLUDE Q_MOC_INCLUDE
 
 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
 
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 setObjectName (QAnyStringView name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool setProperty (const char *name, QVariant &&value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds interval, Qt::TimerType timerType)
 
QThreadthread () const const
 

Static Public Member Functions

static QList< KPluginMetaDatarunnerMetaDataList ()
 
- 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)
 

Additional Inherited Members

- Public Types 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 42 of file runnermanager.h.

Property Documentation

◆ history

QStringList KRunner::RunnerManager::history
read

Definition at line 45 of file runnermanager.h.

◆ historyEnabled

bool KRunner::RunnerManager::historyEnabled
readwrite

Definition at line 47 of file runnermanager.h.

◆ querying

bool KRunner::RunnerManager::querying
read

Definition at line 46 of file runnermanager.h.

Constructor & Destructor Documentation

◆ RunnerManager() [1/2]

KRunner::RunnerManager::RunnerManager ( const KConfigGroup & pluginConfigGroup,
const KConfigGroup & stateGroup,
QObject * parent )
explicit

Constructs a RunnerManager with the given parameters.

Parameters
configurationGroupConfig group used for reading enabled plugins
stateGroupConfig group used for storing history
Since
6.0

Definition at line 388 of file runnermanager.cpp.

◆ RunnerManager() [2/2]

KRunner::RunnerManager::RunnerManager ( QObject * parent = nullptr)
explicit

Constructs a RunnerManager using the default locations for state/plugin config.

Definition at line 396 of file runnermanager.cpp.

◆ ~RunnerManager()

KRunner::RunnerManager::~RunnerManager ( )
override

Definition at line 406 of file runnermanager.cpp.

Member Function Documentation

◆ getHistorySuggestion()

QString KRunner::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 662 of file runnermanager.cpp.

◆ history()

QStringList KRunner::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

Definition at line 648 of file runnermanager.cpp.

◆ historyEnabled()

bool KRunner::RunnerManager::historyEnabled ( )

If history completion is enabled, the default value is true.

Since
5.78

◆ historyEnabledChanged

void KRunner::RunnerManager::historyEnabledChanged ( )
signal
See also
historyEnabled
Since
5.78

◆ launchQuery

void KRunner::RunnerManager::launchQuery ( const QString & term,
const QString & runnerId = QString() )
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 558 of file runnermanager.cpp.

◆ loadRunner()

AbstractRunner * KRunner::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

Note
Consider using setAllowedRunners in case you want to only allow specific runners
Parameters
pluginMetaDatathe metaData to use to load the plugin
Returns
the loaded runner or nullptr

Definition at line 429 of file runnermanager.cpp.

◆ matches()

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

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

Returns
List of matches

Definition at line 466 of file runnermanager.cpp.

◆ matchesChanged

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

Emitted each time a new match is added to the list.

◆ matchSessionComplete

void KRunner::RunnerManager::matchSessionComplete ( )
slot

Call this method when the query session is finished for the time being.

See also
prepareForMatchSession

Definition at line 546 of file runnermanager.cpp.

◆ mimeDataForMatch()

QMimeData * KRunner::RunnerManager::mimeDataForMatch ( const QueryMatch & match) const
Returns
mime data of the specified match

Definition at line 495 of file runnermanager.cpp.

◆ query()

QString KRunner::RunnerManager::query ( ) const
Returns
the current query term set in launchQuery

Definition at line 643 of file runnermanager.cpp.

◆ queryFinished

void KRunner::RunnerManager::queryFinished ( )
signal

Emitted when the launchQuery finish.

◆ querying()

bool KRunner::RunnerManager::querying ( ) const

If the RunnerManager is currently querying.

Since
6.7

Definition at line 692 of file runnermanager.cpp.

◆ queryingChanged

void KRunner::RunnerManager::queryingChanged ( )
signal

Emitted when the querying status has changed.

Since
6.7

◆ reloadConfiguration()

void KRunner::RunnerManager::reloadConfiguration ( )

Causes a reload of the current configuration This gets called automatically when the config in the KCM is saved.

Definition at line 412 of file runnermanager.cpp.

◆ removeFromHistory()

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

Delete the given index from the history.

Parameters
historyEntry
Since
5.78

Definition at line 653 of file runnermanager.cpp.

◆ requestUpdateQueryString

void KRunner::RunnerManager::requestUpdateQueryString ( 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
6.0

◆ reset

void KRunner::RunnerManager::reset ( )
slot

Reset the current data and stops the query.

Definition at line 673 of file runnermanager.cpp.

◆ run()

bool KRunner::RunnerManager::run ( const QueryMatch & match,
const KRunner::Action & action = {} )

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
selectedActionthe action returned by QueryMatch::actions that has been selected by the user, nullptr if none
Returns
if the RunnerWindow should close
Since
6.0

Definition at line 471 of file runnermanager.cpp.

◆ runner()

AbstractRunner * KRunner::RunnerManager::runner ( const QString & pluginId) const

Finds and returns a loaded runner or a nullptr.

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

Definition at line 444 of file runnermanager.cpp.

◆ runnerMetaDataList()

QList< KPluginMetaData > KRunner::RunnerManager::runnerMetaDataList ( )
static
Returns
metadata list of all known Runner plugins
Since
5.72

Definition at line 500 of file runnermanager.cpp.

◆ runners()

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

Definition at line 453 of file runnermanager.cpp.

◆ searchContext()

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

Retrieves the current context.

Returns
pointer to the current context

Definition at line 461 of file runnermanager.cpp.

◆ setAllowedRunners()

void KRunner::RunnerManager::setAllowedRunners ( const QStringList & runners)

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

Runners that are disabled through the config will not be loaded.

Parameters
pluginsthe plugin names of allowed runners

Definition at line 420 of file runnermanager.cpp.

◆ setHistoryEnabled()

void KRunner::RunnerManager::setHistoryEnabled ( bool enabled)

Enables/disabled the history feature for the RunnerManager instance.

The value will not be persisted and is only kept during the object's lifetime.

Since
6.0

Definition at line 697 of file runnermanager.cpp.

◆ setHistoryEnvironmentIdentifier

void KRunner::RunnerManager::setHistoryEnvironmentIdentifier ( const QString & identifier)
slot

Set the environment identifier for recording history and launch counts.

Since
6.0

Definition at line 708 of file runnermanager.cpp.

◆ setupMatchSession

void KRunner::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.

See also
matchSessionComplete

Definition at line 523 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-2024 The KDE developers.
Generated on Fri Oct 11 2024 12:20:38 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.