[PATCH] Add a removeDir function to KDE 3.5.x
thiago at kde.org
Tue Feb 28 14:58:30 GMT 2006
Nicolas Goutte wrote:
>> >As for KDE4, should be makeDir be moved too?
>> No. For KDE4, use QDir stuff. If you don't find an equivalent (I don't
>> think there is an equivalent of "rm -rf" there), let me know.
>Sure, it would be the best that QDir could remove a non-empty directory,
> but cannot. (As written, it is Qt Issue N104800 and the wish was
The reason it was rejected is that it's a liability. That much is true.
So, isn't it a liability to provide such a function in KDE?
>If the removeDir function has to be done with QDir, it will be probably
>slower, as QDir filters, sorts and so on. (I am not even sure if QDir
> can handle hidden files.)
That's an orthogonal problem to the issue at hand. We're aware of the
slowness in the file engine and will fix that soon.
Aside from that, the task is the same: one has to list the items in the
dir and recurse over to subdirs.
>As for makeDir, there is not a direct equivalent either, as the one of
> KDE sets the permissions too (something that QDir cannot do and in
>QFile::Permissions there is the warning: "This behavior might change in
> a future Qt version.")
Set the umask if you want to set permissions in the dirs.
And you're quoting documentation out of context. It says the different
platforms have differing behaviours regarding the concept of "User". The
warning is there because on Windows we can get the information about the
user easily, while on Unix it isn't so: the warning is there because we
want to fix that.
Aside from that, yes, it does look like a setPermissions in QDir is
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
3. Ac seo woruld wearð geborod, swá se Scieppend cwæð "Gewurde Unix" and
wundor fremede and him "Unix" genemned, þæt is se rihtendgesamnung.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 191 bytes
Desc: not available
More information about the kde-core-devel