Bug 352490

Summary: File -> Open error when already have sftp:// file open
Product: [Applications] kate Reporter: EMR_Kde <emrecio>
Component: generalAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: ahartmetz, diese-addy, emrecio, mcorteel
Priority: NOR    
Version: 5.0.0   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description EMR_Kde 2015-09-09 18:05:40 UTC
Looks like they fixed the "Bug 345253 - Folder I'm currently in not restored when selecting "Open file" with remote protocol", but introduced another error:

So now when I have a file open via sftp, if I go to File -> Open, it attempts to open the actual full path/filename instead of the dirname. Reproduce: 
1) open a file via sftp (sftp://foo.example.com/home/smithj/myfile.txt) 
2) edit the file and save it 
3) goto file -> open 
4) error dialog comes up: The file or folder sftp://foo.example.com/home/smithj/myfile.txt does not exist. 

It's trying to go to that directory, but it's actually the file you have open instead. (when you click OK in the dialog box, in the directory line edit there's the full path/filename instead of just the path. In the above example it should be sftp://foo.example.com/home/smithj.) 


Reproducible: Always

Steps to Reproduce:
1) open a file via sftp (sftp://foo.example.com/home/smithj/myfile.txt) 
2) edit the file and save it 
3) goto file -> open 

Actual Results:  
error dialog comes up: The file or folder sftp://foo.example.com/home/smithj/myfile.txt does not exist. 

Expected Results:  
A directory listing of sftp://foo.example.com/home/smithj/ should come up.
Comment 1 Maxime Corteel 2015-10-25 18:35:08 UTC
I get the same error with FTP but my error message is different: "/somefolder/somefile is a file, expected a folder" (or something like that, it's translated).
Comment 2 Andreas Hartmetz 2016-03-29 15:38:40 UTC
The "trying to open file as folder" bug has been fixed in Kate and KWrite master today. It was simply passing the full file URL to the open file dialog. For some reason, that worked with local files.