[Kwintv] Plugin access to the UI - more problems

George Staikos staikos at kde.org
Tue Jul 1 01:22:34 CEST 2003


On Wednesday 11 June 2003 18:06, Rizsanyi Zsolt wrote:
> >    Argh this is a never-ending cycle here. :-)  Ok I might have to find a
> > way to delay plugin initialisation then, maybe through a single-shot
> > timer in QtVision*.  I'll play with it and try to commit a new attempt.
>
> Your changes have not immidiately solved the problem. I have had no time to
> check if it is a problem on my side or not.
>
> But the patch has caused many regressions. Many signal/slot connects do not
> succeed, and the popup menu does not appears on right mouse click.
> Some of the signal slot connect problems are easily solved, but some are
> not. You initialize some elements (like the osdmanager) in the delayed
> constructor but clients/mainwindow tries to attach a slot to it. It can be
> only solved by adding a delayedconstructor it too. But this can cause more
> problems and it could go forever.

  Hm this sounds bad.  I just don't have time to try to hack at it.  You may 
revert all the changes if you like.

> IMO you should change the whole concept in a way where the plugins do not
> access the actionCollection and gui directly, but have some methods which
> are called back when the gui initialization is done.

  Good point.  Let's do this.

> Eg. add a virtual addActions(ActionCollection&) method to the pluginbase.
> All the plugins who want to add actions would override this method.
> Clients (eg. clients/mainwindow) would do normal initialization (without
> delayed constructors ;), and when the initialization is done it would call
> the QtVision::setActionCollection which in turn would call the addActions()
> method of all the initialized plugins.
> Of course care should be taken to call addActions on plugin which are
> turned on later (not while the initialization).
> This also can have problems but avoids this initialization race we have
> now.
>
> What do you think? Should we change to this (or some other) method, or try
> to fix all the initialization problems?

  If you can, please revert all the changes I made and do it the way you 
describe.  Add something to the plugin base class and have it called in the 
appropriate place.  Plugins should be able to deal with never having this 
called of course. 
-- 
George Staikos
KDE Developer				http://www.kde.org/
Staikos Computing Services Inc.		http://www.staikos.net/



More information about the kwintv mailing list