PATCH: Bug 52115: rename of directory misbehaves

David Faure faure at
Wed Jan 14 08:54:09 GMT 2004

On Wednesday 14 January 2004 03:38, Dawit A. wrote:
> On Tuesday 13 January 2004 18:03, David Faure wrote:
> > > > Also, the KURL(m_dest,newPath) looks wrong. The 2nd arg of that KURL
> > > > ctor doesn't take paths (this would lead to bugs with files containing
> > > > e.g. '#' in their name). m_dest.setPath(newPath) should be enough.
> > >
> > > Ah okay. But that still does not prevent people from typing the path in
> > > manually, either by mistake or otherwise, no ? I did not see any
> > > validator on the lineedit of the rename dialog which I think we will need
> > > at some point in the future...
> >
> > You misunderstood. '#' is perfectly fine in a filename. The point is that
> > KURL(m_dest,newPath) is wrong. KURL(2 args) takes two encoded URLs,
> > no paths. A path and a URL can both be put in a QString, but the semantics
> > differ (and '#' is one example of why a path and a url are not the same
> > thing).
> No, no I understand why you did it from your previous explanations. I am not 
> entirely okay with it, but then again I am never entirely okay with KURL so 
> it does not matter. :) But what I was trying to say was that there was 
> nothing that stops the user from typing say "/somedir/somewhere" and your 
> setPath(...) call would use that. It might be okay, but probably not 
> something you intentionally wanted, no ?

Ah, slashes. Hmm, my fix for this would be KIO::encodeFileName(), but IIRC 
in the thread relative to using '/' in filenames, most people said they didn't
want this to be possible. So now I'm not sure what to do.

> > > Looks okay. Can you add the ERR_FILE_ALREADY_EXISTS check as well then ?
> >
> > Done already (at least in CVS, but also in the patch IIRC?).
> The last patch did not have it and I did not see any commit for job.cpp today 
> from you either. Hmm... forgot to commit perhaps ?
Indeed, thanks.

> The io-slaves do:
> Attempt to rename -> error -> return error. 
Ah, yes, I see. We assume that the slave will do the proper stat()s to figure out if
the destination already exists. OK.

David FAURE, faure at, sponsored by Trolltech to work on KDE,
Konqueror (, and KOffice (

More information about the kde-core-devel mailing list