From d831a45622d8497b292188291d8dfa4c67fce52a Mon Sep 17 00:00:00 2001 From: Alessio Molinari Date: Sun, 4 Feb 2024 18:01:26 +0100 Subject: [PATCH] fix: restore signature --- include/modules/bluetooth.hpp | 2 +- src/modules/bluetooth.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/modules/bluetooth.hpp b/include/modules/bluetooth.hpp index b0ed10ba..89658dcf 100644 --- a/include/modules/bluetooth.hpp +++ b/include/modules/bluetooth.hpp @@ -55,7 +55,7 @@ class Bluetooth : public ALabel { GDBusProxy*, GVariant*, const gchar* const*, gpointer) -> void; - auto getDeviceBatteryPercentage(GDBusObject*, GDBusProxy*) -> std::optional; + auto getDeviceBatteryPercentage(GDBusObject*) -> std::optional; auto getDeviceProperties(GDBusObject*, DeviceInfo&) -> bool; auto getControllerProperties(GDBusObject*, ControllerInfo&) -> bool; diff --git a/src/modules/bluetooth.cpp b/src/modules/bluetooth.cpp index 7b94e59e..0bfc4ac3 100644 --- a/src/modules/bluetooth.cpp +++ b/src/modules/bluetooth.cpp @@ -336,11 +336,11 @@ auto waybar::modules::Bluetooth::onInterfaceProxyPropertiesChanged( } } -auto waybar::modules::Bluetooth::getDeviceBatteryPercentage(GDBusObject* object, - GDBusProxy* proxy_device) +auto waybar::modules::Bluetooth::getDeviceBatteryPercentage(GDBusObject* object) -> std::optional { GDBusProxy* proxy_device_bat = G_DBUS_PROXY(g_dbus_object_get_interface(object, "org.bluez.Battery1")); + GDBusProxy* proxy_device = G_DBUS_PROXY(g_dbus_object_get_interface(object, "org.bluez.Device1")); if (proxy_device_bat != NULL) { unsigned char battery_percentage = getUcharProperty(proxy_device_bat, "Percentage"); g_object_unref(proxy_device_bat); @@ -392,7 +392,7 @@ auto waybar::modules::Bluetooth::getDeviceProperties(GDBusObject* object, Device g_object_unref(proxy_device); - device_info.battery_percentage = getDeviceBatteryPercentage(object, proxy_device); + device_info.battery_percentage = getDeviceBatteryPercentage(object); return true; }