Plasma5Support
powermanagementjob.cpp
14PowerManagementJob::PowerManagementJob(const QString &operation, QMap<QString, QVariant> ¶meters, QObject *parent)
23static void callWhenFinished(const QDBusPendingCall &pending, std::function<void(bool)> func, QObject *parent)
26 QObject::connect(watcher, &QDBusPendingCallWatcher::finished, parent, [func](QDBusPendingCallWatcher *watcher) {
37 if (m_sleepInhibitionCookie != -1) { // an inhibition request is already active; don't trigger another one
41 QDBusMessage msg = QDBusMessage::createMethodCall(QStringLiteral("org.freedesktop.PowerManagement.Inhibit"),
45 msg << QCoreApplication::applicationName() << parameters().value(QStringLiteral("reason")).toString();
59 QDBusMessage msg = QDBusMessage::createMethodCall(QStringLiteral("org.freedesktop.PowerManagement.Inhibit"),
65 m_sleepInhibitionCookie = reply.isValid() ? -1 : m_sleepInhibitionCookie; // reset cookie if the stop request was successful
77 if (m_lockInhibitionCookie != -1) { // an inhibition request is already active; don't trigger another one
85 msg << QCoreApplication::applicationName() << parameters().value(QStringLiteral("reason")).toString();
97 m_lockInhibitionCookie = reply.isValid() ? -1 : m_lockInhibitionCookie; // reset cookie if the stop request was successful
124 QDBusMessage msg = QDBusMessage::createMethodCall(QStringLiteral("org.kde.Solid.PowerManagement"),
char * toString(const EngineQuery &query)
applicationName
QDBusPendingCall asyncCall(const QDBusMessage &message, int timeout) const const
QDBusMessage call(const QDBusMessage &message, QDBus::CallMode mode, int timeout) const const
QDBusConnection sessionBus()
QDBusMessage createMethodCall(const QString &service, const QString &path, const QString &interface, const QString &method)
void finished(QDBusPendingCallWatcher *self)
bool isValid() const const
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
void deleteLater()
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:08:57 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:08:57 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.