File indexing completed on 2024-05-05 17:45:03
0001 /* 0002 SPDX-FileCopyrightText: 2006 Aaron Seigo <aseigo@kde.org> 0003 SPDX-FileCopyrightText: 2010 Marco Martin <notmart@gmail.com> 0004 0005 SPDX-License-Identifier: LGPL-2.0-only 0006 */ 0007 0008 #pragma once 0009 0010 #include <QMutex> 0011 0012 #include <krunner/abstractrunner.h> 0013 0014 /** 0015 * This class looks for matches in the set of .desktop files installed by 0016 * applications. This way the user can type exactly what they see in the 0017 * applications menu and have it start the appropriate app. Essentially anything 0018 * that KService knows about, this runner can launch 0019 */ 0020 0021 class WindowedWidgetsRunner : public Plasma::AbstractRunner 0022 { 0023 Q_OBJECT 0024 0025 public: 0026 WindowedWidgetsRunner(QObject *parent, const KPluginMetaData &metaData, const QVariantList &args); 0027 ~WindowedWidgetsRunner() override; 0028 0029 void match(Plasma::RunnerContext &context) override; 0030 void run(const Plasma::RunnerContext &context, const Plasma::QueryMatch &action) override; 0031 0032 protected Q_SLOTS: 0033 QMimeData *mimeDataForMatch(const Plasma::QueryMatch &match) override; 0034 0035 private: 0036 void loadMetadataList(); 0037 QList<KPluginMetaData> m_applets; 0038 QMutex m_mutex; 0039 };