Bug 409076 - Can't remove an assigned icon for a file type via GUI
Summary: Can't remove an assigned icon for a file type via GUI
Status: REPORTED
Alias: None
Product: kde-cli-tools
Classification: Plasma
Component: general (show other bugs)
Version: 5.25.5
Platform: Manjaro Linux
: NOR wishlist
Target Milestone: ---
Assignee: Aleix Pol
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-06-23 13:54 UTC by George B
Modified: 2022-09-27 14:22 UTC (History)
2 users (show)

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


Attachments
file type editor (46.08 KB, image/png)
2019-06-23 13:54 UTC, George B
Details

Note You need to log in before you can comment on or make changes to this bug.
Description George B 2019-06-23 13:54:29 UTC
Created attachment 121094 [details]
file type editor

SUMMARY
If you have a desktop shortcut without an icon and mistakenly edit global file types via properties (for x-desktop), all other .desktop applications without a designated icon will share that chosen one. You cannot remove it but only replace it with another. The same icon will be seen as an underlay on all applications before their respective icons are loaded.

STEPS TO REPRODUCE
1. Open System Settings > Applications > file Associations and choose x-desktop.
2. Chose an icon for it from the File type editor, save changes.
3. Open /usr/share/applications and see apps without icons sharing it (if any) or it being displayed on all of them for a second before their actual icons are loaded.

EXPECTED
A GUI user-friendly option to remove the current chosen icon should be present as users will be left scratching their heads. It's easy to make such a mistake since you are under the impression you are assigning an icon for a single specific .desktop shortcut and not globally to *.desktop & *.kdelnk


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Manjaro 18.0.4
KDE Plasma Version: 5.16.1
KDE Frameworks Version: 5.59.0
Qt Version: 5.12.4

ADDITIONAL INFORMATION / SOLUTION

Probably needless to mention to a developer, but if anybody stumbles upon the same problem, you can remove the icon by deleting the following:

The string "application/x-desktop:/usr/share/icons/path_to_icon" from /home/username/.local/share/mime/icons
the files:
/home/username/.local/share/mime/packages/application-x-desktop.xml (or any other application you've accidentally changed the properties of)
/home/username/.local/share/mime/applications/x-desktop.xml
/home/username/.local/share/mime/mime.cache

after which rebuild the db by executing:

$ update-mime-database ~/.local/share/mime

Mind that returning defaults via System Settings > File associations isn't an option for people who have already customised many/some of their icons. Also, x-desktop does have a default icon in system but other application don't and it's not completely transparent to find it by searching its name. If you hadn't done it before, you may not think of it. Especially if you've changed a desktop shortcut that wasn't showing any image (as it seeks a larger size), so you never really saw it or thought it was blank.