Version: (using Devel) OS: Linux Installed from: Compiled sources If a non-local 'dir' parameter is specified to KFileDialog::getSaveUrl() - and possibly getSaveFileName() and getSaveFilenameWid() also - the remote protocol is lost and the local directory of the remote URL's path is selected. For example, if a starting directory of "ftp://user@hostname/home/user/filename" is specified, the dialogue opens with "/home/user" listed and "filename" selected. Clicking "Save" tries to save to the local file, not via the ftp protocol. KFileDialog::getSaveurl() does: bool defaultDir = dir.isEmpty(); bool specialDir = !defaultDir && dir.protocol()=="kfiledialog"; KFileDialog dlg(specialDir ? dir : KUrl(), filter, parent); if ( !specialDir ) dlg.setSelection( dir.url() ); KFileWidget::setSelection(url) calls KFileWidgetPrivate::setLocationText(url), which in turn calls KFileWidget::setURL(url.path()). This discards the original protocol information from the URL and lists the local directory with that path. Applying the attached patch to kdelibs/kfile/kfilewidget.cpp appears to solve the problem. Could a kfile expert check it?
Created attachment 31612 [details] Proposed patch
Created attachment 31635 [details] Updated patch The previous patch doesn't work in the case where no starting location but only a file name is specified - it selects the root directory in that case.
Hmm, I see something like this when trying to open a remote file. I traverse to /home/boeckb/ on the remote server (via sftp) and when I choose the file, the places widget jump me to my local /home/boeckb/ causing the file to not be found. Bug #194385
Fixed by commit 951469.