Don't mangle UDS_TARGET_URL to UDS_LOCAL_PATH in UDSEntries

Review Request #123781 - Created May 13, 2015 and submitted

Information
Eike Hein
kio-extras
master
Reviewers
kdeframeworks, plasma
dfaure, fredrik

kio_desktop's prepareUDSEntry() implementation currently overwrites the entry's UDS_TARGET_URL with UDS_LOCAL_PATH. Down the line this causes KFileItem to return QUrls with an empty scheme(), which leads to problems in kio/src/widgets/krun.cpp's resolveURLs(), used internally by KRun::runService. resolveURLs() will determine that the app doesn't support the (empty) scheme and fall through to check whether it meets the criteria for a KProtocolInfo::protocolClass of :local (which it doesn't either) before running KIO::mostLocalUrl (which thus isn't reached, but if it were, would also balk on an invalid QUrl). Ultimately the URL isn't getting fixed up, which in the case of using an action produced by KFileItemActions::addOpenWithActionsTo will cause the subprocess to be started non-blocking (freezing plasmashell in Folder View's case) and throw up a "Couldn't launch kioexec" error dialog box once it exits.

This patch simply removes the mangling (originally added by b0f798df), which will cause the entries to have the original desktop:/ URL. When an app doesn't explicitly support this protocol the fallback logic in resolvedURLs() will then produce a file:// URL. This fits in with the overall approach of producing the URLs needed by the app (based on its .desktop file) in KRun, which has all the support it needs to produce local URLs from desktop:/.

Double-clicking files in Folder View wasn't affected because it already had a hack to set the scheme for scheme-less URLs to 'file'; this workaround can be dropped once plasma-desktop depends on a KIO version with this patch applied.

Tried various KDE and non-KDE apps. Also compared this to the URLs handed to KRun by the regular local file browsing slave; they also use the file scheme.

Eike Hein
Eike Hein
Aleix Pol Gonzalez
David Faure
David Faure
Eike Hein
Review request changed

Status: Closed (submitted)

Change Summary:

Submitted with commit fe1f50caaf24c47000938c9ac36a7f9a304f3c96 by Eike Hein to branch Plasma/5.3.
Loading...