Commit 8f0f84d2 authored by Martin Flöser's avatar Martin Flöser

[autotests] Try to detect whether distro calls cursor theme DMZ-White or Vanilla-DMZ

Some distributions (e.g. Arch, FreeBSD) call the DMZ-White cursor theme
Vanilla-DMZ. Due to that our tests are failing even if the correct theme
is installed (see also T6623). This change tries to detect whether
DMZ-White is installed by looking into the GenericDataLocation. If not
found we set to Vanilla-DMZ. No guarantee that the check works for all
setups, but it's only tests...
parent 42fd77b8
......@@ -97,7 +97,12 @@ void PointerInputTest::initTestCase()
kwinApp()->setConfig(KSharedConfig::openConfig(QString(), KConfig::SimpleConfig));
qputenv("XCURSOR_THEME", QByteArrayLiteral("DMZ-White"));
if (!QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("icons/DMZ-White/index.theme")).isEmpty()) {
qputenv("XCURSOR_THEME", QByteArrayLiteral("DMZ-White"));
} else {
// might be vanilla-dmz (e.g. Arch, FreeBSD)
qputenv("XCURSOR_THEME", QByteArrayLiteral("Vanilla-DMZ"));
}
qputenv("XCURSOR_SIZE", QByteArrayLiteral("24"));
qputenv("XKB_DEFAULT_RULES", "evdev");
......
......@@ -88,7 +88,12 @@ void SceneQPainterTest::initTestCase()
config->sync();
kwinApp()->setConfig(config);
qputenv("XCURSOR_THEME", QByteArrayLiteral("DMZ-White"));
if (!QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("icons/DMZ-White/index.theme")).isEmpty()) {
qputenv("XCURSOR_THEME", QByteArrayLiteral("DMZ-White"));
} else {
// might be vanilla-dmz (e.g. Arch, FreeBSD)
qputenv("XCURSOR_THEME", QByteArrayLiteral("Vanilla-DMZ"));
}
qputenv("XCURSOR_SIZE", QByteArrayLiteral("24"));
qputenv("KWIN_COMPOSE", QByteArrayLiteral("Q"));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment