[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: Re: [PATCH] Make KDiskFreeSpace more convenient -> KJob-like usage
From: Alex Merry <huntedhacker () tiscali ! co ! uk>
Date: 2008-07-24 18:31:50
Message-ID: 200807241931.50282.huntedhacker () tiscali ! co ! uk
[Download RAW message or body]
On Thursday 24 July 2008 08:07:22 Sebastian Trüg wrote:
> bool KIO::freeDiskSpace( const QString& path, KIO::filesize_t* avail,
> KIO::filesize_t* size = 0 )
>
> would that be OK? And if so, should I revert the previous patch?
Personally, I think it looks odd having a function named freeDiskSpace not
returning the data, but passing it out in pointers-to-ints. But I'm not sure
how to get around that, since you want to set several values at once, and
having it return one but not the others would create a strange asymmetry.
Would splitting it into two functions (freeDiskSpace and totalDiskSpace, say)
have a significant impact on performance? I mean, is it worth the extra time
cost to have a more natural API, especially as it would probably still involve
passing a pointer to a bool to check it worked, since filesize_t is unsigned?
Other than that, I think that "size" would be better named "total" and "avail"
should be either "available" or "free".
Alex
--
KDE: http://www.kde.org
Ubuntu/Kubuntu: http://www.ubuntu.org http://www.kubuntu.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic