feat: add option to disable OSD on keyboard layout change

Counterpart commit with the same title is in P-D

CCBUG: 426450
CCBUG: 376460
wilder-5.22
Andrey Butirsky 5 years ago
parent 233f0f90bc
commit 61be205a0d
  1. 8
      shell/osd.cpp
  2. 3
      shell/osd.h

@ -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

Loading…
Cancel
Save