How to remove persistent favorite from KDE Menu in Plasma 5.x?

I have a problem with the KDE Plasma Menu. The favorite applications section has a "kate app" icon, and I removed it from favorites, but when I restart, the icon is still there.

I don't know where the config file for favorites is, or how I can remove that shortcut permanently. KDE menu editor doesn't manage favorite apps, so I don't think that can help me.

UPDATE: after search for "kate" in home directory i got this:

grep -rnw '~' -e 'kate'

./.xsession-errors:2427:[KASTATSFAVS] 0x38021d0 0x382ce90
"org.kde.plasma.kicker.favorites.instance-20" removeFavorite
"org.kde.kate.desktop" -->

./.xsession-errors:2428:[KASTATSFAVS] 0x38021d0 0x382ce90 "org.kde.plasma.kicker.favorites.instance-20" removeFavoriteFrom "org.kde.kate.desktop" ":any" -->

./.xsession-errors:2429:Original id is: "org.kde.kate.desktop" , and the url is
QUrl("file:///usr/share/applications/org.kde.kate.desktop")

./.xsession-errors:2430:[KASTATSFAVS] 0x38021d0 0x382ce90
"org.kde.plasma.kicker.favorites.instance-20" addFavoriteTo
"org.kde.kate.desktop" Activity:
(":any")"applications:org.kde.kate.desktop" (actual)

./.xsession-errors:2431:Unlink
"org.kde.plasma.favorites.applications"
QUrl("applications:org.kde.kate.desktop") ":any"

./.xsession-errors:2432:Original id is:
"applications:org.kde.kate.desktop" , and the url is
QUrl("file:///usr/share/applications/org.kde.kate.desktop")

./.xsession-errors:2433:[KASTATSFAVS] 0x38021d0 0x382ce90
"org.kde.plasma.kicker.favorites.instance-20" Removing result
"applications:org.kde.kate.desktop"

./.xsession-errors:2434:Original id is: "applications:org.kde.kate.desktop" , and the url is
QUrl("file:///usr/share/applications/org.kde.kate.desktop")

./.xsession-errors:3454:[KASTATSFAVS] 0x2d508c0 0x2dec620
"org.kde.plasma.kicker.favorites.instance-20" Got
"org.kde.kate.desktop" -->

./.xsession-errors:3455:[KASTATSFAVS] 0x2d508c0 0x2dec620 "org.kde.plasma.kicker.favorites.instance-20" Adding result "org.kde.kate.desktop" already present? false

./.xsession-errors:3456:Original id is: "org.kde.kate.desktop" , and the url is
QUrl("file:///usr/share/applications/org.kde.kate.desktop")

./.xsession-errors:3461:[KASTATSFAVS] 0x2d508c0 0x2dec620
"org.kde.plasma.kicker.favorites.instance-20" After ordering:
QVector("applications:systemsettings.desktop",
"applications:rhythmbox.desktop",
"applications:org.kde.kate.desktop")

./.xsession-errors:4040:[KASTATSFAVS] 0x3d02e50 0x3d25280
"org.kde.plasma.kicker.favorites.instance-20" Got
"org.kde.kate.desktop" -->

./.xsession-errors:4041:[KASTATSFAVS] 0x3d02e50 0x3d25280 "org.kde.plasma.kicker.favorites.instance-20" Adding result "org.kde.kate.desktop" already present? false

./.xsession-errors:4042:Original id is: "org.kde.kate.desktop" , and the url is
QUrl("file:///usr/share/applications/org.kde.kate.desktop")

./.xsession-errors:4047:[KASTATSFAVS] 0x3d02e50 0x3d25280
"org.kde.plasma.kicker.favorites.instance-20" After ordering:
QVector("applications:systemsettings.desktop",
"applications:rhythmbox.desktop",
"applications:org.kde.kate.desktop")


Solution 1:

This issue is almost guaranteed to be this bug. TL;DR: it was fixed sometime in June of 2020, after first being reported in 2017.

The short and sweet solution, probably still required even after plasma upgrades:

$ sqlite3 ~/.local/share/kactivitymanagerd/resources/database
sqlite> DELETE from ResourceLink where targettedResource='kate.desktop';
sqlite> DELETE from ResourceLink where targettedResource='org.kde.kate.desktop';

Change we'll be applied next time you login again.

Solution 2:

Try removing the following:

~/.config/kactivitymanagerd-statsrc
~/.local/share/kactivitymanagerd/

After that, logoff or reboot. Simply restarting plasma may not be sufficient. You'll loose all favorites, but can recreate them by adding what you want.