konqy F2 file renaming bug

David Faure david at mandrakesoft.com
Wed May 8 23:48:01 BST 2002


On Thursday 09 May 2002 00:36, aleXXX wrote:
> Hi,
> 
> both in konqy's listview and in kdesktop there appears the following bug:
> 
> select an item, where you don't have permission to rename it, press F2, 
> rename it, press enter -> error message appears "could not rename", but the 
> renamed text of the icon/listview item stays changed.

Yup.

> If the renaming fails, this is noticed if KonqOperations::slotResult() and a 
> message box is displayed. There we don't know what caused the operation, 
> whether it was DnD or icon renaming or listviewitem renaming.
> And since the KonqOperations are async, they don't return whether they were 
> successful.

Yup.

> So, what can we do ?

Found the same already, and:
0) got Simon to say he'd fix it ;)

> I see three ways:
> 
> 1.) if MOVE and failed, then update the whole dir
Almost like 4) below - the hard bit is to detect failure. One that's done,
updating the whole dir isn't the best action ;)

> 2.) in slotItemRenamed() set some pointer in KonqOperations (we would need 
> two, one for icon, one for listviewitem) to the item which initialized the 
> renaming, and if it fails, rename the icon/listviewitem back to its original 
> name
Rather not make konqoperations view-specific in any way, people come up
with new kind of views ;)

> 3.) before calling KonqOp::rename() stat the dir whether we have enough 
> permissions (might slow it a bit down)
... and might not catch all cases (network transparency, FTP forbidding renames etc.)

> What should I do ? (my order: 3,1,2)

With Simon we decided for something like (IIRC)
4) let KonqOperations::rename take an object and slot to connect
to, and to call if the rename failed.
The KonqOperations object connects to the Job's copyingDone() or whatever
the signal is called, and has a new bool. If copyingDone is emitted the bool
is changed to "it worked". In slotResult if the bool is still "didn't work" then
that slot (passed to rename in the first line of this unclear explanation ;)
is called - and the iconview or listview can fix the text of the item
(calling slotRefreshItem on it I guess).
Simon..... how much of that did you do?

-- 
David FAURE, david at mandrakesoft.com, faure at kde.org
http://people.mandrakesoft.com/~david/
Contributing to: http://www.konqueror.org/, http://www.koffice.org/
KDE, Making The Future of Computing Available Today





More information about the kfm-devel mailing list