From 9f9b8478bd840f8d09dc767da44fa016deb1b37a Mon Sep 17 00:00:00 2001 From: Kate Hsuan Date: Tue, 11 Mar 2025 16:19:28 +0800 Subject: [PATCH] up-device-list: Introduce the UpDeviceKbdBacklight object MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit makes UpDeviceList store the UpDeviceKbdBacklight objects and sets the udev native path property of UpDevice and UpDeviceKbdBacklight. --- src/up-device-list.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/up-device-list.c b/src/up-device-list.c index af00894..216719d 100644 --- a/src/up-device-list.c +++ b/src/up-device-list.c @@ -28,6 +28,7 @@ #include "up-native.h" #include "up-device-list.h" #include "up-device.h" +#include "up-device-kbd-backlight.h" static void up_device_list_finalize (GObject *object); @@ -80,7 +81,10 @@ up_device_list_insert (UpDeviceList *list, gpointer device) g_return_val_if_fail (UP_IS_DEVICE_LIST (list), FALSE); g_return_val_if_fail (device != NULL, FALSE); - native = up_device_get_native (UP_DEVICE (device)); + if (UP_IS_DEVICE_KBD_BACKLIGHT (device)) + native = up_device_kbd_backlight_get_native (UP_DEVICE_KBD_BACKLIGHT (device)); + else + native = up_device_get_native (UP_DEVICE (device)); g_return_val_if_fail (native != NULL, FALSE); native_path = up_native_get_native_path (native);