aboutsummaryrefslogtreecommitdiff
path: root/autotests
diff options
context:
space:
mode:
authorNicolas Fella <nicolas.fella@gmx.de>2020-12-10 21:15:56 +0100
committerNicolas Fella <nicolas.fella@gmx.de>2021-01-17 19:53:29 +0000
commit63b88fed74445e64f05f4cade352a56c7291375e (patch)
treeb90faaaae3d3dde0a7b9f621c1786d8f65287ebc /autotests
parente4a8a8806c3ebefea4841a59ddee2db8f0d8117a (diff)
downloadkconfig-63b88fed74445e64f05f4cade352a56c7291375e.tar.gz
kconfig-63b88fed74445e64f05f4cade352a56c7291375e.tar.bz2
Adapt to Qt6 text codec changes
In Qt6 QTextCodec/QTextStream::setCodec is replaced with QTextStream::setEncoding(QStringConverter::Encoding) Also UTF-8 is the new default for QTextStream.
Diffstat (limited to 'autotests')
-rw-r--r--autotests/kconfigtest.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/autotests/kconfigtest.cpp b/autotests/kconfigtest.cpp
index 20414e45..6f79f072 100644
--- a/autotests/kconfigtest.cpp
+++ b/autotests/kconfigtest.cpp
@@ -518,7 +518,9 @@ void KConfigTest::testPath()
QFile file(testConfigDir() + "/pathtest");
file.open(QIODevice::WriteOnly | QIODevice::Text);
QTextStream out(&file);
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
out.setCodec("UTF-8");
+#endif
out << "[Test Group]\n"
<< "homePath=$HOME/foo\n"
<< "homePath2=file://$HOME/foo\n"
@@ -580,7 +582,9 @@ void KConfigTest::testPathQtHome()
QFile file(testConfigDir() + "/pathtest");
file.open(QIODevice::WriteOnly | QIODevice::Text);
QTextStream out(&file);
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
out.setCodec("UTF-8");
+#endif
out << "[Test Group]\n"
<< "dataDir[$e]=$QT_DATA_HOME/kconfigtest\n"
<< "cacheDir[$e]=$QT_CACHE_HOME/kconfigtest\n"
@@ -1020,7 +1024,9 @@ void KConfigTest::testMerge()
QFile file(testConfigDir() + "/mergetest");
file.open(QIODevice::WriteOnly | QIODevice::Text);
QTextStream out(&file);
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
out.setCodec("UTF-8");
+#endif
out << "[Merged Group]\n"
<< "entry1=Testing\n"
<< "entry2=More Testing\n"
@@ -1058,7 +1064,9 @@ void KConfigTest::testImmutable()
QFile file(testConfigDir() + "/immutabletest");
file.open(QIODevice::WriteOnly | QIODevice::Text);
QTextStream out(&file);
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
out.setCodec("UTF-8");
+#endif
out << "[$i]\n"
<< "entry1=Testing\n"
<< "[group][$i]\n"
@@ -1083,7 +1091,9 @@ void KConfigTest::testOptionOrder()
QFile file(testConfigDir() + "/doubleattrtest");
file.open(QIODevice::WriteOnly | QIODevice::Text);
QTextStream out(&file);
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
out.setCodec("UTF-8");
+#endif
out << "[group3]\n"
<< "entry2=unlocalized\n"
<< "entry2[$i][de_DE]=t2\n";