diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-12-10 15:03:51 +0100 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-12-14 07:52:27 +0000 |
commit | 88d5eb13d7a996772f38e9c9ab90befb3ae0c80d (patch) | |
tree | ca39cd9896e1f18a51f84de386a15647fc978419 /src/corelib/mimetypes | |
parent | 43720ec2003339918c51cddeee38c2b10ed27ddf (diff) |
Use QRegularExpression instead of QRegExp
Change-Id: I14abbf81a9d0fb72f75417da06b6456b8f1a20a2
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Diffstat (limited to 'src/corelib/mimetypes')
-rw-r--r-- | src/corelib/mimetypes/qmimeglobpattern.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/mimetypes/qmimeglobpattern.cpp b/src/corelib/mimetypes/qmimeglobpattern.cpp index cd42b4da83..fd06f6ab6b 100644 --- a/src/corelib/mimetypes/qmimeglobpattern.cpp +++ b/src/corelib/mimetypes/qmimeglobpattern.cpp @@ -39,7 +39,7 @@ #include "qmimeglobpattern_p.h" -#include <QRegExp> +#include <QRegularExpression> #include <QStringList> #include <QDebug> @@ -142,8 +142,8 @@ bool QMimeGlobPattern::matchFileName(const QString &inputFilename) const return (m_pattern == filename); // Other (quite rare) patterns, like "*.anim[1-9j]": use slow but correct method - QRegExp rx(m_pattern, Qt::CaseSensitive, QRegExp::WildcardUnix); - return rx.exactMatch(filename); + QRegularExpression rx(QRegularExpression::anchoredPattern(QRegularExpression::wildcardToRegularExpression(m_pattern))); + return rx.match(filename).hasMatch(); } static bool isFastPattern(const QString &pattern) |