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,17 +30,13 @@ class WeatherSource : public AbstractExtSysMonSource
Q_OBJECT
public:
explicit WeatherSource(QObject *_parent, const QStringList &_args);
~WeatherSource() override;
explicit WeatherSource(QObject *_parent);
~WeatherSource() 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;
[[nodiscard]] QHash<QString, KSysGuard::SensorInfo *> sources() const override;
private:
QStringList getSources();
// configuration and values
ExtItemAggregator<ExtWeather> *m_extWeather = nullptr;
QStringList m_sources;
QVariantHash m_values;
};