summaryrefslogtreecommitdiffstats
path: root/src/widgets/dialogs/qfilesystemmodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/dialogs/qfilesystemmodel.cpp')
-rw-r--r--src/widgets/dialogs/qfilesystemmodel.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/widgets/dialogs/qfilesystemmodel.cpp b/src/widgets/dialogs/qfilesystemmodel.cpp
index b67335822b..e4edd2f6ef 100644
--- a/src/widgets/dialogs/qfilesystemmodel.cpp
+++ b/src/widgets/dialogs/qfilesystemmodel.cpp
@@ -2032,10 +2032,8 @@ bool QFileSystemModelPrivate::passNameFilters(const QFileSystemNode *node) const
: QRegularExpression::CaseInsensitiveOption;
for (const auto &nameFilter : nameFilters) {
- const QString wildcard = QLatin1String("\\A(?:")
- + QRegularExpression::wildcardToRegularExpression(nameFilter)
- + QLatin1String(")\\z");
- QRegularExpression rx(wildcard, options);
+ const QString wildcard = QRegularExpression::wildcardToRegularExpression(nameFilter);
+ QRegularExpression rx(QRegularExpression::anchoredPattern(wildcard), options);
QRegularExpressionMatch match = rx.match(node->fileName);
if (match.hasMatch())
return true;