From cfcf88e259599131b344dbbe0372d3b03f7d35ec Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Mon, 16 Mar 2020 08:47:45 +0100 Subject: Fix compilation with -no-feature-regularexpression This -no-feature has probably not been tested for a while and seems to have rotted a bit, both some unprotected uses and some warnings on unused parameters. Change-Id: Ie20a06c78d3b4c36860dab49d6615eaa8ffc9077 Reviewed-by: Lars Knoll --- src/plugins/platforms/windows/qwindowsdialoghelpers.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/plugins') diff --git a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp index b038e19689..ccc809413e 100644 --- a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp +++ b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp @@ -55,7 +55,9 @@ #include #include -#include +#if QT_CONFIG(regularexpression) +# include +#endif #include #include #include @@ -1034,9 +1036,12 @@ static QList filterSpecs(const QStringList &filters, result.reserve(filters.size()); *totalStringLength = 0; +#if QT_CONFIG(regularexpression) const QRegularExpression filterSeparatorRE(QStringLiteral("[;\\s]+")); const QString separator = QStringLiteral(";"); Q_ASSERT(filterSeparatorRE.isValid()); +#endif + // Split filter specification as 'Texts (*.txt[;] *.doc)', '*.txt[;] *.doc' // into description and filters specification as '*.txt;*.doc' for (const QString &filterString : filters) { @@ -1049,7 +1054,11 @@ static QList filterSpecs(const QStringList &filters, filterString.mid(openingParenPos + 1, closingParenPos - openingParenPos - 1).trimmed(); if (filterSpec.filter.isEmpty()) filterSpec.filter += u'*'; +#if QT_CONFIG(regularexpression) filterSpec.filter.replace(filterSeparatorRE, separator); +#else + filterSpec.filter.replace(QLatin1Char(' '), QLatin1Char(';')); +#endif filterSpec.description = filterString; if (hideFilterDetails && openingParenPos != -1) { // Do not show pattern in description filterSpec.description.truncate(openingParenPos); -- cgit v1.2.3