problem with KIO::NetAccess and KDirLister/KFileTreeView

Klaas Freitag freitag at
Mon Oct 7 17:41:19 BST 2002

On Mon, 7 Oct 2002, David Faure wrote:

> On Monday 07 October 2002 16:10, Klaas Freitag wrote:
> > In KDE 3.0.x that works in that way that the new file is reported by
> > KDirLister and the file appears in the KFileTreeView and the deleted file
> > is removed from the tree also by a signal of KDirLister.
> > In KDE 3.1 (head from today) it is not working. The new file does not appear
> > as long as the del-function is called. It removes the old line and no new file
> > is reported. If the del-line is removed from the code above, the new file is
> > reported correctly, but of course the old one remains.
> Hmm, NetAccess::copy calls KIO::file_copy, which doesn't emit FilesAdded....
> So I guess in worked in 3.0.x simply due to KDirWatch noticing the new file?

Yes, the kfiletreeview-code relies totally on KDirWatch - and worked
pretty good with 3.0.x.

> If that's the case, then I'd guess KDirWatch got broken. Try "touch newfile" from
> a terminal to see if it notices it.
Yes, that works with beta 3.1 as well as with 3.0.x. As it also works if I
comment out the del-line, I fear that KDirLister deletes the FileItem it just
needs to add. Maybe a caching problem? But I am not familiar with KDirLister ;-)

> KDirWatch's debug output will tell you which method you're using (Stat, FAM or DNOTIFY).
> Which one is it?
kio (KDirWatch): Can't use FAM (fam daemon not running?)
kio (KDirWatch): Available methods: Stat
kio (KDirWatch): Added Dir /home/kf/.kde/share/servicetypes [KDirWatch-1]
kio (KDirWatch): Global Poll Freq is now 500 msec

> [One change I'm aware of, is that CopyJob doesn't emit FilesAdded/FilesRemoved
> anymore when simply renaming.... but that's not your case here (you are simply
> renaming, but not using CopyJob.  FileCopyJob is the low-level one that only copies
> one file, and doesn't emit anything.).]
> In any case, I'd recommend that you emit FilesAdded (see job.cpp for examples),
> so that you make sure the directory listing gets updated.
> Relying on KDirWatch is... well, a good way of finding out its bugs ;)
Yes ;-) but it is not too easy to escape from it as long as you do not want
to implement a lot of its functionality again just to control it ;-)



 Was auch immer geschieht :                                Klaas Freitag
 Nie dürft ihr so tief sinken,                      mail freitag at
 von dem Kakao, durch den man euch zieht,           SuSE Labs, Nuernberg
 auch noch zu trinken! - E. Kaestner

More information about the kde-core-devel mailing list