[Kwintv] QtVision cleanup

Dirk Ziegelmeier dirk at ziegelmeier.net
Sun Nov 30 19:53:03 CET 2003


On Sunday 30 November 2003 12:17, Dirk Ziegelmeier wrote:

I think I should explain the motivation of the changes a bit:

Class qtvision wraps a lot of the different manager's APIs, especially, it was 
basically a source manager. I don't like that, qtvision should have an API a 
client needs. That's changing video device, setting volume and channels and 
launching a few dialogs, nothing more - these are actions that need a 
sequence of calls to different managers to achive useful behaviour. Using one 
of the managers directly needs care (it also did before) - things quickly get 
out of sync. This could have been fixed by using various signals to 
automatically get things correct again, but I didn't want to do it. There are 
situations where this is not desirable, e.g. if you call the channel wizard. 
It needs to change source and encoding without qtvision interfering to force 
a channel or picture settings or whatever.

Pluins must not be known outside managers, in fact, they don't even have a 
method for getting the active plugin any more.

A client may use some manager's signals if it needs to catch some events.

Also, I was annoyed by constant "if (_am && _am->plugin()", "if (_mm)" and so 
on all over the program and the resulting crashes if you missed one. A 
manager is always there, so they are all created in qtvisions constructor, 
even if they are not operational due to a missing tv widget. Also, all 
manager functions may safely be called at any time. If there is no plugin, 
they don't do anything and return an error. Those interested in success of a 
call may check the return value. Currently, it is mostly ignored.

I also changed the GUI factory management: It's now done by the plugin 
factory. It can keep track of all instanciated plugins easily, so the 
corresponding code in qtvision vanished.

Hope this clears things up,
Dirk

--
Dirk Ziegelmeier * dirk at ziegelmeier.net * http://www.ziegelmeier.net


More information about the kwintv mailing list