KFileTreeView almost fixed - STRANGE STUFF

Rafael Fernández López ereslibre at kde.org
Sun Dec 2 04:54:57 GMT 2007


Hi,

After some debugging, I found out what was the problem. In general terms, what 
happened is that not all nodes are fetched (that is normal). When it tries to 
expandToUrl(), say "/home/ereslibre", it will try to go "/", retrieve "home", 
and later search in there what folders there were.

As they are populated-on-demand, what happened is that "/home" was just empty, 
and when trying to search, you weren't getting into the search loop at method 
nodeForUrl().

For me, it is _THE MOST IMPORTANT THING_ right now to work on this patch, and 
later, I can commit the fix for the tree view.

Attached is a patch that fixes the problems presented. Try to run: 
kdelibs/kfile/tests/kfiletreeviewtest, and you will see that you won't have 
more empty nodes, as well as the folder you want will be highlighted.

Now, this patch has serious, I mean _serious_ problems. First of all, if the 
eventLoop.exec(QEventLoop::WaitForMoreEvents); of the patch is uncommented, 
kdelibs/kio/tests/kdirmodeltest never ends. If you comment it out, it ends 
but you get 2 failures.

Second, this code is not safe.

+                    QObject::connect(m_dirLister, SIGNAL(completed()),
+                                     &eventLoop, SLOT(quit()));
+                    QObject::connect(m_dirLister, SIGNAL(canceled()),
+                                     &eventLoop, SLOT(quit()));

This can refer to whatever. If we get lots of population requests, it can go 
crazy because with this patch there's currently no way of knowing to which we 
are referring to.

I only wanted you to know that I am working hard on this issue, and that I 
hope this will be fixed soon.

Attached is the patch so you can comment on it.

When having something that is at least interesting enough to be discussed for 
committing, I will post again on this thread.


Bye and thanks, 
Rafael Fernández López

GPG Fingerprint: B9F4 4730 43F8 FFDD CC5E BA8E 724E 406E 3F01 D070
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kdirmodel.diff
Type: text/x-diff
Size: 4223 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20071202/769a231d/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20071202/769a231d/attachment.sig>


More information about the kde-core-devel mailing list