KRunner
runnermanager.cpp
55 qCWarning(KRUNNER).nospace() << "KRunner plugin " << pluginInfo.pluginName() << " still uses a .desktop file (" << pluginInfo.entryPath()
58 qCWarning(KRUNNER).nospace() << "KRunner D-Bus plugin " << pluginInfo.pluginName() << " installs the .desktop file (" << pluginInfo.entryPath()
59 << ") still in the kservices5 folder. Please install it to ${KDE_INSTALL_DATAROOTDIR}/krunner/dbusplugins.";
71 matchChangeTimer.setTimerType(Qt::TimerType::PreciseTimer); // Without this, autotest will fail due to imprecision of this timer
95 // This will tell us if we are reseting the matches to start a new search. RunnerContext::reset() clears its query string for its emission
100 // We are starting a new search, we shall stall for some time before deciding to show an empty matches list.
101 // This stall should be enough for the engine to provide more meaningful result, so we avoid refreshing with
107 // We have an empty input string, so it's not a real query. We don't expect any results to come, so no need to stall
127 DefaultRunnerPolicy::instance().setCap(qMax(2, Queue::instance()->maximumNumberOfThreads() / 2));
191 qCDebug(KRUNNER) << description.pluginId() << "The TryExec property is deprecated, manually check if the application exists if needed";
202 bool selected = loadAll || disabledRunnerIds.contains(runnerName) || (isPluginEnabled && (noWhiteList || whiteList.contains(runnerName)));
307 qCWarning(KRUNNER).nospace() << "Could not load runner " << pluginMetaData.name() << ":" << res.errorString
342 // If there are any new matches scheduled to be notified, we should anticipate it and just refresh right now
423 QObject::connect(job.data(), &FindMatchesJob::done, q, [this](ThreadWeaver::JobPointer jobPtr) {
552 KSharedConfig::openConfig(QStringLiteral("krunnerstaterc"), KConfig::NoGlobals, QStandardPaths::GenericDataLocation)->group("PlasmaRunnerManager");
724 if (runner->metadata(RunnerReturnPluginMetaData).rawData().value(QStringLiteral("X-Plasma-AdvertiseSingleRunnerQueryMode")).toVariant().toBool()) {
822 QVector<KPluginMetaData> pluginMetaDatas = KPluginMetaData::findPlugins(QStringLiteral("kf5/krunner"), filterParentApp);
830 QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("krunner/dbusplugins"), QStandardPaths::LocateDirectory);
831 const QStringList dbusRunnerFiles = KFileUtils::findAllUniqueFiles(dBusPlugindirs, QStringList(QStringLiteral("*.desktop")));
842 const QString constraint = parentApp.isEmpty() ? QStringLiteral("not exist [X-KDE-ParentApp] or [X-KDE-ParentApp] == ''")
847 const KService::List offers = KServiceTypeTrader::self()->query(QStringLiteral("Plasma/Runner"), constraint);
865 QVector<KPluginMetaData> pluginMetaDatas = KPluginMetaData::findPlugins(QStringLiteral("kf" QT_STRINGIFY(QT_VERSION_MAJOR) "/krunner"));
873 QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("krunner/dbusplugins"), QStandardPaths::LocateDirectory);
874 const QStringList dbusRunnerFiles = KFileUtils::findAllUniqueFiles(dBusPlugindirs, QStringList(QStringLiteral("*.desktop")));
887 const KService::List offers = KServiceTypeTrader::self()->query(QStringLiteral("Plasma/Runner"));
1090 connect(d->watcher.data(), &KConfigWatcher::configChanged, this, [this](const KConfigGroup &group, const QByteArrayList &changedNames) {
QString readEntry(const char *key, const char *aDefault=nullptr) const
std::optional< QSqlQuery > query(const QString &queryStatement)
QList< QAction * > actionsForMatch(const QueryMatch &match)
Retrieves the list of actions, if any, for a match.
Definition: runnermanager.cpp:792
bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *method)
LocateDirectory
AbstractRunner * singleModeRunner() const
Definition: runnermanager.cpp:677
static KPluginInfo::List fromServices(const KService::List &services, const KConfigGroup &config=KConfigGroup())
void deleteEntry(const char *key, WriteConfigFlags pFlags=Normal)
void setSingleMode(bool singleMode)
Sets whether or not the manager is in single mode.
Definition: runnermanager.cpp:698
NoGlobals
void setupMatchSession()
Call this method when the runners should be prepared for a query session.
Definition: runnermanager.cpp:912
CaseInsensitive
QVariant fromValue(const T &value)
QString libraryPath() const
Q_EMITQ_EMIT
QList< AbstractRunner * > runners() const
Definition: runnermanager.cpp:737
void configChanged(const KConfigGroup &group, const QByteArrayList &names)
singleShot
QString metaDataFileName() const
int count(const T &value) const const
@ InformationalMatch
A purely informational, non-runnable match, such as the answer to a question or calculation.
Definition: querymatch.h:50
int length() const const
QString trimmed() const const
void append(const T &value)
void reserve(int size)
A match returned by an AbstractRunner in response to a given RunnerContext.
Definition: querymatch.h:34
bool isValid() const
QString fileName() const
void reloadConfiguration()
Causes a reload of the current configuration.
Definition: runnermanager.cpp:581
An abstract base class for Plasma Runner plugins.
Definition: abstractrunner.h:68
static KPluginInfo fromMetaData(const KPluginMetaData &meta)
void loadRunner(const KService::Ptr service)
Attempts to add the AbstractRunner plugin represented by the KService passed in.
Notify
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
void matchesChanged(const QList< Plasma::QueryMatch > &matches)
Emitted each time a new match is added to the list.
QHash::iterator insert(const Key &key, const T &value)
void removeAt(int i)
QString findExecutable(const QString &executableName, const QStringList &paths)
void reserve(int alloc)
void removeLast()
bool exists() const
void setSingleModeRunnerId(const QString &id)
Puts the manager into "single runner" mode using the given runner; if the runner does not exist or ca...
Definition: runnermanager.cpp:682
void prepend(const T &value)
QString pluginName() const
void setAllowedRunners(const QStringList &runners)
Sets a whitelist for the plugins that can be loaded by this manager.
Definition: runnermanager.cpp:589
bool removeOne(const T &value)
QString name() const
void timeout()
bool isEmpty() const const
void setSearchTerm(const QString &term, int cursorPosition)
Put the given search term in the KRunner search field.
int length() const const
QStringList singleModeAdvertisedRunnerIds() const
Definition: runnermanager.cpp:720
RunnerContext * searchContext() const
Retrieves the current context.
Definition: runnermanager.cpp:742
QString entryPath() const
static Ptr create(const KSharedConfig::Ptr &config)
Q_SCRIPTABLE CaptureState status()
KConfigGroup group(const char *group)
bool isEmpty() const const
AbstractRunner * runner(const QString &pluginName) const
Finds and returns a loaded runner or NULL.
Definition: runnermanager.cpp:667
static KServiceTypeTrader * self()
QSet::iterator begin()
bool contains(const T &value) const const
bool value(const QString &key, bool defaultValue) const
QString & remove(int position, int n)
static QVector< KPluginMetaData > findPlugins(const QString &directory, std::function< bool(const KPluginMetaData &)> filter, KPluginMetaDataOption option)
QMimeData * mimeDataForMatch(const QueryMatch &match) const
Definition: runnermanager.cpp:808
bool startsWith(const QString &s, Qt::CaseSensitivity cs) const const
virtual QStringList categories() const
Return a list of categories that this runner provides.
Definition: abstractrunner.cpp:318
QStringList allowedRunners() const
Definition: runnermanager.cpp:611
QString singleModeRunnerId() const
Definition: runnermanager.cpp:688
Q_INVOKABLE void removeFromHistory(int index)
Delete the given index from the history.
Definition: runnermanager.cpp:1041
GenericDataLocation
int count() const const
QStringList keyList() const
QString & insert(int position, QChar ch)
Q_INVOKABLE QString getHistorySuggestion(const QString &typedQuery) const
Get the suggested history entry for the typed query.
Definition: runnermanager.cpp:1050
QStringList locateAll(QStandardPaths::StandardLocation type, const QString &fileName, QStandardPaths::LocateOptions options)
KCOREADDONS_EXPORT QStringList findAllUniqueFiles(const QStringList &dirs, const QStringList &nameFilters={})
QString runnerName(const QString &id) const
Returns the translated name of a runner.
Definition: runnermanager.cpp:731
QSet::iterator insert(const T &value)
static QVector< KPluginMetaData > runnerMetaDataList()
Definition: runnermanager.cpp:863
int size() const const
QStringList enabledCategories() const
Definition: runnermanager.cpp:618
The RunnerContext class provides information related to a search, including the search term,...
Definition: runnercontext.h:31
const T & constFirst() const const
bool sync() override
void launchQuery(const QString &term, const QString &runnerId)
Launch a query, this will create threads and return immediately.
Definition: runnermanager.cpp:955
void prepare()
This signal is emitted when matching is about to commence, giving runners an opportunity to prepare t...
KService::List query(const QString &servicetype, const QString &constraint=QString()) const
void setEnabledCategories(const QStringList &categories)
Sets the list of categories which matches should be returned for.
Definition: runnermanager.cpp:599
KPluginMetaData toMetaData() const
void matchSessionComplete()
Call this method when the query session is finished for the time being.
Definition: runnermanager.cpp:937
void enableKNotifyPluginWatcher()
If you call this method the manager will create a KConfigWatcher which reload its runners or the runn...
Definition: runnermanager.cpp:1086
static KPluginInfo::List listRunnerInfo(const QString &parentApp=QString())
Returns a list of all known Runner implementations.
Definition: runnermanager.cpp:903
QString pluginId() const
virtual QList< QAction * > actionsForMatch(const Plasma::QueryMatch &match)
A given match can have more than action that can be performed on it.
Definition: abstractrunner.cpp:190
bool isEmpty() const const
bool isEnabled(const T &config) const
QList< QueryMatch > matches() const
Retrieves all available matches found so far for the previously launched query.
Definition: runnermanager.cpp:748
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sat Dec 2 2023 03:51:00 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sat Dec 2 2023 03:51:00 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.