[PATCH] Add a removeDir function to KDE 3.5.x

Nicolas Goutte nicolasg at snafu.de
Tue Feb 28 18:24:42 GMT 2006

On Tuesday 28 February 2006 15:58, Thiago Macieira wrote:
> 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
> > refused,)
> 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?

I am still not much more intelligent about this word "liability".

For me removing a non-empty directory is a rather basic task. (So I do not 
understand an answer of the kind "take your responsability!")

> >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.

Sorry, but something with such a warning is bad to use, even if the warning is 
on a tiny little bit. (And the different kind of behaviour is already a 

> Aside from that, yes, it does look like a setPermissions in QDir is
> missing.

Have a nice day!

More information about the kde-core-devel mailing list