refactor: split formatters and matchers into separated singleton classes (#166)

* split formatter into separated singleton classes

* split data engine matchers to classes

* nodiscard attribute for formatter methods

* small refactoring in matchers

* fix codefactor warnings

* fix test building
This commit is contained in:
2024-04-30 21:52:39 +03:00
parent 95572364c1
commit 64b4618904
182 changed files with 4928 additions and 766 deletions

View File

@ -29,14 +29,15 @@ class SystemInfoSource : public AbstractExtSysMonSource
public:
explicit SystemInfoSource(QObject *_parent);
~SystemInfoSource() override = default;
QVariant data(const QString &_source) override;
[[nodiscard]] QVariant data(const QString &_source) override;
[[nodiscard]] QHash<QString, KSysGuard::SensorInfo *> sources() const override;
private:
// configuration and values
static QVariant fromDBusVariant(const QVariant &_value);
static double getCurrentBrightness();
static double getCurrentVolume();
static QVariant sendDBusRequest(const QString &_destination, const QString &_path, const QString &_interface,
const QString &_method, const QVariantList &_args = {});
[[nodiscard]] static QVariant fromDBusVariant(const QVariant &_value);
[[nodiscard]] static double getCurrentBrightness();
[[nodiscard]] static double getCurrentVolume();
[[nodiscard]] static QVariant sendDBusRequest(const QString &_destination, const QString &_path,
const QString &_interface, const QString &_method,
const QVariantList &_args = {});
};