Bug 478835

Summary: plasmashell errors in system journal when launching apps
Product: [Plasma] plasmashell Reporter: Jin Liu <ad.liu.jin>
Component: generalAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED FIXED    
Severity: minor CC: agurenko, kde, nate, nicolas.fella
Priority: NOR Keywords: qt6
Version First Reported In: 5.91.0   
Target Milestone: 1.0   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Jin Liu 2023-12-21 12:52:00 UTC
SUMMARY
The following errors appear in the systemd journal when launching Dolphin:
`plasmashell: QString::arg: 2 argument(s) missing in org.kde.dolphin`

If launched from the task manager, then one more error:
`plasmashell: error creating screencast "Unable to find window ID 0`

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 5.91.0
KDE Frameworks Version: 5.247.0
Qt Version: 6.7.0
Kernel Version: 6.6.7-arch1-1 (64-bit)
Graphics Platform: offscreen
Processors: 12 × AMD Ryzen 5 5600H with Radeon Graphics
Memory: 13.5 GiB of RAM
Graphics Processor: AMD Radeon Graphics
Comment 1 Nicolas Fella 2024-01-21 14:18:16 UTC
> The following errors appear in the systemd journal when launching Dolphin:
`plasmashell: QString::arg: 2 argument(s) missing in org.kde.dolphin`

This comes from https://invent.kde.org/frameworks/kio/-/blob/master/src/gui/kprocessrunner.cpp#L436, called from https://invent.kde.org/frameworks/kio/-/blob/master/src/gui/kprocessrunner.cpp#L299

The problem is that KProcessRunner::maybeAliasedName does more than it suggests. It resolves the alias in the desktop file, but also does the replacement thing, which is only relevant for the systemd runners
Comment 2 Bug Janitor Service 2024-01-21 20:04:25 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/1538
Comment 3 Nicolas Fella 2024-01-25 13:51:32 UTC
Git commit 8835710a73c2ba348ad615fd2a8883cfa6d999e1 by Nicolas Fella.
Committed on 25/01/2024 at 14:36.
Pushed by nicolasfella into branch 'master'.

[kprocessrunner] Clean up maybeAliasedName

maybeAliasedName does two things:

- resolving the potential alias for m_service
- Fill in a given pattern with the result and a UUID

Mixing those two things in a single function is dangerous.

For requestXdgActvationToken we want to resolve the alias, but not
do any of the pattern/UUID stuff that is only for the system runners.

Shuffle things around to make it more clear.

Also make sure that m_service is set before resolveServiceAlias is called

M  +26   -27   src/gui/kprocessrunner.cpp
M  +1    -1    src/gui/kprocessrunner_p.h
M  +2    -1    src/gui/systemd/scopedprocessrunner.cpp
M  +2    -1    src/gui/systemd/systemdprocessrunner.cpp

https://invent.kde.org/frameworks/kio/-/commit/8835710a73c2ba348ad615fd2a8883cfa6d999e1