Bug 432254 - Sensors must be added twice to show up in preview of edit mode
Summary: Sensors must be added twice to show up in preview of edit mode
Status: RESOLVED FIXED
Alias: None
Product: plasma-systemmonitor
Classification: Applications
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KSysGuard Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-28 16:42 UTC by Thiago Sueto
Modified: 2021-02-02 14:01 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thiago Sueto 2021-01-28 16:42:30 UTC
SUMMARY
If you create a new page, click on Edit Page, click on the default sector graph, click on the Sensors field and select any sensor, no sensors show up unless you select the same sensor at least twice.

This only happens with the Sensors field, not Total Sensors or Text-Only Sensors.

STEPS TO REPRODUCE
1. Create new page
2. Click Edit Page
3. Click the default sector graph to open the edit sidebar
4. Click the Sensors field

(Any of the following steps will reproduce the issue, but requires discarding changes before attempting again)

5a. Select CPUs > All > Number of Cores
5b. Select it again

6a. Select CPUs > All > Number of Cores
6b. Select CPUs > All > Number of CPUs
6c. Select CPUs > All > Number of Cores (again)

7a. Select CPUs > All > Number of Cores
7b. Switch to Display Style Horizontal Bars
7c. Select CPUs > All > Number of Cores

OBSERVED RESULT
The desired sensor only gets added after second time.
After any sensor gets added properly, all other sensors are added properly on first selection.

EXPECTED RESULT
The desired sensor should be added immediately.

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20210126 (Krypton)
KDE Plasma Version: 5.21.80
KDE Frameworks Version: 5.79.0
Qt Version: 5.15.2
Comment 1 Bug Janitor Service 2021-01-29 10:38:45 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/libksysguard/-/merge_requests/113
Comment 2 David Redondo 2021-02-02 13:58:52 UTC
Git commit f0600a7e53ba0792ffba190cb54c70c7aa1605fd by David Redondo.
Committed on 02/02/2021 at 13:56.
Pushed by davidre into branch 'master'.

Do the sensor setters in two stages

When saveConfig() in ConfigSensors.qml is called we started resolving sensors,
when during this time loadConfig() was called we returned the old sensors, which
when then triggeded another saveConfig() call by  plasma-systemmonitor leading us to
effectively reset ourselves.
The setters are now in two stages, during resolving time we set the properties
to the unresolved value, so we are in sync with what the qml part did. Also we not
do another resolve when something tries to set the current unresolved ids.

M  +43   -16   faces/SensorFaceController.cpp

https://invent.kde.org/plasma/libksysguard/commit/f0600a7e53ba0792ffba190cb54c70c7aa1605fd
Comment 3 David Redondo 2021-02-02 14:01:49 UTC
Git commit 679a24f373d7fa04ec279cedf95740b870efc9df by David Redondo.
Committed on 02/02/2021 at 14:01.
Pushed by davidre into branch 'Plasma/5.21'.

Do the sensor setters in two stages

When saveConfig() in ConfigSensors.qml is called we started resolving sensors,
when during this time loadConfig() was called we returned the old sensors, which
when then triggeded another saveConfig() call by  plasma-systemmonitor leading us to
effectively reset ourselves.
The setters are now in two stages, during resolving time we set the properties
to the unresolved value, so we are in sync with what the qml part did. Also we not
do another resolve when something tries to set the current unresolved ids.


(cherry picked from commit f0600a7e53ba0792ffba190cb54c70c7aa1605fd)

M  +43   -16   faces/SensorFaceController.cpp

https://invent.kde.org/plasma/libksysguard/commit/679a24f373d7fa04ec279cedf95740b870efc9df