summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdward Welbourne <eddy@chaos.org.uk>2020-03-03 08:01:05 +0100
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2020-03-03 17:34:16 +0000
commit466d32160a23e6848fe0a42e74085c79071d7dec (patch)
tree3585c886dab3ad6840ad9efa9b80434ccfcd009a
parent8f8eb99991216c0833c23a0f068e036a70e3b060 (diff)
Suppress warnings where QString and its tests use SplitBehavior
This is a follow-up to commit 895939c7f91d0c8424a0638c42d05cb42293a142 to fix deprecation warnings it added. Change-Id: I3d86655ec2c84c1bdcac9c70436075fc78f2f781 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
-rw-r--r--src/corelib/text/qstring.cpp3
-rw-r--r--tests/auto/corelib/text/qstring/tst_qstring.cpp3
2 files changed, 6 insertions, 0 deletions
diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp
index a2c603c776..68dec7cfff 100644
--- a/src/corelib/text/qstring.cpp
+++ b/src/corelib/text/qstring.cpp
@@ -7748,7 +7748,10 @@ static ResultList splitString(const StringSource &source, const QChar *sep,
#if QT_DEPRECATED_SINCE(5, 15)
Qt::SplitBehavior mapSplitBehavior(QString::SplitBehavior sb)
{
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
return sb & QString::SkipEmptyParts ? Qt::SkipEmptyParts : Qt::KeepEmptyParts;
+QT_WARNING_POP
}
#endif
diff --git a/tests/auto/corelib/text/qstring/tst_qstring.cpp b/tests/auto/corelib/text/qstring/tst_qstring.cpp
index 7072cb9516..bc2b19125a 100644
--- a/tests/auto/corelib/text/qstring/tst_qstring.cpp
+++ b/tests/auto/corelib/text/qstring/tst_qstring.cpp
@@ -5824,6 +5824,8 @@ void tst_QString::split(const QString &string, const QString &sep, QStringList r
QVERIFY(list == result);
}
+QT_WARNING_PUSH
+QT_WARNING_DISABLE_DEPRECATED
list = str.split(sep, QString::KeepEmptyParts);
QVERIFY(list == result);
list = str.split(rx, QString::KeepEmptyParts);
@@ -5846,6 +5848,7 @@ void tst_QString::split(const QString &string, const QString &sep, QStringList r
list = str.split(sep.at(0), QString::SkipEmptyParts);
QVERIFY(list == result);
}
+QT_WARNING_POP
}
void tst_QString::split()