Utils: Replace some QRegExp to QRegularExpression

Task-number: QTCREATORBUG-24098
Change-Id: I7d12992506bbe33306c0ab750f73c7db1626abc3
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Stenger
2020-06-19 14:09:27 +02:00
parent f9be969c10
commit e817100b9c
6 changed files with 13 additions and 14 deletions

View File

@@ -424,13 +424,13 @@ bool ConsoleProcess::start()
const QStringList fixedEnvironment = [env] {
QStringList envStrings = env;
// add PATH if necessary (for DLL loading)
if (envStrings.filter(QRegExp(QLatin1String("^PATH="),Qt::CaseInsensitive)).isEmpty()) {
if (envStrings.filter(QRegularExpression("^PATH=.*", QRegularExpression::CaseInsensitiveOption)).isEmpty()) {
QByteArray path = qgetenv("PATH");
if (!path.isEmpty())
envStrings.prepend(QString::fromLatin1("PATH=%1").arg(QString::fromLocal8Bit(path)));
}
// add systemroot if needed
if (envStrings.filter(QRegExp(QLatin1String("^SystemRoot="),Qt::CaseInsensitive)).isEmpty()) {
if (envStrings.filter(QRegularExpression("^SystemRoot=.*", QRegularExpression::CaseInsensitiveOption)).isEmpty()) {
QByteArray systemRoot = qgetenv("SystemRoot");
if (!systemRoot.isEmpty())
envStrings.prepend(QString::fromLatin1("SystemRoot=%1").arg(QString::fromLocal8Bit(systemRoot)));