Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 97f39000 authored by Bhushan Shah's avatar Bhushan Shah 📱

Revert "skip the disabled backlight device"

This reverts commits 86c3548d and
5c0d35ca.

Not all raw interfaces have device/enabled under the backlight sysfs
interface. Some examples are nvidia-bl and acpi_video0, they are raw
interfaces but doesn't have device/enabled properties.

Overall we can just return true even if file doesn't exist but then this
code serves no purpose.

BUG: 381114
BUG: 381199
Ackd-by: Kai Uwe Broulik's avatarKai Uwe Broulik <kde@privat.broulik.de>
CCMAIL: AceLan Kao <acelan@acelan.idv.tw>
parent 7082c940
......@@ -63,22 +63,6 @@ void BacklightHelper::init()
m_isSupported = true;
}
bool BacklightHelper::isRawBacklightEnabled(const QString &interface)
{
QFile file(BACKLIGHT_SYSFS_PATH + interface + "/device/enabled");
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
return false;
}
QByteArray buffer = file.readLine().trimmed();
if (buffer == "enabled") {
return true;
}
return false;
}
void BacklightHelper::initUsingBacklightType()
{
QDir backlightDir(BACKLIGHT_SYSFS_PATH);
......@@ -103,9 +87,7 @@ void BacklightHelper::initUsingBacklightType()
} else if(buffer == "platform") {
platform.append(interface);
} else if (buffer == "raw") {
if (isRawBacklightEnabled(interface)) {
raw.append(interface);
}
raw.append(interface);
} else {
qCWarning(POWERDEVIL) << "Interface type not handled" << buffer;
}
......
......@@ -52,11 +52,6 @@ private:
*/
void initUsingSysctl();
/**
* Check for a raw backlight interface if it's enabled by drm driver
*/
static bool isRawBacklightEnabled(const QString &interface);
bool m_isSupported = false;
QString m_dirname;
QString m_sysctlDevice;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment