From b33c5d9fbba50536eb5afbee0c5f633c9f0236b2 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Thu, 23 Nov 2023 10:25:15 +0200 Subject: [PATCH] autotests: Prevent sticky keys leaking to other tests --- autotests/integration/kwin_wayland_test.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/autotests/integration/kwin_wayland_test.cpp b/autotests/integration/kwin_wayland_test.cpp index 48af36b495..482b30996b 100644 --- a/autotests/integration/kwin_wayland_test.cpp +++ b/autotests/integration/kwin_wayland_test.cpp @@ -46,8 +46,17 @@ WaylandTestApplication::WaylandTestApplication(OperationMode mode, int &argc, ch : Application(mode, argc, argv) { QStandardPaths::setTestModeEnabled(true); - // TODO: add a test move to kglobalaccel instead? - QFile{QStandardPaths::locate(QStandardPaths::ConfigLocation, QStringLiteral("kglobalshortcutsrc"))}.remove(); + + const QStringList configs{ + QStringLiteral("kaccessrc"), + QStringLiteral("kglobalshortcutsrc"), + }; + for (const QString &config : configs) { + if (const QString &fileName = QStandardPaths::locate(QStandardPaths::ConfigLocation, config); !fileName.isEmpty()) { + QFile::remove(fileName); + } + } + QIcon::setThemeName(QStringLiteral("breeze")); #if KWIN_BUILD_ACTIVITIES setUseKActivities(false);