diff --git a/shell/osd.h b/shell/osd.h --- a/shell/osd.h +++ b/shell/osd.h @@ -22,6 +22,8 @@ #include #include +#include + namespace KDeclarative { class QmlObject; } @@ -67,6 +69,7 @@ void showOsd(); QString m_osdPath; + KConfigGroup m_osdConfig; KDeclarative::QmlObject *m_osdObject = nullptr; QTimer *m_osdTimer = nullptr; int m_timeout = 0; diff --git a/shell/osd.cpp b/shell/osd.cpp --- a/shell/osd.cpp +++ b/shell/osd.cpp @@ -28,10 +28,12 @@ #include #include #include +#include Osd::Osd(ShellCorona *corona) : QObject(corona) , m_osdPath(corona->lookAndFeelPackage().filePath("osdmainscript")) + , m_osdConfig(KConfigGroup(KSharedConfig::openConfig(QStringLiteral("plasmarc")), QStringLiteral("OSD"))) { QDBusConnection::sessionBus().registerObject(QStringLiteral("/org/kde/osdService"), this, QDBusConnection::ExportAllSlots | QDBusConnection::ExportAllSignals); } @@ -153,6 +155,10 @@ bool Osd::init() { + if (!m_osdConfig.readEntry(QStringLiteral("Enabled"), true)) { + return false; + } + if (m_osdObject && m_osdObject->rootObject()) { return true; }