Bug 58572 - editor doesn't check for file updates outside IDE
Summary: editor doesn't check for file updates outside IDE
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: All editors (show other bugs)
Version: 3.0.0a4
Platform: Debian stable Linux
: HI normal
Target Milestone: ---
Assignee: KDevelop Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-05-16 17:40 UTC by noster
Modified: 2004-07-20 00:52 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description noster 2003-05-16 17:40:21 UTC
Version:           3.0 alpha 4 (using KDE KDE 3.1.1a)
Installed from:    Debian stable Packages
Compiler:          gcc version 2.95.4 20011002 (Debian prerelease) woody
OS:          Linux

Editor component in kdevelop doesn't seem to recognize open file modifications happening outside it's enviromnent. One have to use "Refresh [F5]" to re-read the modified content of the file.

The editor should notify the user that file was modified and ask him to reload it or not.
Comment 1 Amilcar do Carmo Lucas 2003-05-20 20:42:59 UTC
This is a regression against KDevelop 2. 
Changing priority to HI. 
  
Comment 2 Harald Fernengel 2003-06-15 13:18:08 UTC
IDEAl mode (CVS HEAD) will show you external modifications. It won't automatically reload the 
file, though. 
Comment 3 Simon Ejsing 2003-08-17 11:11:14 UTC
It should at least ask the user if he want's to reload the file when it detects it... 
Comment 4 Robert Jonsson 2003-10-20 10:57:35 UTC
An alternative or addition would be to add a menu alternative to the editor-context menu to reload the file.

We've got cvs setup so it adds several fields to the source files, which means that everytime something is checked in we have to close the file and locate it again to view it. The F5 trick that the original poster mentions DOES solve this, but I'd prefer a 'reload' menu option also.

The F5 function seems to be undocumented anyway.
Comment 5 Robert Jonsson 2003-10-20 10:58:53 UTC
....to clarify...

F5 does work, it reloads the document... but I have to press it TWICE for the icon on the tab-bar to disappear.
Comment 6 noster 2003-10-31 10:10:23 UTC
I just would like to clarify that F5 isn't a solution. Imagine you have several [15?] open files and do cvs update on the tree. Which sources should you reload? All of them?

This should be handled the way Kate does it - pop up a yes/no requester for each modified file and reload according to answer. No more no less...
Comment 7 Richard Smith 2003-11-24 14:48:55 UTC
It'd be nice to see a Yes to All, like MS Vis Studio .net has.
Comment 8 Amilcar do Carmo Lucas 2003-12-02 22:12:20 UTC
*** Bug 68118 has been marked as a duplicate of this bug. ***
Comment 9 Jesse 2003-12-03 21:47:01 UTC
Is this really the same as 68118?

68118 talks about showing visual notification _within_ kdevelop when you modify a file.  This bug talks about what happens when an application outside modifys a file.

I can see where you would use the same code but the notifications are totally different.  But we do eventually need to see which files were modified ... and currently the only way to do it after you've made changes yourself is to look for the '*' in the status bar ... that's not nice.
Comment 10 Jens Dagerbo 2004-01-07 13:01:49 UTC
OK, this should now be back to where it was a few months ago. When an external modification occurs, KDevelop will change the editor window icon (typically the tab icon) into a different icon signalling this. 

Some issues remain:
#It does not throw up a dialog unless you attempt to save the file, which I guess is debatable.

#There is only one icon to play with, and a file can be both externally and internally changed, at which point I think externally takes precedence (internal changes is still visible in the statusbar (at least in katepart 3.1+)).

#There is no tooltip explaining what the icon means. This is bad.

# more?
Comment 11 Jens Dagerbo 2004-01-07 14:25:56 UTC
Actually, I can't make it show me a warning dialog about overwriting externally modified files at all.. So this bug is really only fixed in part.
Comment 12 Per Ångström 2004-02-07 12:12:00 UTC
In bug #23908 I was told that the problem would be fixed in KDevelop 3.0.0. I now find that it's actually even worse than before.

BTW: this is probably platform-independent. I run SuSE 9.0.
Comment 13 Sylvain FABRE 2004-03-08 17:03:15 UTC
The problem is still there in Kdevelop 3.0.1. I edit 10 file sin Kdevelop, then i commit them with to CVS with an external tool (lincvs or tkcvs).
The when i switch back to Kdevelop the files are not updated at all, and there is no notification, no big warnings !!!
In my opinion, this is a VERY important behavior : Kdevelop should at least offer 2 general options like ! 
 - Notify when a file is externally modified (YES/NO)
 - Automatically synchronize with external modifications (YES/NO)
Comment 14 Robert Shideleff 2004-03-31 21:42:12 UTC
My standard for comparing this (and a lot of smart editor features) is EMACS. Emacs has one more feature that doesn't seem to be captured above. Emacs' notifications all include a hint about whether the file had been changed without being saved since it had been loaded into memory. The implication is that if a reload occurs when no changes have been made, then it is far less likely that information will be lost. Therefore the auto-reload process is relatively safe and is much easier to do. (In fact it is more or less automatic as I recall.) However, if changes have been made, then emacs is VERY picky about allowing you to make any moves which will either wipe out the data you edited in the buffer, or wipe out any changes the third party made to the disk.

Kdevelop shows only one notification with no feedback about whether changes occurred in just one place or in both places. It does change its behavior to make it more difficult to damage either set of changes, but it does not take that extra step of noticing that you hadn't really made any changes in the buffer since it was last loaded/saved and make it easier/less scary to load in the third party changes.

As for notification, Emacs will basically stay quiet about the issue UNTIL you make any attempt to change the file in memory, or to save it over somebody else's changes, or close it without saving (if you had made changes in the buffer). As soon as you type a character or make some other change in a buffer that was saved by another app after it had last been read by emacs, THEN a message pops up asking you what you want to do. (New File, Revert, Save, Cancel) The save is followed by an 'are you sure' message.

I have found this to be the smoothest and easiest way to deal with these issues of any program I ever dealt with. Mimicry is the sincerest form of flattery...Take the best features from all sources.
Comment 15 Per Ångström 2004-05-07 19:07:08 UTC
I just downloaded KDevelop 3.0.3. To my horror, I found that this bug is still present. I'm sorry but I just can't trust my source files to KDevelop.
Comment 16 Jens Dagerbo 2004-07-20 00:52:23 UTC
This is finally done in HEAD, if the editorpart used in katepart. It still has a few issues, but is more or less FIXED.