[KDev4] Opening project with real ASync way

Andreas Pakulat apaku at gmx.de
Mon May 28 08:53:54 UTC 2007


On 28.05.07 02:22:59, dukju ahn wrote:
> 2007/5/27, Andreas Pakulat <apaku at gmx.de>:
> > On 27.05.07 08:36:43, dukju ahn wrote:
> > If I see this correctly this is a depth-first approach right? I think a
> > width-first (or whatever you call that in english, where you first run
> > over all items at the current level before you decend into the next) is
> > better, else a user opens the projectmanagers first item and the items
> > are not all there yet.
> 
> During the process of parsing, there should be no GUI changing
> because QWidgets are not thread-safe. Only when every parsing is
> completed, the user can see items. So Don't worry about the empty
> items of first parent.

So you're saying that until the whole project is parsed the
projectmanagerview shows nothing? Thats not good, IMHO the
projectmanager view should be populated with items as soon as the
manager plugin created them. btw, are the qstandarditems created in the
non-gui thread and then transferred into the gui thread to be used in
the GUI or are they created inside the GUI thread? What about
concurrency? the parse() function of the manager isn't needed to be
threadsafe and in fact I doubt it is at the moment. For example at some
point I'll need to access at least the projects kconfig object in qmake
manager.

Sorry I didn't think about this yesterday, but it was a bit late here.

> > > +    connect( project, SIGNAL(importingFinished(IProject*)), this, SLOT(projectImportingFinished(IProject*)) );
> >
> > I guess I'm missing something but why can't the project private do the
> > stuff in that slot directly instead of adding this indirection, a signal
> > and a friend declaration? All that the project private class needs is
> > asking Core::self() for the projectcontrollerinternal and execute a
> > that slot with the project.
> > Then I think the project private class also
> > doesn't need a Project* but can live with a plain IProject*.
> 
> Unfortunately, Core::self() returns _I_ProjectController, not ProjectController.

Right, thats why Core has projectControllerInternal().

> If we follow your idea, this projectImportingFinished() slot should be
> added into IProjectController also.
> Also, It is not natural design to invoke ProjectController's method
> inside each Project.

Why is that not natural design? Currently I see a signal and a slot
added for 1 call, which can be done directly anyway. Signal/Slot should
be used if you want to notify multiple objects of something or if you
expect to connect multiple signals to a slot, or both - IMHO.

Andreas

-- 
Expect a letter from a friend who will ask a favor of you.




More information about the KDevelop-devel mailing list