diff options
author | Christian Stenger <christian.stenger@qt.io> | 2022-10-20 09:47:39 +0200 |
---|---|---|
committer | Christian Stenger <christian.stenger@qt.io> | 2022-10-21 12:18:08 +0200 |
commit | ea36be89d4f93467eab2f43634632023c734f2e3 (patch) | |
tree | 91032e43c1e41edc66ac1d20d005dc8d8c931b9e /src/libs/installer/binaryformatengine.cpp | |
parent | 01e2a2244e3f1e3c8810f19b3f1ec6091a92cb95 (diff) |
Replace QRegExp usages by QRegularExpression
Task-number: QTIFW-1829
Change-Id: I5a48bb5660d6082c1b95247adf84bb3126853aef
Reviewed-by: Katja Marttila <katja.marttila@qt.io>
Diffstat (limited to 'src/libs/installer/binaryformatengine.cpp')
-rw-r--r-- | src/libs/installer/binaryformatengine.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/libs/installer/binaryformatengine.cpp b/src/libs/installer/binaryformatengine.cpp index ec6926031..681e6db79 100644 --- a/src/libs/installer/binaryformatengine.cpp +++ b/src/libs/installer/binaryformatengine.cpp @@ -28,7 +28,7 @@ #include "binaryformatengine.h" -#include <QRegExp> +#include <QRegularExpression> namespace { @@ -263,15 +263,17 @@ QStringList BinaryFormatEngine::entryList(QDir::Filters filters, const QStringLi if (filterNames.isEmpty()) return result; - QList<QRegExp> regexps; - foreach (const QString &i, filterNames) - regexps.append(QRegExp(i, Qt::CaseInsensitive, QRegExp::Wildcard)); + QList<QRegularExpression> regexps; + for (const QString &i : filterNames) { + regexps.append(QRegularExpression(QRegularExpression::wildcardToRegularExpression(i), + QRegularExpression::CaseInsensitiveOption)); + } QStringList entries; - foreach (const QString &i, result) { + for (const QString &i : qAsConst(result)) { bool matched = false; - foreach (const QRegExp ®, regexps) { - matched = reg.exactMatch(i); + for (const QRegularExpression ® : qAsConst(regexps)) { + matched = reg.match(i).hasMatch(); if (matched) break; } |