Patch for Bug 408174. Bug when opening remote folder via SFTP.
Bug is described here: https://bugs.kde.org/show_bug.cgi?id=408174 It's affecting KWrite and Kate for more than a year now.
I don't know if this is the right place to fix this bug.
This checks that in case user is opening a remote folder, the filename is removed from URL.
I am not very familiar with Kate code so please comment/modify/merge.