[KPhotoAlbum] Patch to speed up scanning for new images

Henner Zeller h.zeller at acm.org
Fri May 11 09:41:42 BST 2007


Hi,

In general, I like the patch as unnecessary stat()s make things very
slow (especially on NFS/SMB or external USB drives .. which is a
typical place for photo libraries).

Using readdir_r/readdir in this way seems fine to me, but please add a
comment saying that this is done similarly qdir_unix.cpp which
probably makes discussion about this topic not as lengthy. Of course,
there might be improvements (esp. I wouldn't allocate this on the
stack).

Regarding the naming, I would probably name this FastDir or something
.. MyDir is not really a useful name. And add documentation saying
what it does (its fast by not doing stat()). In general, add a little
comment to all methods (the current style of not having comments is
doesn't mean that it should be followed ;-) )

Style wise I'd suggest to make the MyDir::path_ const, as it is only
set once in the constructor.
I would not make entryList() (and hence, the destructor) virtual,
since this class is not overridden anyway. The destructor can go away
completely in this case.

As a friend of simplicity, I would suggest not to add a default
constructor, since it is not used anyway; but as the behaviour of the
current default constructor is very reasonable (take the current
directory) it seems fine to me (but comment it).

Don't forget to remove the SurveyDialog-quietening 'return;' ;-)   (nice try)

cheers,
  -henner



More information about the Kphotoalbum mailing list