Commit 61be205a authored by Andrey Butirsky's avatar Andrey Butirsky
Browse files

feat: add option to disable OSD on keyboard layout change

Counterpart commit with the same title is in P-D

CCBUG: 426450
CCBUG: 376460
parent 233f0f90
......@@ -31,7 +31,7 @@
Osd::Osd(const KSharedConfig::Ptr &config, ShellCorona *corona)
: QObject(corona)
, m_osdUrl(corona->lookAndFeelPackage().fileUrl("osdmainscript"))
, m_config(config)
, m_osdConfigGroup(config, "OSD")
{
QDBusConnection::sessionBus().registerObject(QStringLiteral("/org/kde/osdService"),
this,
......@@ -104,7 +104,9 @@ void Osd::mediaPlayerVolumeChanged(int percent, const QString &playerName, const
void Osd::kbdLayoutChanged(const QString &layoutName)
{
showText(QStringLiteral("keyboard-layout"), layoutName);
if (m_osdConfigGroup.readEntry("kbdLayoutChangedEnabled", true)) {
showText(QStringLiteral("keyboard-layout"), layoutName);
}
}
void Osd::virtualDesktopChanged(const QString &currentVirtualDesktopName)
......@@ -162,7 +164,7 @@ void Osd::virtualKeyboardEnabledChanged(bool virtualKeyboardEnabled)
bool Osd::init()
{
if (m_config && !KConfigGroup(m_config, QStringLiteral("OSD")).readEntry(QStringLiteral("Enabled"), true)) {
if (!m_osdConfigGroup.readEntry("Enabled", true)) {
return false;
}
......
......@@ -24,6 +24,7 @@
#include <QUrl>
#include <KSharedConfig>
#include <KConfigGroup>
namespace KDeclarative
{
......@@ -78,7 +79,7 @@ private:
QTimer *m_osdTimer = nullptr;
int m_timeout = 0;
KSharedConfig::Ptr m_config;
KConfigGroup m_osdConfigGroup;
};
#endif // OSD_H
Supports Markdown
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