File indexing completed on 2024-05-05 04:40:55

0001 /*
0002     SPDX-FileCopyrightText: 2018 Amish K. Naidu <amhndu@gmail.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef SCRATCHPADJOB_H
0008 #define SCRATCHPADJOB_H
0009 
0010 #include <outputview/outputjob.h>
0011 
0012 #include <QProcess>
0013 
0014 namespace KDevelop {
0015 class OutputModel;
0016 class ProcessLineMaker;
0017 }
0018 class KProcess;
0019 
0020 class ScratchpadJob
0021     : public KDevelop::OutputJob
0022 {
0023     Q_OBJECT
0024 
0025 public:
0026     ScratchpadJob(const QString& command, const QString& title, QObject* parent);
0027 
0028     void start() override;
0029     bool doKill() override;
0030 
0031 private Q_SLOTS:
0032     void processFinished(int exitCode, QProcess::ExitStatus status);
0033     void processError(QProcess::ProcessError error);
0034 
0035 private:
0036     KDevelop::OutputModel* outputModel() const;
0037 
0038     KProcess* m_process;
0039     KDevelop::ProcessLineMaker* m_lineMaker;
0040 };
0041 
0042 #endif // SCRATCHPADJOB_H