Bug 385727

Summary: .desktop files with spaces in the file name cannot be pinned to task manager
Product: [Plasma] plasmashell Reporter: Karl Cheng <qantas94heavy>
Component: Icons-only Task ManagerAssignee: Eike Hein <hein>
Severity: normal CC: 11wallace11, nate, plasma-bugs
Priority: NOR    
Version: 5.11.0   
Target Milestone: 1.0   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In: 5.18.0

Description Karl Cheng 2017-10-14 03:43:08 UTC
If a .desktop file has a space in the file name, its associated entry in the application menu cannot be pinned to taskbar.

Steps to reproduce:

1. Open "KDE Menu Editor".
2. Click "New Item" and add a name using a space.
3. Set the command to any program, e.g. "audacity".
4. Right click the new menu entry and select "Pin to Task Manager".
5. Repeat, but do not add a space in "New Item".
Comment 1 Nate Graham 2017-10-19 15:19:53 UTC

*** This bug has been marked as a duplicate of bug 385942 ***
Comment 2 Kai Uwe Broulik 2020-01-31 13:34:02 UTC
Git commit bb573b83ace5a8039b2d0f5192192496e7937308 by Kai Uwe Broulik.
Committed on 31/01/2020 at 13:33.
Pushed by broulik into branch 'Plasma/5.18'.

[Task Manager] Remove strict URL handling

The code tried hard to ignore garbage URLs, as Qt is quite lenient, e.g. QUrl("Garbage Url") is still valid.
There is no way to change the strictness of a QUrl after creation,
so the code would enforce it by doing QUrl strictUrl(inputUrl.toString(), QUrl::StrictMode).
However, toString() defaults to PrettyDecoded which avoids percent-encoding and keeps spaces
in tact which is not a valid thing to have in a strict URL.
Effectively, we want to ensure a URL is either a valid path to a local file,
or one of the special applications (for menu ids), or preferred for preferred applications, like web browser,
FIXED-IN: 5.18.0

Differential Revision: https://phabricator.kde.org/D26941

M  +20   -0    libtaskmanager/autotests/launchertasksmodeltest.cpp
M  +7    -7    libtaskmanager/launchertasksmodel.cpp
M  +17   -2    libtaskmanager/launchertasksmodel_p.h

Comment 3 Nate Graham 2020-07-12 04:49:58 UTC
*** Bug 393665 has been marked as a duplicate of this bug. ***
Comment 4 Nate Graham 2020-07-12 04:50:54 UTC

*** This bug has been marked as a duplicate of bug 385942 ***