Fix corelib build without feature.regularexpression

Change-Id: I208d6cb7f57a74873fae3a36fe094a92d287c2f0
Reviewed-by: David Faure <david.faure@kdab.com>
This commit is contained in:
Tasuku Suzuki 2019-05-22 14:04:11 +09:00
parent c0d8c56487
commit c034544767

View File

@ -39,7 +39,9 @@
#include "qmimeglobpattern_p.h"
#if QT_CONFIG(regularexpression)
#include <QRegularExpression>
#endif
#include <QStringList>
#include <QDebug>
@ -142,8 +144,12 @@ bool QMimeGlobPattern::matchFileName(const QString &inputFilename) const
return (m_pattern == filename);
// Other (quite rare) patterns, like "*.anim[1-9j]": use slow but correct method
#if QT_CONFIG(regularexpression)
QRegularExpression rx(QRegularExpression::wildcardToRegularExpression(m_pattern));
return rx.match(filename).hasMatch();
#else
return false;
#endif
}
static bool isFastPattern(const QString &pattern)