On Saturday 25 June 2011 13:08:46 Christoph Feck wrote:
> On Saturday 25 June 2011 11:51:47 Tom Chiverton wrote:
> > I'm looking at fixing https://bugs.kde.org/show_bug.cgi?id=79943 (limit
> > ~/.thumbnails size) and it seems sensible to start looking at how Trash
> > size limiting is done. Can anyone point to the module ?
> 
> kdebase/kde-runtime/kioslave/trash

adaptTrashSize() appears to be the sort of thing I'm after..
I suppose I need to do something similar from the createSubThumbnail() method 
in kioslave/thumbnail/thumbnail.cpp ?

> You probably need to store information which thumbnails where accessed 
> recently or frequently, so you do not delete the "wrong" ones.

The O/S provides this (atime). I guess there's also an (KIO ?) API for getting 
the space used by a directory. From looking at the Trash impl., there are 
already ways to get what is needed for minimal attempt at fixing this ASAP.

As this is a critical data loss bug (because eventually ~/.thumbnails consumes 
all available disk space and KDE gets *very* upset) I'm going with a simple 
solution first (delete everything unused for more than N days).
There is a FreeDesktop.org spec for this as linked from the bug but it's from 
2004.

-- 
Tom
Be truthful to your friends and lie like hell to your enemies.
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

Reply via email to