summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2018-02-09 14:29:21 +0100
committerUlf Hermann <ulf.hermann@qt.io>2018-03-20 08:19:25 +0000
commit5a4787dca01c302dd462a76222dfbf28c8951a8d (patch)
tree897b7caea659526d740e98c06b11c15970d35a7b /src/plugins
parentdd74f5d347d0a5a21527142f85114374e2d90646 (diff)
Modernize the "regularexpression" feature
Use QT_CONFIG(regularexpression), disentangle it from QT_BOOTSTRAPPED, switch it off in the bootstrap build, remove the #ifdefs from qregularexpression.{h|cpp}, and add QT_REQUIRE_CONFIG(regularexpression) to the header. qregularexpression.{h|cpp} are already correctly excluded in tools.pri if !qtConfig(regularexpression). Change-Id: I21de154a6a118b76f99003d3acb72ac1e220d302 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/eglfs/api/qeglfsdeviceintegration.cpp2
-rw-r--r--src/plugins/platformthemes/platformthemes.pro2
-rw-r--r--src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp10
3 files changed, 7 insertions, 7 deletions
diff --git a/src/plugins/platforms/eglfs/api/qeglfsdeviceintegration.cpp b/src/plugins/platforms/eglfs/api/qeglfsdeviceintegration.cpp
index 1b8f50a1c6..f151713400 100644
--- a/src/plugins/platforms/eglfs/api/qeglfsdeviceintegration.cpp
+++ b/src/plugins/platforms/eglfs/api/qeglfsdeviceintegration.cpp
@@ -140,7 +140,7 @@ QByteArray QEglFSDeviceIntegration::fbDeviceName() const
int QEglFSDeviceIntegration::framebufferIndex() const
{
int fbIndex = 0;
-#ifndef QT_NO_REGULAREXPRESSION
+#if QT_CONFIG(regularexpression)
QRegularExpression fbIndexRx(QLatin1String("fb(\\d+)"));
QRegularExpressionMatch match = fbIndexRx.match(QString::fromLocal8Bit(fbDeviceName()));
if (match.hasMatch())
diff --git a/src/plugins/platformthemes/platformthemes.pro b/src/plugins/platformthemes/platformthemes.pro
index ebf92ba9d5..17b1d91c6a 100644
--- a/src/plugins/platformthemes/platformthemes.pro
+++ b/src/plugins/platformthemes/platformthemes.pro
@@ -1,6 +1,6 @@
TEMPLATE = subdirs
QT_FOR_CONFIG += widgets-private
-qtConfig(dbus): SUBDIRS += flatpak
+qtConfig(dbus):qtConfig(regularexpression): SUBDIRS += flatpak
qtHaveModule(widgets):qtConfig(gtk3): SUBDIRS += gtk3
diff --git a/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp b/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp
index f715d3cba3..cb3d905f46 100644
--- a/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp
+++ b/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp
@@ -51,7 +51,7 @@
#include <qstringlist.h>
#include <qvector.h>
#include <qdebug.h>
-#ifndef QT_NO_REGULAREXPRESSION
+#if QT_CONFIG(regularexpression)
#include <qcache.h>
#include <qregularexpression.h>
#endif
@@ -625,7 +625,7 @@ QVariant QSQLiteResult::handle() const
/////////////////////////////////////////////////////////
-#ifndef QT_NO_REGULAREXPRESSION
+#if QT_CONFIG(regularexpression)
static void _q_regexp(sqlite3_context* context, int argc, sqlite3_value** argv)
{
if (Q_UNLIKELY(argc != 2)) {
@@ -724,7 +724,7 @@ bool QSQLiteDriver::open(const QString & db, const QString &, const QString &, c
bool sharedCache = false;
bool openReadOnlyOption = false;
bool openUriOption = false;
-#ifndef QT_NO_REGULAREXPRESSION
+#if QT_CONFIG(regularexpression)
static const QLatin1String regexpConnectOption = QLatin1String("QSQLITE_ENABLE_REGEXP");
bool defineRegexp = false;
int regexpCacheSize = 25;
@@ -748,7 +748,7 @@ bool QSQLiteDriver::open(const QString & db, const QString &, const QString &, c
} else if (option == QLatin1String("QSQLITE_ENABLE_SHARED_CACHE")) {
sharedCache = true;
}
-#ifndef QT_NO_REGULAREXPRESSION
+#if QT_CONFIG(regularexpression)
else if (option.startsWith(regexpConnectOption)) {
option = option.mid(regexpConnectOption.size()).trimmed();
if (option.isEmpty()) {
@@ -777,7 +777,7 @@ bool QSQLiteDriver::open(const QString & db, const QString &, const QString &, c
sqlite3_busy_timeout(d->access, timeOut);
setOpen(true);
setOpenError(false);
-#ifndef QT_NO_REGULAREXPRESSION
+#if QT_CONFIG(regularexpression)
if (defineRegexp) {
auto cache = new QCache<QString, QRegularExpression>(regexpCacheSize);
sqlite3_create_function_v2(d->access, "regexp", 2, SQLITE_UTF8, cache, &_q_regexp, NULL,