From 59b1d53f6e55d31233f53611e44ed013d3f7cdb2 Mon Sep 17 00:00:00 2001 From: Ilkka Ollakka Date: Fri, 21 Aug 2009 19:36:16 +0300 Subject: [PATCH] qt4: remove p_playlist intf-change callback 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. --- .../components/playlist/playlist_model.cpp | 36 +------------------ .../components/playlist/playlist_model.hpp | 1 - 2 files changed, 1 insertion(+), 36 deletions(-) diff --git a/modules/gui/qt4/components/playlist/playlist_model.cpp b/modules/gui/qt4/components/playlist/playlist_model.cpp index ab94db4310..7de54d2706 100644 --- a/modules/gui/qt4/components/playlist/playlist_model.cpp +++ b/modules/gui/qt4/components/playlist/playlist_model.cpp @@ -46,10 +46,6 @@ 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(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 ) diff --git a/modules/gui/qt4/components/playlist/playlist_model.hpp b/modules/gui/qt4/components/playlist/playlist_model.hpp index 5550f799b5..0383a0b1f6 100644 --- a/modules/gui/qt4/components/playlist/playlist_model.hpp +++ b/modules/gui/qt4/components/playlist/playlist_model.hpp @@ -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 -- 2.39.2