Skip to content

KUrlCompletion: accommodate ":local" protocols that use hostname in url

Ahmad Samir requested to merge work/ahmad/kurlcompletion-empty-name into master

An example of that is kdeconnect://, offering completions for it is redundant since it uses the hostname part of the url as the deviceId (a sequence of letters and numbers that's not easy to remember), so can't use that, and the UDS_NAME is the pretty name (e.g. SM-J500H) users see listed in kdeconnect:// but kdeconnect://SM-J500H doesn't work. Also because the code in KUrlCompletion::_k_slotEntries() is expecting a list of files/dirs to offer as completions, and not hostnames (_k_slotEntries uses addPathtoUrl helper method), no useful completions are feasible.

Instead if the "filename" part of the url is empty we just skip it.

Note that this prevents the code from hitting an assert in addPathToUrl (after applying !127 (merged) which is needed to make accessing devices using the kdeconnect ioslave actually work at all).

Edited by Ahmad Samir

Merge request reports