Bug 438582

Summary: Removing global theme fails to erase all related files
Product: [Frameworks and Libraries] frameworks-knewstuff Reporter: medin <med.medin.2014>
Component: generalAssignee: Dan Leinir Turthra Jensen <admin>
Status: CONFIRMED ---    
Severity: normal CC: droidgoo, kde, kdelibs-bugs-null, nate, olivercrothers77
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Removing global theme fails to erase all related files

Description medin 2021-06-14 01:05:24 UTC
Created attachment 139296 [details]
Removing global theme fails to erase all related files

When you open Plasma Settings and go to Global Theme page then click on "Get New Global Themes", for example if you install Sweet KDE theme you will have Sweet theme additions in the following pages :
- Appearance > Global Theme
- Appearance > Plasma Style
- Appearance > Colors
- Appearance > Windows Decorations
- Appearance > Icons
- Appearance > Cursors
- Appearance > Splash Screen
Even password dialog will appears to enter root password for installing Sweet theme for SDDM, so you will get and entry in :
- Startup and Shutdown > SDDM

If you go to Global Theme page then click on "Get New Global Themes" and select only Installed themes and click on Uninstall button to remove Sweet theme, normally the uninstallation process should remove all those entries added during installation, but Sweet theme entries remains in the following pages :
- Appearance > Plasma Style
- Appearance > Colors
- Appearance > Windows Decorations
- Appearance > Icons
- Appearance > Cursors
- Startup and Shutdown > SDDM
Comment 1 Dan Leinir Turthra Jensen 2021-06-14 10:05:48 UTC
Thanks, and yes, that's confirmed.

Now, of course, the super annoying part of my response: This is a non-trivial issue. Basically, we've no good way to determine whether things should be removed again automatically. It's akin to what happens with package managers, where there's no good way to detect whether something is still desired by the user. We /can/ detect whether something is still required by another specific thing on the system (that is, knewstuff can't, but kpackage (the bit that does the cross-origin bits) can do this, or at least be taught how to), and we can detect whether something is in use and refuse to remove it, but what we can't detect is whether the user wants to get rid of the main thing, but still wants to use something.

That final bit, though, is arguably something where we just have to ask the user whether that's what they want to do, probably with the things that we know are safe to remove pre-checked, and the others not selected, with a description of why they're not selected (required by something else), or not available for removal (because they're in active use).

But, yeah, in short, not a trivial issue, but one that we do want to try and work out how to deal with properly.
Comment 2 medin 2021-06-14 10:18:35 UTC
(In reply to Dan Leinir Turthra Jensen from comment #1)
> Thanks, and yes, that's confirmed.
> 
> Now, of course, the super annoying part of my response: This is a
> non-trivial issue. Basically, we've no good way to determine whether things
> should be removed again automatically. It's akin to what happens with
> package managers, where there's no good way to detect whether something is
> still desired by the user. We /can/ detect whether something is still
> required by another specific thing on the system (that is, knewstuff can't,
> but kpackage (the bit that does the cross-origin bits) can do this, or at
> least be taught how to), and we can detect whether something is in use and
> refuse to remove it, but what we can't detect is whether the user wants to
> get rid of the main thing, but still wants to use something.
> 
> That final bit, though, is arguably something where we just have to ask the
> user whether that's what they want to do, probably with the things that we
> know are safe to remove pre-checked, and the others not selected, with a
> description of why they're not selected (required by something else), or not
> available for removal (because they're in active use).
> 
> But, yeah, in short, not a trivial issue, but one that we do want to try and
> work out how to deal with properly.

The problem is that the removed item is called "global theme" which means user already knows it has many sub components installed (icons, cursors, colors...), and if user wants to remove only a sub component of it like icons or cursors it can be done by going to the specific page (Cursors, Icons, Colors...) in Plasma Settings. So from my point of view removing a global theme should automatically erases all of its sub components (even its SDDM theme by prompting for root password like it's done when installing).
Comment 3 Nate Graham 2021-06-15 20:32:32 UTC
It's like we need some kind of reference-counting system...
Comment 4 olivercrothers77 2022-06-20 17:52:07 UTC
I've also faced this issue on plasma 5.24.5 (Manjaro Linux). I have tried to uninstall the global theme through discover where it removes itself from the install list. But the theme and all of it's components are still visible through the various appearance setting pages. I've also seen this happen on several machines with Manjaro installed. Is there any workaround I can try and any other details I could provide? 
thanks
Comment 5 goo 2023-11-25 17:08:28 UTC
#installing  global themes can install items into these settings pages, but may not remove them all
- Appearance > Global Theme
- Appearance > Plasma Style
- Appearance > Colors
- Appearance > Windows Decorations
- Appearance > Icons
- Appearance > Cursors
- Appearance > Splash Screen
- Startup and Shutdown > SDDM
#may need to manually go to each settings page and click on the red trash can, then hit apply