Wednesday, August 20, 2008

Size limits for trash

Some weeks ago, one of our customers asked for a nice
feature that was requested 4 years ago the first time
as far as I can see from the bug tracking system.
He wanted an option to set a maximum size for the users
trash like you can do on Windows or MacOSX to avoid situations
where the trash fills 50% of your hard disc and you wonder why
you can't download emails any more ;)

As you can see in bug 79553 and 111861, there are some more
ideas how to improve the space handling of your desktop trash,
so instead of just implementing a static size limit I started
implement most of the features requested there and 3 days later
we have a nice trash space handling now.

When you right click on your trash icon on the desktop and
choose the 'Properties' entry, the appearing dialog will
offer a new tab 'Size Limits' now as shown in the screen shot
below.


Here you can choose whether files that lie in the trash for
longer than X days shall be deleted automatically or whether
there shall be a size fixed limit.


If a size limit is set and your trash is full already, trying
to put another file into the trash will trigger an action that
can be one of the following:

  • Warn user only: A dialog is shown to inform the user that his trash is full and that he has to remove files manually before he can put new files into the trash
  • Delete oldest files from trash: This will remove files (beginning with the oldest one) successively from the trash until the new file fits in
  • Delete biggest files from trash: This will remove files (beginning with the largest one) successively from the trash until the new file fits in
One of the nice features of the freedesktop.org trash standard is, that you can have multiple trashes, one for each mount point.
If your administrator has setup these, the trash configuration dialog will look like below:

Now you can configure different size limits for each trash.

As you may have recognized, this patch is for KDE 3.5.9, because our customer is still running that version. I'll try to push that patch
into KDE 3.5.10 and port it forward to KDE 4.2 as well.