Skip to content

pathbar: Handle webdav where is the root is a path

Olivier Crête requested to merge ocrete/gtk:pathbar-webdav-root into main

Our webdav server has a root which is davs://mynextcloud/remote.php/webdav When once creates a GFile out of or out of a subdirectory, and one call g_file_get_parent(), it recurses too far up and try to query davs://mynextcloud/remote.php which fails, resulting in a broken pathbar.

To fix that, before querying the metadata of each element of the path, I query the "enclosing mount", then use it's root to compare the GFile against.

With the right GMount, we can also fix the icon drawing code in the pathbar for network drives.

This also removing a blocking D-Bus call in the code that finds the icon.

Another option would be to change the gvfs client to query gvfsd when creating a dav GFile, but I fear that this kind of change with a blocking dbus call potentially being calle in the g_file_new_*() function is more disruptive.

That said, nautilus still works much better than gtk here, I wonder if we shouldn't take the whole file management wholesale from it into gtk.

Fixes: #2866 (closed)

Edited by Olivier Crête

Merge request reports