[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...
This commit is contained in:
parent
42fd77b836
commit
8f0f84d2b3
2 changed files with 12 additions and 2 deletions
|
@ -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"));
|
||||
|
||||
|
|
Loading…
Reference in a new issue