forked from qt-creator/qt-creator
All: Replace most SynchronousProcess by QtcProcess
Change-Id: I0bf22fef2cd4a7297ef5a1e9aa9c3e2b9348ba42 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -144,7 +144,7 @@ QString VcsBaseClientImpl::stripLastNewline(const QString &in)
|
||||
return in;
|
||||
}
|
||||
|
||||
void VcsBaseClientImpl::vcsFullySynchronousExec(SynchronousProcess &proc,
|
||||
void VcsBaseClientImpl::vcsFullySynchronousExec(QtcProcess &proc,
|
||||
const QString &workingDir, const CommandLine &cmdLine,
|
||||
unsigned flags, int timeoutS, QTextCodec *codec) const
|
||||
{
|
||||
@@ -174,7 +174,7 @@ void VcsBaseClientImpl::annotateRevisionRequested(const QString &workingDirector
|
||||
annotate(workingDirectory, file, changeCopy, line);
|
||||
}
|
||||
|
||||
void VcsBaseClientImpl::vcsFullySynchronousExec(SynchronousProcess &proc,
|
||||
void VcsBaseClientImpl::vcsFullySynchronousExec(QtcProcess &proc,
|
||||
const QString &workingDir, const QStringList &args,
|
||||
unsigned flags, int timeoutS, QTextCodec *codec) const
|
||||
{
|
||||
@@ -195,7 +195,7 @@ VcsCommand *VcsBaseClientImpl::vcsExec(const QString &workingDirectory, const QS
|
||||
return command;
|
||||
}
|
||||
|
||||
void VcsBaseClientImpl::vcsSynchronousExec(SynchronousProcess &proc, const QString &workingDir,
|
||||
void VcsBaseClientImpl::vcsSynchronousExec(QtcProcess &proc, const QString &workingDir,
|
||||
const QStringList &args,
|
||||
unsigned flags,
|
||||
QTextCodec *outputCodec) const
|
||||
@@ -259,7 +259,7 @@ bool VcsBaseClient::synchronousCreateRepository(const QString &workingDirectory,
|
||||
{
|
||||
QStringList args(vcsCommandString(CreateRepositoryCommand));
|
||||
args << extraOptions;
|
||||
SynchronousProcess proc;
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDirectory, args);
|
||||
if (proc.result() != QtcProcess::FinishedWithSuccess)
|
||||
return false;
|
||||
@@ -279,7 +279,7 @@ bool VcsBaseClient::synchronousClone(const QString &workingDir,
|
||||
args << vcsCommandString(CloneCommand)
|
||||
<< extraOptions << srcLocation << dstLocation;
|
||||
|
||||
SynchronousProcess proc;
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDir, args);
|
||||
resetCachedVcsInfo(workingDir);
|
||||
return proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
@@ -290,7 +290,7 @@ bool VcsBaseClient::synchronousAdd(const QString &workingDir, const QString &fil
|
||||
{
|
||||
QStringList args;
|
||||
args << vcsCommandString(AddCommand) << extraOptions << filename;
|
||||
SynchronousProcess proc;
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDir, args);
|
||||
return proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
}
|
||||
@@ -300,7 +300,7 @@ bool VcsBaseClient::synchronousRemove(const QString &workingDir, const QString &
|
||||
{
|
||||
QStringList args;
|
||||
args << vcsCommandString(RemoveCommand) << extraOptions << filename;
|
||||
SynchronousProcess proc;
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDir, args);
|
||||
return proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
}
|
||||
@@ -311,7 +311,7 @@ bool VcsBaseClient::synchronousMove(const QString &workingDir,
|
||||
{
|
||||
QStringList args;
|
||||
args << vcsCommandString(MoveCommand) << extraOptions << from << to;
|
||||
SynchronousProcess proc;
|
||||
QtcProcess proc;
|
||||
vcsFullySynchronousExec(proc, workingDir, args);
|
||||
return proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
}
|
||||
@@ -327,7 +327,7 @@ bool VcsBaseClient::synchronousPull(const QString &workingDir,
|
||||
VcsCommand::SshPasswordPrompt
|
||||
| VcsCommand::ShowStdOut
|
||||
| VcsCommand::ShowSuccessMessage;
|
||||
SynchronousProcess proc;
|
||||
QtcProcess proc;
|
||||
vcsSynchronousExec(proc, workingDir, args, flags);
|
||||
const bool ok = proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
if (ok)
|
||||
@@ -346,7 +346,7 @@ bool VcsBaseClient::synchronousPush(const QString &workingDir,
|
||||
VcsCommand::SshPasswordPrompt
|
||||
| VcsCommand::ShowStdOut
|
||||
| VcsCommand::ShowSuccessMessage;
|
||||
SynchronousProcess proc;
|
||||
QtcProcess proc;
|
||||
vcsSynchronousExec(proc, workingDir, args, flags);
|
||||
return proc.result() == QtcProcess::FinishedWithSuccess;
|
||||
}
|
||||
|
||||
@@ -95,10 +95,10 @@ public:
|
||||
static QString stripLastNewline(const QString &in);
|
||||
|
||||
// Fully synchronous VCS execution (QProcess-based)
|
||||
void vcsFullySynchronousExec(Utils::SynchronousProcess &process,
|
||||
void vcsFullySynchronousExec(Utils::QtcProcess &process,
|
||||
const QString &workingDir, const QStringList &args,
|
||||
unsigned flags = 0, int timeoutS = -1, QTextCodec *codec = nullptr) const;
|
||||
void vcsFullySynchronousExec(Utils::SynchronousProcess &process,
|
||||
void vcsFullySynchronousExec(Utils::QtcProcess &process,
|
||||
const QString &workingDir, const Utils::CommandLine &cmdLine,
|
||||
unsigned flags = 0, int timeoutS = -1, QTextCodec *codec = nullptr) const;
|
||||
|
||||
@@ -115,7 +115,7 @@ protected:
|
||||
|
||||
// Synchronous VCS execution using Utils::SynchronousProcess, with
|
||||
// log windows updating (using VcsBasePlugin::runVcs with flags)
|
||||
void vcsSynchronousExec(Utils::SynchronousProcess &proc,
|
||||
void vcsSynchronousExec(Utils::QtcProcess &proc,
|
||||
const QString &workingDir,
|
||||
const QStringList &args,
|
||||
unsigned flags = 0,
|
||||
|
||||
@@ -71,7 +71,7 @@ const Environment VcsCommand::processEnvironment() const
|
||||
return env;
|
||||
}
|
||||
|
||||
void VcsCommand::runCommand(SynchronousProcess &proc,
|
||||
void VcsCommand::runCommand(QtcProcess &proc,
|
||||
const CommandLine &command,
|
||||
const QString &workingDirectory)
|
||||
{
|
||||
|
||||
@@ -47,7 +47,7 @@ public:
|
||||
|
||||
const Utils::Environment processEnvironment() const override;
|
||||
|
||||
void runCommand(Utils::SynchronousProcess &process,
|
||||
void runCommand(Utils::QtcProcess &process,
|
||||
const Utils::CommandLine &command,
|
||||
const QString &workDirectory = {}) override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user