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

@ -57,34 +57,33 @@ void ExtSysMonAggregator::init(const QHash<QString, QString> &_config)
qCDebug(LOG_ESM) << "Configuration" << _config;
// battery
createSensor("battery", i18n("Battery"), new BatterySource(this, {_config["ACPIPATH"]}));
createSensor("battery", i18n("Battery"), new BatterySource(this, _config["ACPIPATH"]));
// custom
createSensor("custom", i18n("Scripts"), new CustomSource(this, {}));
createSensor("custom", i18n("Scripts"), new CustomSource(this));
// desktop
// FIXME causes segfault in kde libs
// createSensor("desktop", i18n("Desktop"), new DesktopSource(this, {}));
createSensor("desktop", i18n("Desktop"), new DesktopSource(this));
// network
createSensor("network", i18n("Network"), new NetworkSource(this, {}));
createSensor("network", i18n("Network"), new NetworkSource(this));
// player
createSensor("player", i18n("Music player"),
new PlayerSource(this, {_config["PLAYER"], _config["MPDADDRESS"], _config["MPDPORT"], _config["MPRIS"],
_config["PLAYERSYMBOLS"]}));
new PlayerSource(this, _config["PLAYER"], _config["MPDADDRESS"], _config["MPDPORT"].toInt(),
_config["MPRIS"], _config["PLAYERSYMBOLS"].toInt()));
// processes
createSensor("ps", i18n("Processes"), new ProcessesSource(this, {}));
createSensor("ps", i18n("Processes"), new ProcessesSource(this));
// network request
createSensor("requests", i18n("Network requests"), new RequestSource(this, {}));
createSensor("requests", i18n("Network requests"), new RequestSource(this));
// quotes
createSensor("quotes", i18n("Quotes"), new QuotesSource(this, {}));
createSensor("quotes", i18n("Quotes"), new QuotesSource(this));
// system
createSensor("system", i18n("System"), new SystemInfoSource(this, {}));
createSensor("system", i18n("System"), new SystemInfoSource(this));
// current time
createSensor("time", i18n("Time"), new TimeSource(this, {}));
createSensor("time", i18n("Time"), new TimeSource(this));
// upgrade
createSensor("upgrade", i18n("Upgrades"), new UpgradeSource(this, {}));
createSensor("upgrade", i18n("Upgrades"), new UpgradeSource(this));
// weather
createSensor("weather", i18n("Weather"), new WeatherSource(this, {}));
createSensor("weather", i18n("Weather"), new WeatherSource(this));
#ifdef BUILD_LOAD
// additional load source
createSensor("load", i18n("Load"), new LoadSource(this, {}));
createSensor("load", i18n("Load"), new LoadSource(this));
#endif /* BUILD_LOAD */
}