[PATCH] fix rename crash in Konqy

Michael Brade brade at kde.org
Sun Nov 3 21:59:40 GMT 2002


Hi!

Somehow I have the feeling almost nobody knows how KDirLister works :-\ The 
attached patch essentially reverts AleXXX hack^Hcommit from 5 months ago, 
removing the renamingFinished() method in KonqBaseListViewWidget and 
KonqIconViewWidget. In combination with John's patch (which nobody seems to 
have tested) it crashes Konqy.

Here's why: if the renaming succeeds KDirLister will emit deleteItem() and 
newItems(). So in the listview's renamingFinished() m_renamedItem is not 0, 
but a dangling pointer and the call to m_renamedItem->updateContents() is the 
reason for the crash.

In general, if after renaming a file with F2 the file is shown with a wrong 
name it is the fault of KDirLister not emitting the correct signal or a bug 
in the implementation of the slots connected to its signals.

I fixed the iconview as well, using the correct part of John's patch ;-), that 
is, testing if the new name is empty. There, we didn't crash Konqy because we 
don't delete the removed item for some reason I don't know, I'll change that 
after KDE 3.1 to prevent unwanted/unknown crashes. (the iconview seems to 
need some cleanups anyways...)

Please review, this definitely needs to go into KDE 3.1.

-- 
Michael Brade;                 KDE Developer, Student of Computer Science
  |-mail: echo brade !#|tr -d "c oh"|s\e\d 's/e/\@/2;s/$/.org/;s/bra/k/2'
  °--web: http://www.kde.org/people/michaelb.html

KDE 3: The Next Generation in Desktop Experience

-------------- next part --------------
A non-text attachment was scrubbed...
Name: kdebase.patch
Type: text/x-diff
Size: 10571 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20021103/8e6b441b/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: signature
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20021103/8e6b441b/attachment.sig>


More information about the kde-core-devel mailing list