forked from qt-creator/qt-creator
Handle belowNormalPriority inside process launcher on Windows
Remove setCreateProcessArgumentModifier() from the ProcessInterface API and replace it with belowNormalPriority flag. Change-Id: I6bcb92e56c3a68af7fa3e3a1c8b8eb13e3a2e5a7 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -26,6 +26,13 @@
|
||||
#include "processutils.h"
|
||||
#include <QProcess>
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#ifdef QTCREATOR_PCH_H
|
||||
#define CALLBACK WINAPI
|
||||
#endif
|
||||
#include <qt_windows.h>
|
||||
#endif
|
||||
|
||||
namespace Utils {
|
||||
|
||||
QIODevice::OpenMode ProcessStartHandler::openMode() const
|
||||
@@ -55,4 +62,16 @@ void ProcessStartHandler::handleProcessStarted(QProcess *process)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ProcessStartHandler::setBelowNormalPriority(QProcess *process)
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
process->setCreateProcessArgumentsModifier(
|
||||
[](QProcess::CreateProcessArguments *args) {
|
||||
args->flags |= BELOW_NORMAL_PRIORITY_CLASS;
|
||||
});
|
||||
#endif // Q_OS_WIN
|
||||
}
|
||||
|
||||
|
||||
} // namespace Utils
|
||||
|
||||
Reference in New Issue
Block a user