do not derive from qwidget in aggregates

This commit is contained in:
2024-03-21 18:08:19 +02:00
parent 33a41bb6c0
commit 67640cccdc
35 changed files with 428 additions and 444 deletions

View File

@ -75,7 +75,7 @@ QVariant GPULoadSource::data(const QString &_source)
{
qCDebug(LOG_ESS) << "Source" << _source;
if (_source == "gpu/load")
if (_source == "load")
run();
return m_values[_source];
@ -87,7 +87,7 @@ KSysGuard::SensorInfo *GPULoadSource::initialData(const QString &_source) const
qCDebug(LOG_ESS) << "Source" << _source;
auto data = new KSysGuard::SensorInfo();
if (_source == "gpu/load") {
if (_source == "load") {
data->min = 0.0;
data->max = 100.0;
data->name = "GPU usage";
@ -115,7 +115,7 @@ void GPULoadSource::run()
QStringList GPULoadSource::sources() const
{
QStringList sources;
sources.append("gpu/load");
sources.append("load");
return sources;
}
@ -134,7 +134,7 @@ void GPULoadSource::updateValue()
if (!str.contains("<gpu_util>"))
continue;
auto load = str.remove("<gpu_util>").remove("</gpu_util>").remove('%');
m_values["gpu/load"] = load.toFloat();
m_values["load"] = load.toFloat();
break;
}
} else if (m_device == "ati") {
@ -142,7 +142,7 @@ void GPULoadSource::updateValue()
if (!str.contains("load"))
continue;
QString load = str.split(' ', Qt::SkipEmptyParts)[3].remove('%');
m_values["gpu/load"] = load.toFloat();
m_values["load"] = load.toFloat();
break;
}
}