KDirWatch emitting dirty signal many times for one change

David Faure faure at kde.org
Tue Apr 13 11:50:26 BST 2004


On Tuesday 13 April 2004 12:43, Sébastien Laoût wrote:
> I also would want detect file renamings to just keep the same "item"
> object and just change the associated file insteid of delete the item
> and recreate a new item (because the item contain meta-data that musn't
> be lost : not good for the user).
Sure.
Same problem as the one we have in kdesktop, where we try to
preserve the icon position when a file is renamed. The position is that
"meta data".

> On top of that I would want to rename file inside my app.
That's the easy case.

> Is it Konqueror independant ?
Yes/no. It's KIO-dependent.

> If I look at KDirNotify class documentation, I see "The information
> comes from the konqueror/kdesktop instance where the operation was done,
> and can interest KDirListers, bookmark handlers, etc.".
> But what happens if I rename a file by console ?
We're developing a GUI environment. IMHO it's fine to say that some features
don't work well when people start messing around with the console.

> Or in a Nautilus ???
Talk them into using KDirNotify :-)
I'm kidding, but if you're after a cross-desktop standard, then it needs
to be discussed on freedesktop. Maybe DBUS could send those
"file renamed" signals, dunno.

> Or anywhere else than Konqueror/KDE_KIO_progs ?
> It's not too trustable as far as I see it.
Well, that depends on how much you want to support.
Within KIO-enabled applications, it's very trustable.

> As I browse the KDE doc, I see class KDirListerCache that provide
> addd/removed/changed/renamed.
> But it's a lister ?
Forget about KDirListerCache, it's an internal class.
KDirLister is the class you want to use for listing.

> Ho... another thing :
> void  FilesAdded ( const KURL &directory )
> It say files was added to a directory.
> But it don't say What files ?
Right. One needs to re-list the directory (e.g. with KDirLister), to find
out all the new files. FilesAdded wouldn't be able to provide enough
information anyway. Well, it could ship the URLs I guess.... Tell me if
you need that, it could be arranged :) But that's a detail.

IMHO the real fix for this would be that somehow DNOTIFY would emit
"renamed" (or moved) instead of "deleted+added".  But I have no idea
if that's possible.

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).




More information about the kde-core-devel mailing list