]> git.sesse.net Git - vlc/commitdiff
qt4: remove p_playlist intf-change callback
authorIlkka Ollakka <ileoo@videolan.org>
Fri, 21 Aug 2009 16:36:16 +0000 (19:36 +0300)
committerIlkka Ollakka <ileoo@videolan.org>
Fri, 21 Aug 2009 18:40:05 +0000 (21:40 +0300)
As it doesn't seem to be called after creating playlist in core on startup
and playlist-model calls rebuild on creation anyway.

Also remove item-current from playlist-model which ain't used.

modules/gui/qt4/components/playlist/playlist_model.cpp
modules/gui/qt4/components/playlist/playlist_model.hpp

index ab94db4310a9bd8f600b3ff91675cf52a0863f4a..7de54d2706934ce552768e08c17c204ed7c7d63a 100644 (file)
 
 QIcon PLModel::icons[ITEM_TYPE_NUMBER];
 
-static int PlaylistChanged( vlc_object_t *, const char *,
-                            vlc_value_t, vlc_value_t, void * );
-static int PlaylistNext( vlc_object_t *, const char *,
-                         vlc_value_t, vlc_value_t, void * );
 static int ItemAppended( vlc_object_t *p_this, const char *psz_variable,
                          vlc_value_t oval, vlc_value_t nval, void *param );
 static int ItemDeleted( vlc_object_t *p_this, const char *psz_variable,
@@ -323,11 +319,6 @@ void PLModel::removeItem( int i_id )
 /* callbacks and slots */
 void PLModel::addCallbacks()
 {
-    /* Some global changes happened -> Rebuild all */
-    var_AddCallback( p_playlist, "intf-change", PlaylistChanged, this );
-    /* We went to the next item
-    var_AddCallback( p_playlist, "item-current", PlaylistNext, this );
-    */
     /* One item has been updated */
     var_AddCallback( p_playlist, "playlist-item-append", ItemAppended, this );
     var_AddCallback( p_playlist, "playlist-item-deleted", ItemDeleted, this );
@@ -335,10 +326,6 @@ void PLModel::addCallbacks()
 
 void PLModel::delCallbacks()
 {
-    /*
-    var_DelCallback( p_playlist, "item-current", PlaylistNext, this );
-    */
-    var_DelCallback( p_playlist, "intf-change", PlaylistChanged, this );
     var_DelCallback( p_playlist, "playlist-item-append", ItemAppended, this );
     var_DelCallback( p_playlist, "playlist-item-deleted", ItemDeleted, this );
 }
@@ -659,7 +646,7 @@ void PLModel::customEvent( QEvent *event )
 {
     int type = event->type();
     if( type != ItemAppend_Type &&
-        type != ItemDelete_Type && type != PLUpdate_Type )
+        type != ItemDelete_Type )
         return;
 
     PLEvent *ple = static_cast<PLEvent *>(event);
@@ -668,8 +655,6 @@ void PLModel::customEvent( QEvent *event )
         processItemAppend( &ple->add );
     else if( type == ItemDelete_Type )
         processItemRemoval( ple->i_id );
-    else
-        rebuild();
 }
 
 /**** Events processing ****/
@@ -1186,25 +1171,6 @@ void PLModel::popupSortDesc()
 /**********************************************************************
  * Playlist callbacks
  **********************************************************************/
-static int PlaylistChanged( vlc_object_t *p_this, const char *psz_variable,
-                            vlc_value_t oval, vlc_value_t nval, void *param )
-{
-    PLModel *p_model = (PLModel *) param;
-    PLEvent *event = new PLEvent( PLUpdate_Type, 0 );
-    QApplication::postEvent( p_model, event );
-    return VLC_SUCCESS;
-}
-
-static int PlaylistNext( vlc_object_t *p_this, const char *psz_variable,
-                         vlc_value_t oval, vlc_value_t nval, void *param )
-{
-    PLModel *p_model = (PLModel *) param;
-    PLEvent *event = new PLEvent( ItemUpdate_Type, oval.i_int );
-    QApplication::postEvent( p_model, event );
-    event = new PLEvent( ItemUpdate_Type, nval.i_int );
-    QApplication::postEvent( p_model, event );
-    return VLC_SUCCESS;
-}
 
 static int ItemDeleted( vlc_object_t *p_this, const char *psz_variable,
                         vlc_value_t oval, vlc_value_t nval, void *param )
index 5550f799b58d8fbcf74c2b5609768bf6b0c8b2df..0383a0b1f6914b23b1a6b07250795a5c98554909 100644 (file)
@@ -54,7 +54,6 @@ enum {
     ItemUpdate_Type = QEvent::User + PLEventType + 2,
     ItemDelete_Type = QEvent::User + PLEventType + 3,
     ItemAppend_Type = QEvent::User + PLEventType + 4,
-    PLUpdate_Type   = QEvent::User + PLEventType + 5,
 };
 
 class PLEvent : public QEvent