Bug 520894 - Cannot remove menu item from favorites if name includes a capital letter and a colon
Summary: Cannot remove menu item from favorites if name includes a capital letter and ...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Application Launcher (Kickoff) widget (other bugs)
Version First Reported In: 6.6.5
Platform: EndeavourOS Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-06-01 07:08 UTC by Andrés
Modified: 2026-07-13 09:46 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 6.7.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrés 2026-06-01 07:08:29 UTC
(Maybe this is primarily a kmenuedit bug, but kickoff is misbehaving too.)

DESCRIPTION
Menu items with names that include a capital letter and a colon (:) can't be removed from favorites.

STEPS TO REPRODUCE
1. Create a new item with the KDE Menu Editor, for example "Test: 1" ("Test:", ":TEST", or "tEs:t" also work). The program you point to doesn't matter, but I used konsole.
2. Add this new item to your favorites using the Application Launcher (Kickoff).
3. Try to remove the new item from your favorites.

OBSERVED RESULT
Nothing happens.
journalctl -f prints the following whenever I try to remove the item from my favorites:
plasmashell[942]: Entry is not valid "test: 1.desktop" 0x55fedbd93a60
The memory address (?) changes whenever I do this.
Note that the filename in the log is in lowercase ("test: 1" instead of "Test: 1").
Removing the capital letter and the colon from the item name with the KDE Menu Editor doesn't work; the item still can't be removed. The only way to remove the entry from my favorites is to delete the .desktop file directly from /home/user/.local/share/applications/

EXPECTED RESULT
The item should be removed from my favorites. Alternatively, the KDE Menu Editor should disallow these invalid names.

SOFTWARE/OS VERSIONS
Operating System: EndeavourOS 
KDE Plasma Version: 6.6.5
KDE Frameworks Version: 6.26.0
Qt Version: 6.11.1
Kernel Version: 7.0.10-arch1-1 (64-bit)
Graphics Platform: Wayland
Comment 1 Akseli Lahtinen 2026-06-01 07:34:58 UTC
There's something weird for sure, I can't repro the same way but for me adding it to favorites never actually adds it.

Operating System: KDE Linux 2026-06-01
KDE Plasma Version: 6.7.80
KDE Frameworks Version: 6.27.0
Qt Version: 6.11.1
Kernel Version: 7.0.10-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 12 × AMD Ryzen 5 3600 6-Core Processor
Memory: 16 GiB of RAM (15.5 GiB usable)
Graphics Processor: AMD Radeon RX 6600
Comment 2 cwo 2026-06-01 20:23:09 UTC
This is a kmenuedit bug. It creates a file named like "Test: 1.desktop". This is not correct; the desktop file spec says:

> For applications, the part of the name of the desktop file before the .desktop extension should be a valid D-Bus well-known name. This means that it is a sequence of non-empty elements separated by dots (U+002E FULL STOP), none of which starts with a digit, and each of which contains only characters from the set [A-Za-z0-9-_]: ASCII letters, digits, dash (U+002D HYPHEN-MINUS) and underscore (U+005F LOW LINE). 

https://specifications.freedesktop.org/desktop-entry/latest/file-naming.html

Kicker backend treats these as urls, so "Test: " is treated as a scheme, and is cut off as it's not a scheme that needs special handling.

There's also a bug in the kicker backend, a fallback using the complete string (not cutting of the scheme) is supposed to happen, but doesn't due to a code error. This was introduced in the 6.7 cycle, which explains why we get different results in 6.6 and 6.7. After fixing that, I get the same behavior as described by Andrés: the entry can be added to the favorites, but not removed.
Comment 3 Bug Janitor Service 2026-06-02 09:42:10 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/6668
Comment 4 Tobias Fella 2026-06-02 13:56:57 UTC
Git commit eac0201895ea647f860cff4d3c771ae9a079a25d by Tobias Fella, on behalf of Christoph Wolk.
Committed on 02/06/2026 at 13:36.
Pushed by tfella into branch 'master'.

applets/kicker: use correct fallback in AppEntry ctor

