refactor: simplify sources processing

Also fix desktop source
This commit is contained in:
2024-03-28 11:14:45 +02:00
parent 0bcceefd47
commit a35b57e5d2
69 changed files with 552 additions and 1087 deletions

View File

@ -30,13 +30,11 @@ class BatterySource : public AbstractExtSysMonSource
public:
const int TREND_LIMIT = 20;
explicit BatterySource(QObject *_parent, const QStringList &_args);
~BatterySource() override;
QStringList getSources();
explicit BatterySource(QObject *_parent, QString _acpiPath);
~BatterySource() override = default;
QVariant data(const QString &_source) override;
[[nodiscard]] KSysGuard::SensorInfo *initialData(const QString &_source) const override;
void run() override;
[[nodiscard]] QStringList sources() const override;
void run();
[[nodiscard]] QHash<QString, KSysGuard::SensorInfo *> sources() const override;
private:
static double approximate(const QList<int> &_trend);