[PATCH] Make KDiskFreeSpace more convenient -> KJob-like usage

Alex Merry huntedhacker at tiscali.co.uk
Thu Jul 24 22:44:14 BST 2008


On Thursday 24 July 2008 22:03:06 Sebastian TrĂ¼g wrote:
> The attached patch reverts my previous patch and marks the whole
> KDiskFreeSpace class deprecated (although that would not link here so I
> marked the methods).
> A new class takes its place that works 100% sync and has a rather nice API.
>
> May I commit?

Yes, that looks like a very nice way of doing it.

My only comments are on the API dox:

This class wraps around the system calls to detemermine the free space left in 
a specific partition.  It supports arbitrary paths and the mount point of the 
partition in question.

Instead, I'd put:

This class determines the free space left on the partition that holds a given 
path.  This path can be the mount point or any file or directory on the 
partition.

And instead of:

Usage is very simple through the one static method:

I'd have

To find how much space is available on the partition containing @p path, 
simply do the following:

Also, I'd note in the docs for each method that returns a KIO::filesize_t what 
units the return value is in.

Other than that (sorry, I'm a bit obsessive about apidocs), I think it looks 
great.

Alex



-- 
KDE: http://www.kde.org
Ubuntu/Kubuntu: http://www.ubuntu.org http://www.kubuntu.org





More information about the kde-core-devel mailing list