Use QRegularExpression instead of QRegExp

Change-Id: I14abbf81a9d0fb72f75417da06b6456b8f1a20a2
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
bb10
Lars Knoll 2018-12-10 15:03:51 +01:00
parent 43720ec200
commit 88d5eb13d7
1 changed files with 3 additions and 3 deletions

View File

@ -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)