[Bug 64081] Shows warning "file modified on disc" whenever I save a file

tim at electronghost.co.uk tim at electronghost.co.uk
Mon Sep 15 18:13:05 UTC 2003

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

------- Additional Comments From tim at electronghost.co.uk  2003-09-15 18:11 -------
Kate removes the file from the watch list before saving and adds it again afterwards. This is 
its strategy for trying not to get change notifications for changes it caused itself. In 
standalone kate, it works. 
However, there is somebody else watching it at that point (kdevelop/src/partcontroller.cpp 
line 437) so kdirwatch never actually removes it from the watch list. 
This means it doesn't get statted on re-adding because it's already there, and there's now a 
race. Kate removes-writes-adds before FAM gets around to checking, and lo and behold, 
when it does check, the file has changed. 
Observe some debug output from gideon immediately following a save: 
kio (KDirWatch): Added already watched Entry /home/tim/cvs/taskmaster/src/
taskmastermainwidget.h (now 2 clients) [KDirWatch-3] 
kdevelop (core): MainWindowIDEAl::slotPartJobCompleted() 
gideon: BookmarksPart::reload() 
kdevelop (core): dcop emitting savedFile /home/tim/cvs/taskmaster/src/
kio (KDirWatch): Processing FAM event (FAMChanged, /home/tim/cvs/taskmaster/src/
taskmastermainwidget.h, Req 3) 
kio (KDirWatch): KDirWatch-1 emitting dirty /home/tim/cvs/taskmaster/src/
kio (KDirWatch): KDirWatch-3 emitting dirty /home/tim/cvs/taskmaster/src/
Note how the FAM event comes in *after* the "adding already watched entry". 
KDirWatch could fix this problem by forcing a recheck of a file's status whenever something 
adds an already monitored file, just before adding the requestor to the list of interested 

More information about the KDevelop-devel mailing list