D28187: KIO DesktopExecParser: simplify code

David Faure noreply at phabricator.kde.org
Sat Mar 21 16:32:03 GMT 2020


dfaure created this revision.
dfaure added reviewers: ahmadsamir, feverfew, ngraham.
Herald added a project: Frameworks.
Herald added a subscriber: kde-frameworks-devel.
dfaure requested review of this revision.

REVISION 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.

REPOSITORY
  R241 KIO

BRANCH
  master

REVISION DETAIL
  https://phabricator.kde.org/D28187

AFFECTED FILES
  src/core/desktopexecparser.cpp

To: dfaure, ahmadsamir, feverfew, ngraham
Cc: kde-frameworks-devel, LeGast00n, cblack, GB_2, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20200321/c21d2235/attachment.html>


More information about the Kde-frameworks-devel mailing list