Bug 504455

Summary: Unable to remove "Old Version" of a System Monitor page
Product: [Applications] plasma-systemmonitor Reporter: Schlaefer <openmail+kde>
Component: generalAssignee: KSysGuard Developers <ksysguard-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: ahiemstra, nate, plasma-bugs-null
Priority: NOR    
Version First Reported In: 6.3.90   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Trash button not available for old default page
Resetting and hidding worked after trying a few times

Description Schlaefer 2025-05-18 09:45:04 UTC
Created attachment 181451 [details]
Trash button not available for old default page

After System Monitor received a new set of default pages it moves existing, customized default pages to "<page-name> (Old Version)". 

It is not possible to remove those old pages. The Trash-button to remove pages isn't available (see attached screenshot).

Old pages should be removable.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.3.90
KDE Frameworks Version: 6.14.0
Qt Version: 6.9.0
Comment 1 Arjen Hiemstra 2025-05-19 10:29:49 UTC
The base files cannot be removed because they are in a location that cannot be written to. However, they should be hidden if you have no local changes anymore. Can you share the output of `sudo find / -name old-overview.page`?

One thing I did notice is that we don't properly hide the page after it has been reset while the application is still running. Can you check if it still shows up if you restart system monitor?
Comment 2 Schlaefer 2025-05-19 11:13:00 UTC
Created attachment 181505 [details]
Resetting and hidding worked after trying a few times

(In reply to Arjen Hiemstra from comment #1)
> `sudo find / -name old-overview.page`?

This is from a different machine than the original report, but it showed the same symptoms:

~/.local/share/plasma-systemmonitor/old-overview.page
/usr/share/plasma-systemmonitor/old-overview.page

> Can you check if it still shows up if you restart system monitor?

Happened after restarting the app and full reboots.

But I noticed some serious GUI stutter, like something is choking in the background. So I thought let's check if something throws and error on the CLI, and also record it. So that got me something interesting: It failed for another 2 times and worked after the 3rd try. 

Now `~/.local/share/plasma-systemmonitor/old-overview.page` is gone too. This was the content before it got removed: https://pastebin.com/uuMRDH27
Comment 3 Bug Janitor Service 2025-05-19 11:29:17 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-systemmonitor/-/merge_requests/359
Comment 4 Arjen Hiemstra 2025-05-19 14:17:39 UTC
Git commit 4479f05626fe3470fe82e0e29334aeed4d12b422 by Arjen Hiemstra.
Committed on 19/05/2025 at 14:13.
Pushed by ahiemstra into branch 'master'.

page: When resetting a page that we have a new version for, remove the old one

We don't show these pages if they have no local changes, so we should
also hide them if the local changes are being removed. Otherwise one can
still have the "old" page visible until restart.

M  +5    -1    src/page/PageManager.cpp

https://invent.kde.org/plasma/plasma-systemmonitor/-/commit/4479f05626fe3470fe82e0e29334aeed4d12b422
Comment 5 Bug Janitor Service 2025-05-19 14:29:49 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-systemmonitor/-/merge_requests/362
Comment 6 Arjen Hiemstra 2025-05-19 14:45:23 UTC
Git commit 0ed144e25cd5c355e956121b81a54a83359b715e by Arjen Hiemstra.
Committed on 19/05/2025 at 14:38.
Pushed by ahiemstra into branch 'Plasma/6.4'.

page: When resetting a page that we have a new version for, remove the old one

We don't show these pages if they have no local changes, so we should
also hide them if the local changes are being removed. Otherwise one can
still have the "old" page visible until restart.


(cherry picked from commit 4479f05626fe3470fe82e0e29334aeed4d12b422)

Co-authored-by: Arjen Hiemstra <ahiemstra@heimr.nl>

M  +5    -1    src/page/PageManager.cpp

https://invent.kde.org/plasma/plasma-systemmonitor/-/commit/0ed144e25cd5c355e956121b81a54a83359b715e
Comment 7 Arjen Hiemstra 2025-05-19 14:50:12 UTC
(In reply to Schlaefer from comment #2)
> But I noticed some serious GUI stutter, like something is choking in the
> background. So I thought let's check if something throws and error on the
> CLI, and also record it. So that got me something interesting: It failed for
> another 2 times and worked after the 3rd try. 
> 
> Now `~/.local/share/plasma-systemmonitor/old-overview.page` is gone too.
> This was the content before it got removed: https://pastebin.com/uuMRDH27

One possibility is that without the above changes, the in-memory version of the page would still be written to disk on application quit, which would mean the old page would return on next startup. With the changes above it should now disappear as soon as you reset the page, which should also mean it no longer exists in memory and won't return.
Comment 8 Nate Graham 2025-05-19 18:33:36 UTC
So is this fixed now, Arjen? Or is there more to do?
Comment 9 Arjen Hiemstra 2025-05-20 08:03:13 UTC
I couldn't reproduce the original issue so I didn't mark it as resolved originally, but since the reporter also fixed it on their end, I think we can close this now.