Lower priority on build

This should prevent slowdown of the IDE (and the rest of the system) while
building with all the CPU cores.

Fixes: QTCREATORBUG-5155
Change-Id: Icaadc53958f2d8e918035463e3c9344c91235615
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Orgad Shaneh
2019-09-10 23:39:29 +03:00
committed by Orgad Shaneh
parent 057215eb10
commit e38361b5a8
8 changed files with 54 additions and 5 deletions

View File

@@ -109,6 +109,7 @@ public:
QByteArray deferredText;
bool m_ignoreReturnValue = false;
bool m_skipFlush = false;
bool m_lowPriority = false;
void readData(void (AbstractProcessStep::*func)(const QString &), bool isUtf8 = false);
void processLine(const QByteArray &data,
@@ -227,6 +228,8 @@ void AbstractProcessStep::doRun()
d->m_process->setWorkingDirectory(wd.absolutePath());
d->m_process->setEnvironment(d->m_param.environment());
d->m_process->setCommand(effectiveCommand);
if (d->m_lowPriority)
d->m_process->setLowPriority();
connect(d->m_process.get(), &QProcess::readyReadStandardOutput,
this, &AbstractProcessStep::processReadyReadStdOutput);
@@ -246,6 +249,11 @@ void AbstractProcessStep::doRun()
processStarted();
}
void AbstractProcessStep::setLowPriority()
{
d->m_lowPriority = true;
}
void AbstractProcessStep::doCancel()
{
Core::Reaper::reap(d->m_process.release());