| 1 |
/* |
| 2 |
* SPDX-FileCopyrightText: 2013-2018 CSSlayer <[email protected]> |
| 3 |
* |
| 4 |
* SPDX-License-Identifier: LGPL-2.1-or-later |
| 5 |
* |
| 6 |
*/ |
| 7 |
#ifndef _PINYINDICTMANAGER_PROCESSRUNNER_H_ |
| 8 |
#define _PINYINDICTMANAGER_PROCESSRUNNER_H_ |
| 9 |
|
| 10 |
#include "pipelinejob.h" |
| 11 |
#include <QMessageBox> |
| 12 |
#include <QObject> |
| 13 |
#include <QProcess> |
| 14 |
#include <QTemporaryFile> |
| 15 |
|
| 16 |
namespace fcitx { |
| 17 |
|
| 18 |
class ProcessRunner : public PipelineJob { |
| 19 |
Q_OBJECT |
| 20 |
public: |
| 21 |
explicit ProcessRunner(const QString &bin, const QStringList &args, |
| 22 |
const QString &file, QObject *parent = nullptr); |
| 23 |
void start() override; |
| 24 |
void abort() override; |
| 25 |
void cleanUp() override; |
| 26 |
|
| 27 |
private Q_SLOTS: |
| 28 |
void processFinished(int exitCode, QProcess::ExitStatus status); |
| 29 |
|
| 30 |
private: |
| 31 |
QProcess process_; |
| 32 |
QString bin_; |
| 33 |
QStringList args_; |
| 34 |
QString file_; |
| 35 |
}; |
| 36 |
|
| 37 |
} // namespace fcitx |
| 38 |
|
| 39 |
#endif // _PINYINDICTMANAGER_PROCESSRUNNER_H_ |