D28333: Add a new daemon for stats monitoring

Ivan Čukić noreply at phabricator.kde.org
Tue Apr 21 10:25:46 BST 2020


ivan added inline comments.

INLINE COMMENTS

> client.cpp:65-66
> +            m_connections.insertMulti(sensor, connect(sensor, &SensorProperty::sensorInfoChanged, this, [this, sensor]() {
> +                auto newInfo = sensor->info();
> +                m_pendingMetaDataChanges[sensor->path()] = newInfo;
> +            }));

... = sensor->info();

> client.cpp:79-80
> +    for (const QString &sensorPath : sensorPaths) {
> +        auto sensor = m_subscribedSensors.take(sensorPath);
> +        if (sensor) {
> +            disconnect(m_connections.take(sensor));

if (auto sensor = ...)

> ksysguarddaemon.cpp:74
> +    auto pluginObjects = KPluginLoader::instantiatePlugins("ksysguard", nullptr, this);
> +    std::for_each(pluginObjects.constBegin(), pluginObjects.constEnd(), [=](QObject *plugin) {
> +        auto factory = qobject_cast<KPluginFactory*>(plugin);

`[=]` is evil

> ksysguarddaemon.cpp:111-113
> +    for (auto c : m_containers) {
> +        for(auto o : c->objects()) {
> +            for (auto p : o->sensors()) {

clang-format

> ksysguarddaemon.cpp:161
> +        if (SensorProperty *sensorProperty = findSensor(sensorId)) {
> +            const QVariant value = sensorProperty->value();
> +            if (value.isValid()) {

I'm not going to be bold enough to propose

  if (const auto variant = ...; variant.isValid()) { }

> ksysguarddaemon.cpp:172-173
> +{
> +    int subsystemIndex = path.indexOf('/');
> +    int propertyIndex = path.lastIndexOf('/');
> +

const int, const int

REPOSITORY
  R106 KSysguard

REVISION DETAIL
  https://phabricator.kde.org/D28333

To: davidedmundson, #plasma
Cc: ivan, mart, zzag, plasma-devel, Orage, LeGast00n, The-Feren-OS-Dev, cblack, jraleigh, zachus, fbampaloukas, ragreen, ZrenBot, ngraham, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20200421/d8671ea0/attachment-0001.html>


More information about the Plasma-devel mailing list