Fix corelib build without feature.regularexpression
Change-Id: I208d6cb7f57a74873fae3a36fe094a92d287c2f0 Reviewed-by: David Faure <david.faure@kdab.com>
This commit is contained in:
parent
c0d8c56487
commit
c034544767
@ -39,7 +39,9 @@
|
|||||||
|
|
||||||
#include "qmimeglobpattern_p.h"
|
#include "qmimeglobpattern_p.h"
|
||||||
|
|
||||||
|
#if QT_CONFIG(regularexpression)
|
||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
|
#endif
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
@ -142,8 +144,12 @@ bool QMimeGlobPattern::matchFileName(const QString &inputFilename) const
|
|||||||
return (m_pattern == filename);
|
return (m_pattern == filename);
|
||||||
|
|
||||||
// Other (quite rare) patterns, like "*.anim[1-9j]": use slow but correct method
|
// Other (quite rare) patterns, like "*.anim[1-9j]": use slow but correct method
|
||||||
|
#if QT_CONFIG(regularexpression)
|
||||||
QRegularExpression rx(QRegularExpression::wildcardToRegularExpression(m_pattern));
|
QRegularExpression rx(QRegularExpression::wildcardToRegularExpression(m_pattern));
|
||||||
return rx.match(filename).hasMatch();
|
return rx.match(filename).hasMatch();
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool isFastPattern(const QString &pattern)
|
static bool isFastPattern(const QString &pattern)
|
||||||
|
Loading…
Reference in New Issue
Block a user