Bug 286717

Summary: Kate does not update remote files on save (KIO sftp\fish) - it only updates temporary local copy
Product: [Frameworks and Libraries] kio Reporter: Evstifeev Roman <someuniquename>
Component: generalAssignee: David Faure <faure>
Status: RESOLVED FIXED    
Severity: normal CC: adawit, megalexis, rs
Priority: NOR    
Version: 4.9.0   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In: 4.10.1

Description Evstifeev Roman 2011-11-15 18:03:51 UTC
Version:           unspecified (using KDE 4.7.2) 
OS:                Linux

Hi. I have Kate version 3.7.2.
When i open remote folder in dolphin (sftp:// or fish://) and open some file from there with Kate - it creates temporary local copy of the remote file in /var/tmp/kdecache/krun/ and opens it. When i save it - it does not modify remote file.

Kwrite allows to open\edit\save those files correctly (on save it updates remote file)

Reproducible: Always

Steps to Reproduce:
1) open remote folder in dolphin (sftp:// or fish://)
2) open some file with Kate
3) modify and save it

Actual Results:  
Kate modifies temporary local copy, after that complains about the remote file being modified by another program (which is not true, as remote file stays the same on next open)

Expected Results:  
Kate should modify remote file just as Kwrite do.
Comment 1 Jekyll Wu 2011-12-31 02:13:16 UTC
I failed to reproduce the reported problem using KDE SC 4.8 RC1.
Comment 2 Evstifeev Roman 2012-01-27 12:16:52 UTC
(In reply to comment #1)
> I failed to reproduce the reported problem using KDE SC 4.8 RC1.

I just installed KDE SC 4.8 final and still having this bug
Comment 3 Evstifeev Roman 2012-08-16 17:52:02 UTC
Still having this bug in KDE 4.9
Comment 4 Evstifeev Roman 2012-08-16 17:53:25 UTC
Same bug: #263740 - it was closed to be reopened with correct component, i guess
Comment 5 Evstifeev Roman 2012-08-16 17:55:39 UTC
i tried to create new user with clean KDE environment in ~/.kde4 and for this new user kate correctly opens file and able to update remote file on save.
Comment 6 Evstifeev Roman 2012-08-18 17:28:27 UTC
To reproduce this bug:
Go to System Settings -> File Associations 
Choose for examlpe python files (text -> x-python) on the left.
Move Kate as the most preferred application to handle those files and click "Edit" to change Kate command-line (on Applcation tab of the shown dialog)
For example if you have "kate -b %U" as command - change it to "kate %U" [this is a fix for another issue with kate's session restore]

After you apply these settings new .desktop-file will be created at ~/.local/share/applications/kde4/kate.desktop
This desktop-file will override default one (from /usr). The problem with it is that it is missing "Categories=KDE;" or "X-KDE-Protocols=KIO;" statements. Threfore Kate cannot handle remote files with KIO correctly. As mentioned above, it will download remote file into local /tmp folder and unable to update remote file on save.

This bug is becoming more severe becuse now user have to modify kate's command-line to fix another bug: https://bugs.kde.org/show_bug.cgi?id=305400

To fix temporarily, user must edit .desktop-file by hand, adding "Categories=KDE;" or "X-KDE-Protocols=KIO;" to the resulting file in ~/.local/ directory
Comment 7 megalexis 2012-08-27 00:12:43 UTC
Same issues here. It does not save. Please fix since kio is mainly why I use KDE..
Comment 8 Dawit Alemayehu 2012-10-08 15:47:10 UTC
(In reply to comment #6)
> To reproduce this bug:
> Go to System Settings -> File Associations 
> Choose for examlpe python files (text -> x-python) on the left.
> Move Kate as the most preferred application to handle those files and click
> "Edit" to change Kate command-line (on Applcation tab of the shown dialog)
> For example if you have "kate -b %U" as command - change it to "kate %U"
> [this is a fix for another issue with kate's session restore]
> 
> After you apply these settings new .desktop-file will be created at
> ~/.local/share/applications/kde4/kate.desktop
> This desktop-file will override default one (from /usr). The problem with it
> is that it is missing "Categories=KDE;" or "X-KDE-Protocols=KIO;"
> statements. Threfore Kate cannot handle remote files with KIO correctly. As
> mentioned above, it will download remote file into local /tmp folder and
> unable to update remote file on save.
> 
> This bug is becoming more severe becuse now user have to modify kate's
> command-line to fix another bug: https://bugs.kde.org/show_bug.cgi?id=305400
> 
> To fix temporarily, user must edit .desktop-file by hand, adding
> "Categories=KDE;" or "X-KDE-Protocols=KIO;" to the resulting file in
> ~/.local/ directory

Actually in this case the generated .desktop entry is only missing the "Categories" entry. The X-KDE-Protocols is not necessary if you have a Categories entry that has KDE in it.
Comment 9 René 2012-12-11 18:13:58 UTC
Just a refinement of this bug report. Indeed in KDE 4.8.5 (4.8.5) I cannot save remote files any more by clicking the save button, but they do get updated when you exit the editer (kate or kwrite), because a dialogue pops up that ask you if the remote file needs to be updated. 

Please take complaints serious. The main reason I still use KDE is because of this functionality that seems to become more neglected. In earlier versions I could even do remote editing with the embedded editor, a functionality that was rebranded as a bug. 

Please change the status to confirmed, because I see here that I am not only annoyed here.
Comment 10 Dawit Alemayehu 2012-12-12 06:25:02 UTC
(In reply to comment #9)
> Just a refinement of this bug report. Indeed in KDE 4.8.5 (4.8.5) I cannot
> save remote files any more by clicking the save button, but they do get
> updated when you exit the editer (kate or kwrite), because a dialogue pops
> up that ask you if the remote file needs to be updated. 

You do understand that this bug only occurs if you have modified the default and a new local .desktop was created, right? IOW, it is not a bug that occurs out of the box. In fact, there is no other fix than you simply deleting your local copy of kate.desktop, e.g. 

rm -vf ~/.local/share/applications/kde4/kate.desktop

This is true even when this bug is addressed at some point in the future and that process has already started. See https://git.reviewboard.kde.org/r/106771/

> Please take complaints serious. The main reason I still use KDE is because
> of this functionality that seems to become more neglected. In earlier
> versions I could even do remote editing with the embedded editor, a
> functionality that was rebranded as a bug.

Please stop conflating issue to make your point. The fact that some portions of KDE 4.x was released with the ability to edit documents inline has nothing to do with this valid bug report. For the record, the behavior that was reverted was a BUG regardless of how you felt about it. You can go and check the older versions of KDE/konqueror in 3.x era if you do not believe me. Regardless, that issue has nothing to do with this one.

> Please change the status to confirmed, because I see here that I am not only
> annoyed here.
Comment 11 Evstifeev Roman 2012-12-12 06:49:17 UTC
Copying "Categories" will fix this bug, but my guess is that to address more general issue - there are more fields in desktop-file that have to be copied (translations, for example).
Comment 12 Dawit Alemayehu 2012-12-30 17:39:12 UTC
(In reply to comment #11)
> Copying "Categories" will fix this bug, but my guess is that to address more
> general issue - there are more fields in desktop-file that have to be copied
> (translations, for example).

That is why the pending patch has not yet been applied. It needs to be addressed properly once and for all.
Comment 13 Dawit Alemayehu 2013-02-16 17:51:54 UTC
Git commit 6c6c228aa02173425722307b5806da1dcc53fa3e by Dawit Alemayehu.
Committed on 11/02/2013 at 05:19.
Pushed by adawit into branch 'KDE/4.10'.

When creating local copy of a desktop entry file, make sure all the relevant
properties are copied from the original.
FIXED-IN: 4.10.1
REVIEW: 106771

M  +10   -7    kio/kfile/kpropertiesdialog.cpp

http://commits.kde.org/kdelibs/6c6c228aa02173425722307b5806da1dcc53fa3e