File indexing completed on 2024-05-19 05:37:49

0001 /*
0002     SPDX-FileCopyrightText: 2007, 2008 Petri Damsten <damu@iki.fi>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-only
0005 */
0006 
0007 #pragma once
0008 
0009 #include <KProcess>
0010 #include <Plasma5Support/DataContainer>
0011 #include <Plasma5Support/DataEngine>
0012 
0013 class ExecutableContainer : public Plasma5Support::DataContainer
0014 {
0015     Q_OBJECT
0016 public:
0017     explicit ExecutableContainer(const QString &command, QObject *parent = nullptr);
0018     ~ExecutableContainer() override;
0019 
0020 protected Q_SLOTS:
0021     void finished(int exitCode, QProcess::ExitStatus exitStatus);
0022     void exec();
0023 
0024 private:
0025     KProcess *m_process;
0026 };
0027 
0028 class ExecutableEngine : public Plasma5Support::DataEngine
0029 {
0030     Q_OBJECT
0031 public:
0032     ExecutableEngine(QObject *parent);
0033 
0034 protected:
0035     bool sourceRequestEvent(const QString &source) override;
0036 };