KFileIconView returning bad pointers?

Waldo Bastian bastian at kde.org
Sat Feb 5 15:32:05 GMT 2005


On Saturday 05 February 2005 11:32, Charles Samuels wrote:
> In this bug: http://bugs.kde.org/show_bug.cgi?id=98287
>
> With this bt:
> #4  0xb7eb2076 in KFileIconView::setSelected ()
>    from /opt/kdecvs/lib/libkio.so.4
> #5  0xb5f47df0 in Previews::go (this=0x83dfea8, k=0x839faa8)
>     at photobook.cpp:91
> #6  0xb5f48023 in Previews::goToFirst (this=0x83dfea8) at photobook.cpp:128
>
>         if (firstFileItem())
>                 go(firstFileItem());
>
> So, in other words, KFileIconView appears to be giving a bad pointer.  Is
> there something I'm missing here?  Obviously Konqueror doesn't have this
> behavior.

FileItems are very fragile, when the directory gets updated they may get 
deleted so it is very important to listen very carefully to all signals from 
KDirLister and friends. See e.g. KDirLister::deleteItem() --> 
KDirOperator::itemDeleted() --> KFileView::removeItem()

Cheers,
Waldo
-- 
bastian at kde.org   |   Free Novell Linux Desktop 9 Evaluation Download
bastian at suse.com  |   http://www.novell.com/products/desktop/eval.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20050205/8a61280e/attachment.sig>


More information about the kde-core-devel mailing list