[vlc-devel] [vlc-commits] commit: qt4: Don't create QMenu without parents (Erwan Tulou )

Francois Cartegnie fcvlcdev at free.fr
Wed Apr 7 14:36:24 CEST 2010


Le mercredi 7 avril 2010, brezhoneg1 a écrit :
>     -  There is not one popmenu menu but four independent popmenus
>  (PopMenu, VideoPopupMenu, AudioPopupMenu, MiscPopupMenu) (see
>  dialogs_provider.cpp around line 162)

>     - imo, p_intf->p_sys->p_popup_menu  is an ugly implementation in C++.
>  What we need is actually some kind of a singleton class, that
>  automatically cleans after itself when needed

Definitively.
Storing ui classes references into the library isn't acceptable.
At best, there shouldn't have any libvlc code at all in the Qt code, except in 
some 'libvlc<->qtmodule adaptors' classes.

- define a QVLCMenu interface
- QVLCMenu inherits singleton
- Each popup menu class inherits QVLCMenu (insuring only 1 instance)
- New instance deletes old menu instance (with care of slicing), or recycle

Francois



More information about the vlc-devel mailing list