diff --git a/src/xkb.cpp b/src/xkb.cpp index e82de0a6c1..cb96207ba7 100644 --- a/src/xkb.cpp +++ b/src/xkb.cpp @@ -413,9 +413,9 @@ QString Xkb::layoutName() const return layoutName(m_currentLayout); } -const QString &Xkb::layoutShortName(int index) const +QString Xkb::layoutShortName(int index) const { - return m_layoutList.at(index); + return m_layoutList.value(index); } void Xkb::updateConsumedModifiers(uint32_t key) diff --git a/src/xkb.h b/src/xkb.h index e610d37ae6..11524cc028 100644 --- a/src/xkb.h +++ b/src/xkb.h @@ -89,7 +89,7 @@ class KWIN_EXPORT Xkb : public QObject } QString layoutName(xkb_layout_index_t index) const; QString layoutName() const; - const QString &layoutShortName(int index) const; + QString layoutShortName(int index) const; quint32 numberOfLayouts() const; /**