summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMorten Sørvig <morten.sorvig@qt.io>2022-08-19 09:37:53 +0200
committerMorten Sørvig <morten.sorvig@qt.io>2022-08-25 14:43:37 +0200
commit407a39d3ca91fe6595c2ad9e0697c261a7e02680 (patch)
treec6ea5b15246e242880103cffa9f0040c7bb3a869 /src
parentd2e9d70ec1f5e09bbd2fe6ea0ab94724ef9275bf (diff)
wasm: use matchView() instead of match()
QRegularExpression::match() is deprecated. Change-Id: I66c7b3043a3805614fedcdb081c7e704e9925e5e Reviewed-by: David Skoland <david.skoland@qt.io> Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/gui/platform/wasm/qlocalfileapi.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gui/platform/wasm/qlocalfileapi.cpp b/src/gui/platform/wasm/qlocalfileapi.cpp
index ec7ae40391..b56490eba4 100644
--- a/src/gui/platform/wasm/qlocalfileapi.cpp
+++ b/src/gui/platform/wasm/qlocalfileapi.cpp
@@ -46,7 +46,7 @@ std::optional<Type> Type::fromQt(QStringView type)
// Group 1 is treated as the description, whereas group 2 or 3 are treated as the filter list.
static QRegularExpression regex(
QString(QStringLiteral("(?:(?:([^(]*)\\(([^()]+)\\)[^)]*)|([^()]+))")));
- const auto match = regex.match(type);
+ const auto match = regex.matchView(type);
if (!match.hasMatch())
return std::nullopt;
@@ -86,7 +86,7 @@ std::optional<Type::Accept> Type::Accept::fromQt(QStringView qtRepresentation)
// The next group of non-empty characters.
static QRegularExpression internalRegex(QString(QStringLiteral("([^\\s]+)\\s*")));
int offset = 0;
- auto internalMatch = internalRegex.match(qtRepresentation, offset);
+ auto internalMatch = internalRegex.matchView(qtRepresentation, offset);
MimeType mimeType;
while (internalMatch.hasMatch()) {
@@ -97,7 +97,7 @@ std::optional<Type::Accept> Type::Accept::fromQt(QStringView qtRepresentation)
mimeType.addExtension(*webExtension);
- internalMatch = internalRegex.match(qtRepresentation, internalMatch.capturedEnd());
+ internalMatch = internalRegex.matchView(qtRepresentation, internalMatch.capturedEnd());
}
accept.addMimeType(mimeType);
@@ -144,7 +144,7 @@ Type::Accept::MimeType::Extension::fromQt(QStringView qtRepresentation)
// The web filter does not support wildcards.
static QRegularExpression qtAcceptAllRegex(
QRegularExpression::anchoredPattern(QString(QStringLiteral("[*]+|[*]+\\.[*]+"))));
- if (qtAcceptAllRegex.match(qtRepresentation).hasMatch())
+ if (qtAcceptAllRegex.matchView(qtRepresentation).hasMatch())
return std::nullopt;
// Checks for correctness. The web filter only allows filename extensions and does not filter
@@ -153,7 +153,7 @@ Type::Accept::MimeType::Extension::fromQt(QStringView qtRepresentation)
static QRegularExpression qtFilenameMatcherRegex(
QRegularExpression::anchoredPattern(QString(QStringLiteral("(\\*?)(\\.[^*]+)"))));
- auto extensionMatch = qtFilenameMatcherRegex.match(qtRepresentation);
+ auto extensionMatch = qtFilenameMatcherRegex.matchView(qtRepresentation);
if (extensionMatch.hasMatch())
return Extension(extensionMatch.capturedView(2));