Bug 485164

Summary: Saving System Monitor settings as preset is broken
Product: [Plasma] plasmashell Reporter: fbm224
Component: System MonitorAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: ahiemstra, kdedev, kerown, nate, notmart
Priority: HI    
Version: 6.0.3   
Target Milestone: 1.0   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In: 6.2.4
Sentry Crash Report:
Attachments: Showing how saving a configuration, has no effect on the list for loading a configuration.

Description fbm224 2024-04-07 00:59:34 UTC
SUMMARY
Can't save and retrieve any settings on the system Monitor applet 

STEPS TO REPRODUCE
1. Add the applet to the desktop, customize, change title, press save preferences
2. Press the button to open saved preferences, the new preferences are not listed.

EXPECTED RESULT
Self explanatory (I hope)

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 6.0.3
(available in About System)
KDE Plasma Version:  6.03
KDE Frameworks Version: 6.0.0 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Nate Graham 2024-08-16 17:07:09 UTC
I'm afraid it's not; can you attach a screenshot or screen recording that shows the issue?

...If it's still happening in Plasma 6.1.4 or later, of course.
Comment 2 Bug Janitor Service 2024-08-31 03:47:42 UTC
๐Ÿ›๐Ÿงน โš ๏ธ This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information, then set the bug status to REPORTED. If there is no change for at least 30 days, it will be automatically closed as RESOLVED WORKSFORME.

For more information about our bug triaging procedures, please read https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging.

Thank you for helping us make KDE software even better for everyone!
Comment 3 fbm224 2024-08-31 20:15:00 UTC
Created attachment 173181 [details]
Showing how saving a configuration, has no effect on the list for loading a configuration.

In this video I show how saving a personalized sensor configuration, has no effect on the available configurations that can be loaded.
Comment 4 fbm224 2024-10-17 20:25:11 UTC
This seems to be the same as: https://bugs.kde.org/show_bug.cgi?id=490558

Still same issue in Plasma 6.2.1
Comment 5 Nate Graham 2024-10-22 18:22:04 UTC
*** Bug 490558 has been marked as a duplicate of this bug. ***
Comment 6 Nate Graham 2024-10-22 18:32:00 UTC
Can reproduce. Clicking the button produces the following output in the journal log:

kf.package: Could not find required file "metadata" for package "/tmp/plasmashell-VcAAkA/" should be QList("metadata.json", "metadata.desktop")
Comment 7 Bug Janitor Service 2024-11-07 10:59:26 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/libksysguard/-/merge_requests/380
Comment 8 Arjen Hiemstra 2024-11-15 15:20:18 UTC
Git commit 1fba81df1f93ddc21547922c11580beec0a69b0e by Arjen Hiemstra.
Committed on 14/11/2024 at 12:44.
Pushed by ahiemstra into branch 'master'.

faces: Ensure the temporary dir for a preset remains until installed

QTemporaryDir deletes the temporary directory when it goes out of scope.
However, installing the preset with KPackage is an asynchronous
operation that can extend beyond the current scope. This can cause the
preset data to be deleted while we're still installing. To ensure this
doesn't happen, extend the lifetime of the QTemporaryDir into the lambda
we use to handle the job finished, so that it lives at least as long as
the job.

M  +6    -1    faces/SensorFaceController.cpp

https://invent.kde.org/plasma/libksysguard/-/commit/1fba81df1f93ddc21547922c11580beec0a69b0e
Comment 9 Arjen Hiemstra 2024-11-15 15:54:50 UTC
Git commit 9ea3571c903db1ebe72d5091eefc052288af252f by Arjen Hiemstra.
Committed on 15/11/2024 at 15:51.
Pushed by ahiemstra into branch 'Plasma/6.2'.

faces: Ensure the temporary dir for a preset remains until installed

QTemporaryDir deletes the temporary directory when it goes out of scope.
However, installing the preset with KPackage is an asynchronous
operation that can extend beyond the current scope. This can cause the
preset data to be deleted while we're still installing. To ensure this
doesn't happen, extend the lifetime of the QTemporaryDir into the lambda
we use to handle the job finished, so that it lives at least as long as
the job.

M  +6    -1    faces/SensorFaceController.cpp

https://invent.kde.org/plasma/libksysguard/-/commit/9ea3571c903db1ebe72d5091eefc052288af252f