KDirWatch emitting dirty signal many times for one change
Sébastien Laoût
sebastien.laout at tuxfamily.org
Tue Apr 13 11:43:26 BST 2004
Le mar 13/04/2004 à 10:18, David Faure a écrit :
> On Tuesday 13 April 2004 01:32, Sébastien Laoût wrote:
> > - Is their another way to detect renaming ?
>
> Yes, for renamings happening in Konqueror, you can connect to the KDirNotify
> DCOP interface. A DCOP signal ("KDirNotify", "FileRenamed(KURL,KURL)")
> is emitted when a file is renamed in konqueror or kdesktop (or any other app using KIO).
Hum...
No : it isn't what I want to do.
I have some "baskets", each have an associated arbitrar folder.
Not only desktop folder or opened in Konqueror folder.
I don't want to start a Konqueror window for each folders and files I
want to surveil.
I want to be able to detect files creation/deletion/modification to
change the "view" of my app (add "items" that reflete the files, delete
them if the associated file is deleted...).
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).
On top of that I would want to rename file inside my app.
So I could just rename the file and keep the KDirWatch detect this and
reassociate file to the appropriate item.
But this must be a reliable process.
Users couldn't support data lost...
Or perhapse I haven't well understood you proposal.
Is it Konqueror independant ?
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 ?
Or in a Nautilus ???
Or anywhere else than Konqueror/KDE_KIO_progs ?
It's not too trustable as far as I see it.
As I browse the KDE doc, I see class KDirListerCache that provide
addd/removed/changed/renamed.
But it's a lister ?
I just need to watch some folders plus some files for change...
Ho... another thing :
void FilesAdded ( const KURL &directory )
It say files was added to a directory.
But it don't say What files ?
Arf. I'm quite annoyed...
Perhapse I couldn't do what I would want to code... :-/
Another issue ?
A thing I haven't understood ?
More information about the kde-core-devel
mailing list