File indexing completed on 2024-12-15 04:23:42
0001 /* 0002 SPDX-FileCopyrightText: 2019 Nicolas Fella <nicolas.fella@gmx.de> 0003 0004 SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #include "solidlockbackend.h" 0008 0009 #include "screensaverdbusinterface.h" 0010 0011 #include <QDBusConnection> 0012 0013 SolidLockBackend::SolidLockBackend(QObject *parent) 0014 : LockBackend(parent) 0015 , m_cookie(0) 0016 { 0017 m_iface = new OrgFreedesktopScreenSaverInterface(QStringLiteral("org.freedesktop.ScreenSaver"), QStringLiteral("/org/freedesktop/ScreenSaver"), QDBusConnection::sessionBus(), this); 0018 } 0019 0020 void SolidLockBackend::setInhibitionOff() 0021 { 0022 m_iface->UnInhibit(m_cookie); 0023 } 0024 0025 void SolidLockBackend::setInhibitionOn(const QString &explanation) 0026 { 0027 m_cookie = m_iface->Inhibit(QStringLiteral("org.kde.clip"), explanation); 0028 } 0029