[KDev4] Opening project with real ASync way

Matt Rogers mattr at kde.org
Mon May 28 01:51:24 UTC 2007


On May 27, 2007, at 7:36 AM, dukju ahn wrote:

> 2007/5/27, dukju ahn <dukjuahn at gmail.com>:
>> It works very well. But there is one problem. Because now
>> ProjectBaseItems are created on separated thread, we can't invoke
>> setIcon() at the constructor of ProjectBaseItem and its subclasses.
>> Otherwise it segfaulted. Especially KIO::pixmapForUrl() was the  
>> reason
>> of crash.
>>
>> One solution would be to invoke setIcon() in the slot connected to
>> KJob::done(). Starting from top item, we go recursively into every
>> children and call childItem->setIcon().
>
> Here is the completed patch. The advantages are two
>
> 1. GUI doesn't hang while openning a big project
>
> 2. Project parsing became much faster because the setIcon() in each
> ProjectBaseItem isn't invoked for full recursive file/dirs. Rather, we
> just setIcon() only for toplevel items. Icon for Children items are  
> set up
> when the user expands treeview.
> I've found that setIcon() is very time-consuming operation.
>

We still do the project parsing all at once though, right? The reason  
for doing it all at once is that if we do it all at the start, we  
might be able to eliminate the need to have a constant connection  
while working on remote projects.

> Actually, Number 2 was some workaround for the problem above.
> Ironically, it brought much better performance.
>
> If Nobody disagree, I'll commit it at monday.
> <asyncopen-managerview.patch>
> <asyncopen-project.patch>
> <asyncopen-shell.patch>

I have no disagreements, commit it now if you'd like.

General comments for next time:
  - Just make one patch file with "svn diff", it's actually easier to  
read and review

Matt






More information about the KDevelop-devel mailing list