plasma: disengage the sensor manager in system-monitor applet

KSGRD::SensorMgr does not do it automatically

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2024-05-12 12:01:05 +03:00
parent 734c96df2b
commit 62e3280048

View file

@ -373,6 +373,7 @@ class SystemMonitorClient : public QObject, public KSGRD::SensorClient
Q_OBJECT
public:
SystemMonitorClient(QObject *parent);
~SystemMonitorClient();
bool setup(const QString &hostname, const int port);
QList<QByteArray> sensors() const;
@ -402,6 +403,13 @@ SystemMonitorClient::SystemMonitorClient(QObject *parent)
connect(KSGRD::SensorMgr, SIGNAL(update()), this, SLOT(slotUpdate()));
}
SystemMonitorClient::~SystemMonitorClient()
{
if (KSGRD::SensorMgr->isConnected(m_hostname)) {
KSGRD::SensorMgr->disengage(m_hostname);
}
}
bool SystemMonitorClient::setup(const QString &hostname, const int port)
{
if (KSGRD::SensorMgr->isConnected(m_hostname)) {