Unconsistent KDirNotify API

David Faure faure at kde.org
Tue Sep 28 20:38:28 BST 2004


On Tuesday 28 September 2004 21:31, Sébastien Laoût [temporar] wrote:
> Have anyone else noticed it:
> 
> virtual ASYNC KDirNotify::FilesAdded (const KURL &directory)=0
> virtual ASYNC KDirNotify::FilesRemoved (const KURL::List &fileList)=0
> virtual ASYNC KDirNotify::FilesChanged (const KURL::List &fileList)=0
> virtual ASYNC KDirNotify::FileRenamed (const KURL &src, const KURL &dst)
> 
> Every methods take a file or fileList parameter.
> But FilesAdded (hum, why is there a upper 'F'? It's a method) take a
> *directory*.
> 
> No way to know which file(s) has been added.
> 
> Is it intentional, for technical reasons, or is it intended to work only
> in Konqueror?

It is intended, because the list of added files wouldn't be enough information
anyway (you want to know their size, mimetype, etc.).
That was the design decision (that one needs to do a listDir() anyway, so
the list of files isn't useful), but maybe you're right, that's somewhat 
konqueror-specific (well, KDirLister specific, more generally).

Maybe this should be redone in KDE 4 to have both FilesAdded( list ) and 
DirectoryChanged( dir ) or so - with the explicit mention that only one
should be emitted, depending on the available information
(no need to do things twice in e.g. KDirLister).
FilesAdded currently means DirectoryChanged, basically.

-- 
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