PATCH: Bug 52115: rename of directory misbehaves

Dawit A. adawit at kde.org
Tue Jan 13 10:25:22 GMT 2004


On Tuesday 13 January 2004 03:34, David Faure wrote:
> On Tuesday 13 January 2004 08:53, Dawit A. wrote:
> > On Monday 12 January 2004 03:52, David Faure wrote:
> > > Thanks but I'm afraid the patch is wrong (it duplicates code instead of
> > > fixing the bug :)
> >
> > Hmm... okay but you yourself said that the "fast" ::rename path is not
> > used after such trivial errors  which results in unnecessary stats and
> > lookups. That was exactly what I was trying to avoid once I got a hang on
> > everything. It is not the easiest thing to trace actions through job.cpp.
> > :) However, it is indeed a good decision to fix the actual bug first.
> > Could my patch then be considered as a short-circuit hack for using the
> > quick ::rename path for such trivial errors ?
>
> True, it would be good to do that. But it's not what your patch does, is
> it? 

It is supposed to. And the tests I did confirm that this is what happens...

> In the R_RENAME case it launches a ::stat() and goes to STATE_STATING, 
> i.e. it moves on to the "long way".

I am stating the destination and not source :) Also I reset the 
destinationState flag back to DEST_NOT_STATED so that 
CopyJob::slotResultStating does the "right thing"

       KURL newDest (m_dest, newPath);
       m_dest = newDest;
       KIO::Job* job = KIO::stat( m_dest, false, 2, false );
       state = STATE_STATING;                            
       destinationState = DEST_NOT_STATED;
       addSubjob(job);


> If your patch used fast-rename I would have committed it, no doubt :)
> We would need to loop around the fast-rename code
> (or recursively call it), to offer the rename box as long as an existing
> name is chosen... I think this would be safer done after 3.2.

I guess that is another possible solution as well and yes this is something 
that can wait for post 3.2.

> > However, the more pressing problem with your commit is that it exposes
> > yet another bug somewhere else. Here is the dialog box I get when I
> > rename a directory d1 to d2 and there is an existing directory d2:
> >
> > http://members.cox.net/kdelists/screenshots/rename-dlg-1.png
>
> Indeed (not related to my commit, this was already there). Fixed.

Great. Thanks...

-- 
Regards,
Dawit A.
"Preach what you practice, practice what you preach"




More information about the kde-core-devel mailing list