autotests: Use ShapeCursorSource to load reference cursor images in testPointerInput
This commit is contained in:
parent
a472c90327
commit
b1908949d0
1 changed files with 4 additions and 24 deletions
|
@ -38,17 +38,6 @@
|
|||
namespace KWin
|
||||
{
|
||||
|
||||
static PlatformCursorImage loadReferenceThemeCursor_helper(const KXcursorTheme &theme,
|
||||
const QByteArray &name)
|
||||
{
|
||||
const QList<KXcursorSprite> sprites = theme.shape(name);
|
||||
if (sprites.isEmpty()) {
|
||||
return PlatformCursorImage();
|
||||
}
|
||||
|
||||
return PlatformCursorImage(sprites.constFirst().data(), sprites.constFirst().hotspot());
|
||||
}
|
||||
|
||||
static PlatformCursorImage loadReferenceThemeCursor(const QByteArray &name)
|
||||
{
|
||||
const Cursor *pointerCursor = Cursors::self()->mouse();
|
||||
|
@ -58,20 +47,11 @@ static PlatformCursorImage loadReferenceThemeCursor(const QByteArray &name)
|
|||
return PlatformCursorImage();
|
||||
}
|
||||
|
||||
PlatformCursorImage platformCursorImage = loadReferenceThemeCursor_helper(theme, name);
|
||||
if (!platformCursorImage.isNull()) {
|
||||
return platformCursorImage;
|
||||
}
|
||||
ShapeCursorSource source;
|
||||
source.setShape(name);
|
||||
source.setTheme(theme);
|
||||
|
||||
const QList<QByteArray> alternativeNames = Cursor::cursorAlternativeNames(name);
|
||||
for (const QByteArray &alternativeName : alternativeNames) {
|
||||
platformCursorImage = loadReferenceThemeCursor_helper(theme, alternativeName);
|
||||
if (!platformCursorImage.isNull()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return platformCursorImage;
|
||||
return PlatformCursorImage(source.image(), source.hotspot());
|
||||
}
|
||||
|
||||
static PlatformCursorImage loadReferenceThemeCursor(const CursorShape &shape)
|
||||
|
|
Loading…
Reference in a new issue