File indexing completed on 2024-05-12 03:57:53
0001 0002 /* 0003 SPDX-FileCopyrightText: 2023 Alexander Lohnau <alexander.lohnau@gmx.de> 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #include <KRunner/AbstractRunner> 0008 #include <KRunner/Action> 0009 #include <QEventLoop> 0010 #include <QThread> 0011 #include <QTimer> 0012 0013 using namespace KRunner; 0014 0015 class SuspendedRunner : public AbstractRunner 0016 { 0017 public: 0018 explicit SuspendedRunner(QObject *parent, const KPluginMetaData &metadata) 0019 : AbstractRunner(parent, metadata) 0020 { 0021 } 0022 void reloadConfiguration() override 0023 { 0024 QThread::msleep(3000); 0025 } 0026 0027 void match(RunnerContext &context) override 0028 { 0029 QueryMatch m(this); 0030 m.setText("bla"); 0031 context.addMatch(m); 0032 } 0033 }; 0034 0035 K_PLUGIN_CLASS_WITH_JSON(SuspendedRunner, "metadatafile1.json") 0036 0037 #include "suspendedrunner.moc"