Using DUChain from the main thread

David Nolden david.nolden.kdevelop at art-master.de
Wed Oct 31 14:22:44 UTC 2007


On Wednesday 31 October 2007 13:32:39 Hamish Rodda wrote:
> Speaking of blocking the main thread, is the code completion stuff still
> done in the main thread?  If so, I'm tempted to move it out...

I think most stuff is done in the main thread currently, yes. But he slowest 
processing happens within kate I think, although I think I've already speeded 
that up by not sorting by name(too slow for very long lists).

> I thought about it more, and you're right, this is a good way to go.  It's
> easier to write bug-free code compared to playing with bare pointers.  My
> main concern was having to duplicate the displayed parts of the duchain
> whenever you want to provide it as a model, but I've realised that this has
> to be done anyway.
>
> (BTW, why does the DUChainBase object set m_base, even though it already
> passes the pointer to itself in the constructor?)

I have no time to look into that at this moment.

Just by the way, since our DU-Chains might get very big, wouldn't it be best 
to build the class-view tree on demand? It could only know about the items 
currently visible, and it would only need to react on changes of currently 
visible items, and it would not need to hold a structural copy of the whole 
du-chain. It could read new data from the du-chain in the moment the user 
expands an item.

Since the list of visible items is limited, it could hold a 
map "DUChainPointer -> QPersistentModelIndex" for all visible items, which 
would allow efficient and simple updating.

greetings, David





More information about the KDevelop-devel mailing list