diff --git a/src/cursor.cpp b/src/cursor.cpp index 74081489c8..dbf48eebd8 100644 --- a/src/cursor.cpp +++ b/src/cursor.cpp @@ -246,7 +246,7 @@ xcb_cursor_t Cursor::x11Cursor(const QByteArray &name) xcb_cursor_t cursor = xcb_cursor_load_cursor(ctx, name.constData()); if (cursor == XCB_CURSOR_NONE) { - const auto &names = Cursor::cursorAlternativeNames(name); + const auto &names = CursorShape::alternatives(name); for (const QByteArray &cursorName : names) { cursor = xcb_cursor_load_cursor(ctx, cursorName.constData()); if (cursor != XCB_CURSOR_NONE) { @@ -330,7 +330,17 @@ void Cursor::doStopCursorTracking() { } -QList Cursor::cursorAlternativeNames(const QByteArray &name) +QString Cursor::defaultThemeName() +{ + return QStringLiteral("default"); +} + +int Cursor::defaultThemeSize() +{ + return 24; +} + +QList CursorShape::alternatives(const QByteArray &name) { static const QHash> alternatives = { { @@ -619,16 +629,6 @@ QList Cursor::cursorAlternativeNames(const QByteArray &name) return QList(); } -QString Cursor::defaultThemeName() -{ - return QStringLiteral("default"); -} - -int Cursor::defaultThemeSize() -{ - return 24; -} - QByteArray CursorShape::name() const { switch (m_shape) { diff --git a/src/cursor.h b/src/cursor.h index e632b90cc2..9e837064cc 100644 --- a/src/cursor.h +++ b/src/cursor.h @@ -71,6 +71,11 @@ public: */ QByteArray name() const; + /** + * Returns the list of alternative shape names for a shape with the specified @a name. + */ + static QList alternatives(const QByteArray &name); + private: int m_shape = Qt::ArrowCursor; }; @@ -136,10 +141,6 @@ public: * @return int */ int themeSize() const; - /** - * @return list of alternative names for the cursor with @p name - */ - static QList cursorAlternativeNames(const QByteArray &name); /** * Returns the default Xcursor theme name. */ diff --git a/src/cursorsource.cpp b/src/cursorsource.cpp index c3c5553e41..1ef7e5a3d6 100644 --- a/src/cursorsource.cpp +++ b/src/cursorsource.cpp @@ -76,7 +76,7 @@ void ShapeCursorSource::refresh() m_sprites = m_theme.shape(m_shape); if (m_sprites.isEmpty()) { - const auto alternativeNames = Cursor::cursorAlternativeNames(m_shape); + const auto alternativeNames = CursorShape::alternatives(m_shape); for (const QByteArray &alternativeName : alternativeNames) { m_sprites = m_theme.shape(alternativeName); if (!m_sprites.isEmpty()) {