Constructing an AppEntry (for non-preferred:// schemes), we first try
serviceByStorageId on the path part of the url, and if that does not
find anything, we try again with the value of m_id... except that m_id
only stores the supplied id in case of preferred:// urls, and is left
default-initialized otherwise, so this always looks up the service for
empty string, which is not particularly useful.

Instead, look it up by the id that was passed to the ctor. This makes
malformed .desktop file names containing the character ":" somewhat work
again. (This is disallowed by the spec, but some software may produce
them including, unfortunately, kmenuedit.) They're still broken in all
sorts of weird ways, but at least they will show up when favorited like
in 6.6, rather than just fail.

M  +1    -1    applets/kicker/appentry.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/eac0201895ea647f860cff4d3c771ae9a079a25d
Comment 5 Bug Janitor Service 2026-06-02 14:19:17 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/6669
Comment 6 cwo 2026-06-02 21:18:20 UTC
Git commit 215e7d11312c31ce9b5e7ed8794a634d7ba41342 by Christoph Wolk.
Committed on 02/06/2026 at 14:18.
Pushed by cwo into branch 'Plasma/6.7'.

applets/kicker: use correct fallback in AppEntry ctor

Constructing an AppEntry (for non-preferred:// schemes), we first try
serviceByStorageId on the path part of the url, and if that does not
find anything, we try again with the value of m_id... except that m_id
only stores the supplied id in case of preferred:// urls, and is left
default-initialized otherwise, so this always looks up the service for
empty string, which is not particularly useful.

Instead, look it up by the id that was passed to the ctor. This makes
malformed .desktop file names containing the character ":" somewhat work
again. (This is disallowed by the spec, but some software may produce
them including, unfortunately, kmenuedit.) They're still broken in all
sorts of weird ways, but at least they will show up when favorited like
in 6.6, rather than just fail.


(cherry picked from commit eac0201895ea647f860cff4d3c771ae9a079a25d)

Co-authored-by: Christoph Wolk <cwo.kde@posteo.net>

M  +1    -1    applets/kicker/appentry.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/215e7d11312c31ce9b5e7ed8794a634d7ba41342
Comment 7 Bug Janitor Service 2026-06-08 20:04:29 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kmenuedit/-/merge_requests/57
Comment 8 cwo 2026-06-09 13:45:17 UTC
Git commit 26733947daff179ac50a0658e2a1f8864d883206 by Christoph Wolk.
Committed on 08/06/2026 at 20:03.
Pushed by tfella into branch 'master'.

treeview: don't create desktop file names with invalid characters

.desktop file names are supposed to be "a sequence of non-empty elements
separated by dots (U+002E FULL STOP), none of which starts with a digit,
and each of which contains only characters from the set [A-Za-z0-9-_]".
Kmenuedit, when creating a new entry, allows the user to specify a name
and will use that as the desktop file name, only replacing the forward
slash / with a hyphen -. All other characters not included in the
allowed character set are used unchanged. This can break some
applications handling desktop files, including the kicker backend,
which in some cases tries to read the file name as an url, and so e.g.
parts separated with a colon may be interpreted as url schemes and not
function properly. While this should be fixed in kicker, we also should
not produce invalid names.

Instead, replace all invalid characters with an underscore _. This only
applies to the .desktop file name; in the menu the name will be used as
entered by the user.

M  +1    -0    treeview.cpp

https://invent.kde.org/plasma/kmenuedit/-/commit/26733947daff179ac50a0658e2a1f8864d883206
Comment 9 Tobias Fella 2026-06-09 13:46:11 UTC
Git commit 6729223b9402dd624aa8f847aa3eb2a346412958 by Tobias Fella, on behalf of Christoph Wolk.
Committed on 09/06/2026 at 13:45.
Pushed by tfella into branch 'Plasma/6.7'.

treeview: don't create desktop file names with invalid characters

.desktop file names are supposed to be "a sequence of non-empty elements
separated by dots (U+002E FULL STOP), none of which starts with a digit,
and each of which contains only characters from the set [A-Za-z0-9-_]".
Kmenuedit, when creating a new entry, allows the user to specify a name
and will use that as the desktop file name, only replacing the forward
slash / with a hyphen -. All other characters not included in the
allowed character set are used unchanged. This can break some
applications handling desktop files, including the kicker backend,
which in some cases tries to read the file name as an url, and so e.g.
parts separated with a colon may be interpreted as url schemes and not
function properly. While this should be fixed in kicker, we also should
not produce invalid names.

Instead, replace all invalid characters with an underscore _. This only
applies to the .desktop file name; in the menu the name will be used as
entered by the user.
(cherry picked from commit 26733947daff179ac50a0658e2a1f8864d883206)

M  +1    -0    treeview.cpp

https://invent.kde.org/plasma/kmenuedit/-/commit/6729223b9402dd624aa8f847aa3eb2a346412958
Comment 10 Bug Janitor Service 2026-06-10 10:48:33 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/6720
Comment 11 cwo 2026-06-10 22:23:33 UTC
Git commit 5b3da59c060167d4a354f768615ff630026d15d9 by Christoph Wolk.
Committed on 10/06/2026 at 20:58.
Pushed by cwo into branch 'master'.

applets/kicker: sometimes use normalizedId when unfavoriting

Kicker backend uses the normalized id when favoriting things, and the
unnormalized id when unfavoriting them. This is because the normalized
id may no longer work, for example if a folder is favorited and then
deleted (see bug 474120). This however, breaks on malformed desktop file
names with a capital letter and colon, such as "Test: 1.desktop". We do
a QString -> QUrl -> QString round trip, "Test:" is interpreted as an
url scheme, and while this is maintained, it is (correctly) case-folded
as the schemes are case-insensitive and their canonical form is lower
case. When such a desktop file is favorited, it is correctly added (as
the normalized id already contains the "applications:" url scheme, and
so the "Test:" part is not interpreted as one, but can't be removed
anymore as it will try to remove "test: 1.desktop" instead, which is not
a favorite.

Instead, use the normalizedId in case [a] the post-round trip string
only differs in case from the unnormalized id (where the scheme bug can
happen) [b] we're not dealing with a local file (where the post-deletion
bug can happen) and [c] we don't already have an "applications:" scheme
(for good measure). This should handle both the malformed name and
post-deletion file case, and hopefully not affect any other schemes,
which I think should end up with the same id and normalized id anyway.

M  +17   -0    applets/kicker/kastatsfavoritesmodel.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/5b3da59c060167d4a354f768615ff630026d15d9
Comment 12 cwo 2026-06-10 22:46:02 UTC
Git commit 93106aeea1df992eb8971b7b5affc2e073b879a7 by Christoph Wolk.
Committed on 10/06/2026 at 22:29.
Pushed by cwo into branch 'Plasma/6.7'.

applets/kicker: sometimes use normalizedId when unfavoriting

Kicker backend uses the normalized id when favoriting things, and the
unnormalized id when unfavoriting them. This is because the normalized
id may no longer work, for example if a folder is favorited and then
deleted (see bug 474120). This however, breaks on malformed desktop file
names with a capital letter and colon, such as "Test: 1.desktop". We do
a QString -> QUrl -> QString round trip, "Test:" is interpreted as an
url scheme, and while this is maintained, it is (correctly) case-folded
as the schemes are case-insensitive and their canonical form is lower
case. When such a desktop file is favorited, it is correctly added (as
the normalized id already contains the "applications:" url scheme, and
so the "Test:" part is not interpreted as one, but can't be removed
anymore as it will try to remove "test: 1.desktop" instead, which is not
a favorite.

Instead, use the normalizedId in case [a] the post-round trip string
only differs in case from the unnormalized id (where the scheme bug can
happen) [b] we're not dealing with a local file (where the post-deletion
bug can happen) and [c] we don't already have an "applications:" scheme
(for good measure). This should handle both the malformed name and
post-deletion file case, and hopefully not affect any other schemes,
which I think should end up with the same id and normalized id anyway.


(cherry picked from commit 5b3da59c060167d4a354f768615ff630026d15d9)

Co-authored-by: Christoph Wolk <cwo.kde@posteo.net>

M  +17   -0    applets/kicker/kastatsfavoritesmodel.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/93106aeea1df992eb8971b7b5affc2e073b879a7
Comment 13 cwo 2026-06-19 05:58:45 UTC
*** Bug 521696 has been marked as a duplicate of this bug. ***
Comment 14 Bug Janitor Service 2026-06-28 14:58:22 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/6805
Comment 15 cwo 2026-07-13 08:22:52 UTC
Git commit 44153ae0e6185bc6f3ebc9a892003ff30affd8d8 by Christoph Wolk.
Committed on 13/07/2026 at 06:53.
Pushed by cwo into branch 'master'.

runners/services: handle malformed .desktop file names better

.desktop file names should be valid dbus well-known names, but in the
wild you may find some with invalid names, such as including the
character ":". Until recently, even kmenuedit would create such files if
the user used a : in the human-readable name. This completely breaks the
service runner: a malformed file like "Test: 1. desktop" is parsed as
the path "1.desktop" on the "test" scheme, has its scheme replaced by
"applications", and trying to launch the resulting id
"applications: 1.desktop" will fail, as will trying to favorite the
match in a launcher.

Instead, create the QUrl and explicitly set the storageId of the service
as the path, which protects it from having parts misidentified as a
scheme.

M  +4    -2    runners/services/servicerunner.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/44153ae0e6185bc6f3ebc9a892003ff30affd8d8
Comment 16 Bug Janitor Service 2026-07-13 08:43:19 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/6835
Comment 17 cwo 2026-07-13 09:46:35 UTC
Git commit bbb9f22f0680adc425e32caeb298c82e227ca46b by Christoph Wolk.
Committed on 13/07/2026 at 08:42.
Pushed by cwo into branch 'Plasma/6.7'.

runners/services: handle malformed .desktop file names better

.desktop file names should be valid dbus well-known names, but in the
wild you may find some with invalid names, such as including the
character ":". Until recently, even kmenuedit would create such files if
the user used a : in the human-readable name. This completely breaks the
service runner: a malformed file like "Test: 1. desktop" is parsed as
the path "1.desktop" on the "test" scheme, has its scheme replaced by
"applications", and trying to launch the resulting id
"applications: 1.desktop" will fail, as will trying to favorite the
match in a launcher.

Instead, create the QUrl and explicitly set the storageId of the service
as the path, which protects it from having parts misidentified as a
scheme.


(cherry picked from commit 44153ae0e6185bc6f3ebc9a892003ff30affd8d8)

Co-authored-by: Christoph Wolk <cwo.kde@posteo.net>

M  +4    -2    runners/services/servicerunner.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/bbb9f22f0680adc425e32caeb298c82e227ca46b