forked from qt-creator/qt-creator
Utils: Re-do Replace SynchronousCommand::flags by a named bool
The potential extensibility was never used, and a similar use case in QtcProcess (setLowPriority()) used a named setter. Change-Id: I87d84ea2206995d5069265f8df78f40cf2ba8a36 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -103,6 +103,7 @@ public:
|
||||
bool m_progressiveOutput = false;
|
||||
bool m_hadOutput = false;
|
||||
bool m_aborted = false;
|
||||
bool m_disableUnixTerminal = false;
|
||||
};
|
||||
|
||||
ShellCommandPrivate::Job::Job(const QString &wd, const CommandLine &command,
|
||||
@@ -224,11 +225,6 @@ void ShellCommand::cancel()
|
||||
emit terminate();
|
||||
}
|
||||
|
||||
unsigned ShellCommand::processFlags() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ShellCommand::addTask(QFuture<void> &future)
|
||||
{
|
||||
Q_UNUSED(future)
|
||||
@@ -357,7 +353,8 @@ SynchronousProcessResponse ShellCommand::runFullySynchronous(const CommandLine &
|
||||
{
|
||||
// Set up process
|
||||
SynchronousProcess process;
|
||||
process.setFlags(processFlags());
|
||||
if (d->m_disableUnixTerminal)
|
||||
process.setDisableUnixTerminal();
|
||||
const QString dir = workDirectory(workingDirectory);
|
||||
if (!dir.isEmpty())
|
||||
process.setWorkingDirectory(dir);
|
||||
@@ -401,7 +398,8 @@ SynchronousProcessResponse ShellCommand::runSynchronous(const CommandLine &cmd,
|
||||
process.setTimeoutS(timeoutS);
|
||||
if (d->m_codec)
|
||||
process.setCodec(d->m_codec);
|
||||
process.setFlags(processFlags());
|
||||
if (d->m_disableUnixTerminal)
|
||||
process.setDisableUnixTerminal();
|
||||
const QString dir = workDirectory(workingDirectory);
|
||||
if (!dir.isEmpty())
|
||||
process.setWorkingDirectory(dir);
|
||||
@@ -489,6 +487,11 @@ void ShellCommand::setOutputProxyFactory(const std::function<OutputProxy *()> &f
|
||||
d->m_proxyFactory = factory;
|
||||
}
|
||||
|
||||
void ShellCommand::setDisableUnixTerminal()
|
||||
{
|
||||
d->m_disableUnixTerminal = true;
|
||||
}
|
||||
|
||||
ProgressParser::ProgressParser() :
|
||||
m_futureMutex(new QMutex)
|
||||
{ }
|
||||
|
||||
Reference in New Issue
Block a user