diff options
Diffstat (limited to 'autotests')
-rw-r--r-- | autotests/kconfigtest.cpp | 2 | ||||
-rw-r--r-- | autotests/kdesktopfiletest.cpp | 8 | ||||
-rw-r--r-- | autotests/test_kconf_update.cpp | 8 |
3 files changed, 7 insertions, 11 deletions
diff --git a/autotests/kconfigtest.cpp b/autotests/kconfigtest.cpp index 6ab50b2f..23bcf195 100644 --- a/autotests/kconfigtest.cpp +++ b/autotests/kconfigtest.cpp @@ -513,7 +513,7 @@ void KConfigTest::testPath() KConfigGroup sc3(&sc2, "Path Type"); QCOMPARE(sc3.readPathEntry("homepath", QString()), HOMEPATH); QCOMPARE(sc3.readPathEntry("homepathescape", QString()), HOMEPATHESCAPE); - QCOMPARE(sc3.entryMap()["homepath"], HOMEPATH); + QCOMPARE(sc3.entryMap().value("homepath"), HOMEPATH); qputenv("WITHSLASH", "/a/"); { diff --git a/autotests/kdesktopfiletest.cpp b/autotests/kdesktopfiletest.cpp index e1b9c997..34391489 100644 --- a/autotests/kdesktopfiletest.cpp +++ b/autotests/kdesktopfiletest.cpp @@ -267,10 +267,10 @@ void KDesktopFileTest::testTryExecWithAuthorizeAction() void KDesktopFileTest::testLocateLocal_data() { - QString systemConfigLocation = QStandardPaths::standardLocations(QStandardPaths::GenericConfigLocation).last(); - QString writableConfigLocation = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation); - QString systemDataLocation = QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation).last(); - QString writableDataLocation = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation); + const QString systemConfigLocation = QStandardPaths::standardLocations(QStandardPaths::GenericConfigLocation).constLast(); + const QString writableConfigLocation = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation); + const QString systemDataLocation = QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation).constLast(); + const QString writableDataLocation = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation); QTest::addColumn<QString>("path"); QTest::addColumn<QString>("result"); diff --git a/autotests/test_kconf_update.cpp b/autotests/test_kconf_update.cpp index 52292083..ba716f28 100644 --- a/autotests/test_kconf_update.cpp +++ b/autotests/test_kconf_update.cpp @@ -331,9 +331,7 @@ void TestKConfUpdate::test() std::unique_ptr<QTemporaryFile> updFile(writeUpdFile(updContent)); runKConfUpdate(updFile->fileName()); - QString updateInfo = QStringLiteral("%1:%2") - .arg(updFile->fileName().section('/', -1)) - .arg(QTest::currentDataTag()); + QString updateInfo = QStringLiteral("%1:%2").arg(updFile->fileName().section(QLatin1Char('/'), -1), QTest::currentDataTag()); QString newConfContentAfter = readFile(newConfPath); if (shouldUpdateWork) { @@ -627,9 +625,7 @@ void TestKConfUpdate::testScript() runKConfUpdate(updFile->fileName()); - QString updateInfo = QStringLiteral("%1:%2") - .arg(updFile->fileName().section('/', -1)) - .arg(QTest::currentDataTag()); + QString updateInfo = QStringLiteral("%1:%2").arg(updFile->fileName().section(QLatin1Char('/'), -1), QTest::currentDataTag()); QString newConfContent = readFile(confPath); expectedNewConfContent = expectedNewConfContent.arg(updateInfo); QCOMPARE(newConfContent, expectedNewConfContent); |