setMinimumWidth( 400 );
- PLModel *model = new PLModel( p_playlist, p_intf, p_root, this );
+ PLModel *model = PLModel::getPLModel( p_intf );
#ifdef MEDIA_LIBRARY
MLModel *mlmodel = new MLModel( p_intf, this );
mainView = new StandardPLPanel( this, p_intf, p_root, selector, model, mlmodel );
playlist_item_t *, QObject *parent = 0 );
virtual ~PLModel();
+ static PLModel* getPLModel( intf_thread_t *p_intf )
+ {
+ if(!p_intf->p_sys->pl_model )
+ {
+ playlist_Lock( THEPL );
+ playlist_item_t *p_root = THEPL->p_playing;
+ playlist_Unlock( THEPL );
+ p_intf->p_sys->pl_model = new PLModel( THEPL, p_intf, p_root, NULL );
+ }
+
+ return p_intf->p_sys->pl_model;
+ }
+
/*** QModel subclassing ***/
/* Data structure */
intf_sys_t *p_sys = p_intf->p_sys = new intf_sys_t;
p_intf->p_sys->b_isDialogProvider = isDialogProvider;
p_sys->p_mi = NULL;
+ p_sys->pl_model = NULL;
/* */
vlc_sem_init (&ready, 0);
/* Delete the configuration. Application has to be deleted after that. */
delete p_intf->p_sys->mainSettings;
+ /* */
+ delete p_intf->p_sys->pl_model;
+
/* Destroy the MainInputManager */
MainInputManager::killInstance();
class QMenu;
class MainInterface;
class QSettings;
+class PLModel;
struct intf_sys_t
{
vlc_thread_t thread;
QVLCApp *p_app; /* Main Qt Application */
+
MainInterface *p_mi; /* Main Interface, NULL if DialogProvider Mode */
QSettings *mainSettings; /* Qt State settings not messing main VLC ones */
- bool b_isDialogProvider; /* Qt mode or Skins mode */
-
- int i_screenHeight; /* Detection of Small screens */
+ PLModel *pl_model;
QString filepath; /* Last path used in dialogs */
+ int i_screenHeight; /* Detection of Small screens */
+
+ bool b_isDialogProvider; /* Qt mode or Skins mode */
#ifdef WIN32
bool disable_volume_keys;
#endif