Hello.
Since I submitted this bug report, I have gathered new information about the bug to narrow it down.
Clearing the .cache folder does not fix the issue. I ran a "sudo rm -r .cache/*" and checked with "ls -a" if the .cache folder was really empty and it was.
I have noticed that selecting an icon, pressing F2 and renaming it will also set the icon back to the one I set. I selected the test folder and pressed F2 to rename the folder. Pressing ESC or RETURN without actually changing the name wont change the icon back to the one I have set. However, if the name is actually changed the icon gets set back to the one I have set.
I noticed that the icons also reset after logging out and back in and when restarting the KDE "plasmashell" using the terminal command "kquitapp5 plasmashell && kstart plasmashell".
So it's whenever "plasmashell" gets restarted, either through reboot, logging out and back in or by manually restarting it with the terminal.
Also, switching from Wayland to X11 does not change anything. For those people suspecting Wayland to be the cause, it's probably not. I have the exact same problem on X11.
Ok, to further clarify my problem here, I took a screen recording of me restarting the "plasmashell" on both Wayland and X11 using the terminal command "kquitapp5 plasmashell && kstart plasmashell". I had to speed up the recording a little bit to keep the entire video length under 1 minute since Imgur doesn't allow uploading videos longer than 1 minute.
In the video in the attachment you can clearly see that restarting the "plasmashell" resets the folder icons to default. Pressing F2 for renaming the folders as well as opening and closing the context menu will get the icons back. This problem is identical on both Wayland and X11.
So in conclusion I have found out the following:
- The desktop icons reset after "plasmashell" is restarted, either through reboot, logout and login by manual restart via the terminal.
- The bug only appears on folders or links to folders. Applications or links to applications are not affected.
- If it's a link to a folder, it does not matter where the folder is located.
- Only opening the context menu and closing it or changing the folder name will get the icons back.
- Dragging the icon around, simply selecting it or renaming it without acutally changing the name to something different will not get the icons back.
- After the icons have turned back to their supposed icons, they will stay this way until "plasmashell" is restarted again.
- The bug only appears on the desktop. Dolphin is not affected.
- The bug appears on both Wayland and X11. I took a screen recording of both Wayland and X11 sessions showcasing the bug. It's the video in the attachments.
I hope that this additional information helps. That's all I could come up with.