8#include "fdpowernotifier.h"
10#include <QDBusConnection>
13Solid::FDPowerNotifier::FDPowerNotifier(
QObject *parent)
14 : PowerNotifier(parent)
17 conn.connect(QStringLiteral(
"org.freedesktop.UPower"),
18 QStringLiteral(
"/org/freedesktop/UPower"),
19 QStringLiteral(
"org.freedesktop.DBus.Properties"),
20 QStringLiteral(
"PropertiesChanged"),
24 conn.connect(QStringLiteral(
"org.freedesktop.login1"),
25 QStringLiteral(
"/org/freedesktop/login1"),
26 QStringLiteral(
"org.freedesktop.login1.Manager"),
27 QStringLiteral(
"PrepareForSleep"),
29 SLOT(login1Resuming(
bool)));
32void Solid::FDPowerNotifier::upowerPropertiesChanged(
const QString &interface,
const QVariantMap &changedProperties,
const QStringList &invalidated)
34 if (interface != QStringLiteral(
"org.freedesktop.UPower")) {
38 if (changedProperties.contains(QStringLiteral(
"OnBattery"))) {
39 Q_EMIT acPluggedChanged(!changedProperties.value(QStringLiteral(
"OnBattery")).toBool());
44 qDebug() <<
"Invalidated" << invalidated;
48void Solid::FDPowerNotifier::login1Resuming(
bool active)
51 Q_EMIT aboutToSuspend();
53 Q_EMIT resumeFromSuspend();
57#include "moc_fdpowernotifier.cpp"
QDBusConnection systemBus()
bool isEmpty() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 11 2024 12:08:14 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.