Fix CI build and REUSE lint failures

Use QByteArray::data() instead of constData() for the
udev_device_set_sysattr_value call — Alpine libudev declares the
value parameter as char*, not const char*. Fix the SPDX license
identifier in CategoryPanel.qml from "EUPL 1.2" to "EUPL-1.2".
This commit is contained in:
Marco Allegretti 2026-04-19 07:10:14 +02:00
parent caef3bc82e
commit 53686d4ef0
2 changed files with 3 additions and 4 deletions

View file

@ -1,5 +1,5 @@
// SPDX-FileCopyrightText: Marco Allegretti
// SPDX-License-Identifier: EUPL 1.2
// SPDX-License-Identifier: EUPL-1.2
import QtQuick
import QtQuick.Controls as QQC2

View file

@ -34,7 +34,7 @@ KAuth::ActionReply Flashlighthelper::setbrightness(const QVariantMap &args)
// (need to double-check this, but seems likely to be the cause of the random failures
// we were seeing in testing)
const QByteArray sysPathBytes = args.value("sysPath"_L1).toString().toUtf8();
const QByteArray brightnessBytes = args.value("brightness"_L1).toString().toUtf8();
QByteArray brightnessBytes = args.value("brightness"_L1).toString().toUtf8();
if (sysPathBytes.isEmpty()) {
qCWarning(FLASHLIGHTHELPER) << "sysPath argument is missing or empty";
@ -54,8 +54,7 @@ KAuth::ActionReply Flashlighthelper::setbrightness(const QVariantMap &args)
return KAuth::ActionReply::HelperErrorReply();
}
// The libudev header declares value as const char*, so no cast needed.
int ret = udev_device_set_sysattr_value(device, "brightness", brightnessBytes.constData());
int ret = udev_device_set_sysattr_value(device, "brightness", brightnessBytes.data());
udev_device_unref(device);
udev_unref(udev);