forked from qt-creator/qt-creator
Git/VCS: Use ctrlc stub for process execution
This ensures that child processes are also terminated. Required specifically for Git on Windows, when running in cmd directory, which spawns a child process for usr/bin/git. On this case, if git takes long to finish and is aborted while running, the main process was killed as expected, but the child process remained alive. Task-number: QTCREATORBUG-27567 Change-Id: I40271eb42cfaefd81f2fe5af138254ab0a2c8da8 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
committed by
Orgad Shaneh
parent
3a90977da0
commit
371e674967
@@ -885,6 +885,7 @@ void BranchModel::updateUpstreamStatus(BranchNode *node)
|
||||
process->setCommand({d->client->vcsBinary(), {"rev-list", "--no-color", "--left-right",
|
||||
"--count", node->fullRef() + "..." + node->tracking}});
|
||||
process->setWorkingDirectory(d->workingDirectory);
|
||||
process->setUseCtrlCStub(true);
|
||||
connect(process, &QtcProcess::done, this, [this, process, node] {
|
||||
process->deleteLater();
|
||||
if (process->result() != ProcessResult::FinishedWithSuccess)
|
||||
|
@@ -213,6 +213,7 @@ void ChangeSelectionDialog::recalculateCompletion()
|
||||
process->setEnvironment(client->processEnvironment());
|
||||
process->setCommand({client->vcsBinary(), {"for-each-ref", "--format=%(refname:short)"}});
|
||||
process->setWorkingDirectory(workingDir);
|
||||
process->setUseCtrlCStub(true);
|
||||
connect(process, &QtcProcess::done, this, [this, process] {
|
||||
if (process->result() == ProcessResult::FinishedWithSuccess)
|
||||
m_changeModel->setStringList(process->cleanedStdOut().split('\n'));
|
||||
|
@@ -248,6 +248,7 @@ QueryContext::QueryContext(const QString &query,
|
||||
QObject *parent)
|
||||
: QObject(parent)
|
||||
{
|
||||
m_process.setUseCtrlCStub(true);
|
||||
if (server.type == GerritServer::Ssh) {
|
||||
m_binary = p->ssh;
|
||||
if (server.port)
|
||||
|
@@ -119,6 +119,7 @@ FetchContext::FetchContext(const QSharedPointer<GerritChange> &change,
|
||||
, m_server(server)
|
||||
, m_state(FetchState)
|
||||
{
|
||||
m_process.setUseCtrlCStub(true);
|
||||
connect(&m_process, &QtcProcess::done, this, &FetchContext::processDone);
|
||||
connect(&m_process, &QtcProcess::readyReadStandardError,
|
||||
this, &FetchContext::processReadyReadStandardError);
|
||||
|
@@ -114,6 +114,7 @@ void VcsCommandPrivate::setupProcess(QtcProcess *process, const Job &job)
|
||||
process->setProcessChannelMode(QProcess::MergedChannels);
|
||||
if (m_codec)
|
||||
process->setCodec(m_codec);
|
||||
process->setUseCtrlCStub(true);
|
||||
|
||||
installStdCallbacks(process);
|
||||
|
||||
|
Reference in New Issue
Block a user