MCPcopy Create free account
hub / github.com/KDE/kdevelop / CommandExecutor

Method CommandExecutor

kdevplatform/util/commandexecutor.cpp:50–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48};
49
50CommandExecutor::CommandExecutor(const QString& command, QObject* parent)
51 : QObject(parent)
52 , d_ptr(new CommandExecutorPrivate(this))
53{
54 Q_D(CommandExecutor);
55
56 d->m_process = new KProcess(this);
57 d->m_process->setOutputChannelMode(KProcess::SeparateChannels);
58 d->m_lineMaker = new ProcessLineMaker(d->m_process);
59 d->m_command = command;
60 connect(d->m_lineMaker, &ProcessLineMaker::receivedStdoutLines,
61 this, &CommandExecutor::receivedStandardOutput);
62 connect(d->m_lineMaker, &ProcessLineMaker::receivedStderrLines,
63 this, &CommandExecutor::receivedStandardError);
64 connect(d->m_process, &QProcess::errorOccurred,
65 this, [this](QProcess::ProcessError error) {
66 Q_D(CommandExecutor);
67 d->procError(error);
68 });
69 connect(d->m_process, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished),
70 this, [this](int code, QProcess::ExitStatus status) {
71 Q_D(CommandExecutor);
72 d->procFinished(code, status);
73 });
74}
75
76CommandExecutor::~CommandExecutor()
77{

Callers

nothing calls this directly

Calls 2

procErrorMethod · 0.45
procFinishedMethod · 0.45

Tested by

no test coverage detected