Skip to content

Fix generation of Remote URL

Alexander Saoutkin requested to merge asaoutkin/kio-fuse:refixRemoteUrl into master

Assuming one has mounted KIOFuse in $dir, execute the following with QT_LOGGING_RULES="org.kde.kio.fuse.debug=true" exported:

dbus-send --session --print-reply --type=method_call --dest=org.kde.KIOFuse /org/kde/KIOFuse org.kde.KIOFuse.VFS.mountUrl string:file:/

cd $dir/file/tmp

Without this fix applied, this results in EBADF, with the fix, cd works as expected.

RFC 3986 states:

If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//").

This applies to file: (no authority) as opposed to file:// (empty authority). This means that QUrl("file:").setPath("//tmp") fails instead of converting it silently, and so the workaround is to create an empty authority component to allow that url.setPath(url.path() + "/" + foo) always results in a valid URL, even if url's path ends in a / and it does not have an authority.

Edited by Fabian Vogt

Merge request reports