solid: fix check that CPU is valid

upstream commit:
f55f25fc72

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2020-08-20 00:05:51 +03:00
parent dfca8f29f6
commit b96da9aad3

View file

@ -27,6 +27,7 @@
#include <QtCore/QSet>
#include <QtCore/QFile>
#include <QtCore/QDir>
#include <QtCore/QDebug>
using namespace Solid::Backends::UDev;
@ -99,7 +100,8 @@ bool UDevManager::Private::checkOfInterest(const UdevQt::Device &device)
if (device.driver() == QLatin1String("processor")) {
// Linux ACPI reports processor slots, rather than processors.
// Empty slots will not have a system device associated with them.
return QFile::exists(device.sysfsPath() + "/sysdev") || QFile::exists(device.sysfsPath() + "/cpufreq");
QDir sysfsDir(device.sysfsPath());
return (sysfsDir.exists("sysdev") || sysfsDir.exists("cpufreq") || sysfsDir.exists("topology/core_id"));
}
if (device.subsystem() == QLatin1String("sound") &&
device.deviceProperty("SOUND_FORM_FACTOR").toString() != "internal") {