aboutsummaryrefslogtreecommitdiff
path: root/autotests/kconfigtest.cpp
diff options
context:
space:
mode:
authorDavid Faure <faure@kde.org>2021-06-21 14:16:23 +0200
committerDavid Faure <faure@kde.org>2021-06-21 14:16:23 +0200
commit74a861c5617621663b1d5d8a1cd79c7a0eef9d8a (patch)
treec3e37882ffc5ee5fbff0d83f9e20ff2eb53775b1 /autotests/kconfigtest.cpp
parent6da4db6634560c13a0614c290f92d2dd5192e15e (diff)
downloadkconfig-74a861c5617621663b1d5d8a1cd79c7a0eef9d8a.tar.gz
kconfig-74a861c5617621663b1d5d8a1cd79c7a0eef9d8a.tar.bz2
kconfigtest: save/restore XDG_CONFIG_DIRS
No impact on the rest of the test, but I was wondering if it might break anything, better restore it just in case.
Diffstat (limited to 'autotests/kconfigtest.cpp')
-rw-r--r--autotests/kconfigtest.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/autotests/kconfigtest.cpp b/autotests/kconfigtest.cpp
index bf7882f0..d8cc417d 100644
--- a/autotests/kconfigtest.cpp
+++ b/autotests/kconfigtest.cpp
@@ -960,6 +960,7 @@ void KConfigTest::testCascadingWithLocale()
#ifdef Q_XDG_PLATFORM
QTemporaryDir middleDir;
QTemporaryDir globalDir;
+ const QByteArray oldConfigDirs = qgetenv("XDG_CONFIG_DIRS");
qputenv("XDG_CONFIG_DIRS", qPrintable(middleDir.path() + QLatin1Char(':') + globalDir.path()));
const QString globalConfigDir = globalDir.path() + QLatin1Char('/') + s_test_subdir;
@@ -999,6 +1000,7 @@ void KConfigTest::testCascadingWithLocale()
QCOMPARE(group.readEntry("FromLocal"), QStringLiteral("vrai"));
QCOMPARE(group.readEntry("Name"), QStringLiteral("FR"));
QCOMPARE(group.readEntry("Other"), QStringLiteral("English Only")); // Global_FR is locally overriden
+ qputenv("XDG_CONFIG_DIRS", oldConfigDirs);
#endif
}