-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Expand file tree
/
Copy pathuse-session-bus.patch
More file actions
20 lines (19 loc) · 935 Bytes
/
use-session-bus.patch
File metadata and controls
20 lines (19 loc) · 935 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
--- a/Battery.cxx
+++ b/Battery.cxx
@@ -41,7 +41,7 @@
hide();
else
{
- QDBusConnection::systemBus()
+ QDBusConnection::sessionBus()
.connect("org.freedesktop.UPower",
"/org/freedesktop/UPower",
"org.freedesktop.DBus.Properties",
@@ -55,7 +55,7 @@
"org.freedesktop.DBus.Properties",
"Get");
msg << QLatin1String("org.freedesktop.UPower") << QLatin1String("OnBattery");
- QDBusConnection::systemBus().callWithCallback(msg, this, SLOT(onBatteryReply(QDBusMessage)), nullptr);
+ QDBusConnection::sessionBus().callWithCallback(msg, this, SLOT(onBatteryReply(QDBusMessage)), nullptr);
connect(device.as<Solid::Battery>(), &Solid::Battery::chargePercentChanged, this, &Battery::changed);
connect(device.as<Solid::Battery>(), &Solid::Battery::chargeStateChanged, this, &Battery::changed);