PATCH: Bug 52115: rename of directory misbehaves
Dawit A.
adawit at kde.org
Wed Jan 14 02:38:00 GMT 2004
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 ?
> > 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 ?
> > On related note it is sad none of the common remote protocols, ftp, fish,
> > sftp, gracefully deal with renaming of directories or files to an
> > existing name. More things to fix :(
>
> Hmm, what's the problem? Wrong stat() implementation?
Not returning the correct error message. :(
The io-slaves do:
Attempt to rename -> error -> return error.
They should instead be doing:
Attempt to rename -> error -> try to stat -> return exists if it does OR the
original error message if not...
--
Regards,
Dawit A.
"Preach what you practice, practice what you preach"
More information about the kde-core-devel
mailing list