Commit 6db2401a authored by Andrey Butirsky's avatar Andrey Butirsky

feat: expose keyboard layout Long Name via DBus

This is X11 part.

For Wayland,
KWin counterpart commit is:
feat: expose keyboard layout Short Name via DBus

CCBUG: 390079
FEATURE:
parent 343ad3ba
......@@ -47,6 +47,7 @@ KeyboardDaemon::KeyboardDaemon(QObject *parent, const QList<QVariant>&)
xEventNotifier(nullptr),
layoutTrayIcon(nullptr),
layoutMemory(keyboardConfig),
currentLayout(X11Helper::getCurrentLayout()),
rules(Rules::readRules(Rules::READ_EXTRAS))
{
if( ! X11Helper::xkbSupported(nullptr) )
......@@ -232,7 +233,12 @@ bool KeyboardDaemon::setLayout(const QString& layout)
QString KeyboardDaemon::getCurrentLayout()
{
return X11Helper::getCurrentLayout().toString();
return currentLayout.toString();
}
QString KeyboardDaemon::getCurrentLayoutLongName() const
{
return Flags::getLongText(currentLayout, rules);
}
QStringList KeyboardDaemon::getLayoutsList()
......
......@@ -62,6 +62,7 @@ private Q_SLOTS:
public Q_SLOTS:
Q_SCRIPTABLE bool setLayout(const QString& layout);
Q_SCRIPTABLE QString getCurrentLayout();
Q_SCRIPTABLE QString getCurrentLayoutLongName() const;
Q_SCRIPTABLE QStringList getLayoutsList();
Q_SCRIPTABLE QString getLayoutDisplayName(const QString &layout);
......
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