Diffusion KIO 3ecffa2af275

KIO DesktopExecParser: simplify code

Authored by dfaure on Mar 21 2020, 4:28 PM.

Description

KIO DesktopExecParser: simplify code

Summary:

  • Remove special case for hasSchemeHandler, it's just a hack.

When starting a service that handles a specific scheme, we know it
supports that URL (supportedProtocols returns it).

  • Instead, the broken logic was that if we are in the special case

"username set, no password", which forces a FUSE request *even* for a
supported protocol, and that FUSE request fails, then we don't want to
fallback to kioexec. Using the service directly works just fine.

  • Merge the two for() loops. The first one is "no %u, so only local

files are supported", easy to model in the condition for the bool
'supported'.

  • If we do proceed without kioexec after a fuse error, recheck

request.reply.isError otherwise we end up replacing a URL with a DBus
error message :-)

  • Even further optimization: skip the FUSE request for the case of

a scheme-handler with username. For local, KIO, scheme-handlers,
supported means supported. The hack is only for the other case:
explicitly listed protocols with X-KDE-Protocols like in vlc.desktop

Test Plan:
krununittest (which unfortunately doesn't cover all cases),
plus stepping with gdb to see if we make a FUSE request.

Reviewers: ahmadsamir, feverfew, ngraham

Reviewed By: ahmadsamir

Subscribers: kde-frameworks-devel

Tags: Frameworks

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

Details

Committed
dfaureMar 22 2020, 1:28 PM
Reviewer
ahmadsamir
Differential Revision
D28187: KIO DesktopExecParser: simplify code
Parents
R241:56c738dc251b: Avoid double fetch and temporary hex encoding for NTFS attributes
Branches
Unknown
Tags
Unknown