summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2020-03-16 08:47:45 +0100
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>2020-03-17 09:17:08 +0100
commitcfcf88e259599131b344dbbe0372d3b03f7d35ec (patch)
treef85f84f7022b4590173c90efc290e2b617aa1fe6 /src/plugins/platforms/windows/qwindowsdialoghelpers.cpp
parentdee55af0a5359bb3b57a89cf3065ffca9d8506da (diff)
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 <lars.knoll@qt.io>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowsdialoghelpers.cpp')
-rw-r--r--src/plugins/platforms/windows/qwindowsdialoghelpers.cpp11
1 files changed, 10 insertions, 1 deletions
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 <QtGui/qcolor.h>
#include <QtCore/qdebug.h>
-#include <QtCore/qregularexpression.h>
+#if QT_CONFIG(regularexpression)
+# include <QtCore/qregularexpression.h>
+#endif
#include <QtCore/qtimer.h>
#include <QtCore/qdir.h>
#include <QtCore/qscopedpointer.h>
@@ -1034,9 +1036,12 @@ static QList<FilterSpec> 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<FilterSpec> 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);