Commit 59b1d53f authored by Ilkka Ollakka's avatar Ilkka Ollakka

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.
parent 7979c8dc
...@@ -46,10 +46,6 @@ ...@@ -46,10 +46,6 @@
QIcon PLModel::icons[ITEM_TYPE_NUMBER]; 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, static int ItemAppended( vlc_object_t *p_this, const char *psz_variable,
vlc_value_t oval, vlc_value_t nval, void *param ); vlc_value_t oval, vlc_value_t nval, void *param );
static int ItemDeleted( vlc_object_t *p_this, const char *psz_variable, static int ItemDeleted( vlc_object_t *p_this, const char *psz_variable,
...@@ -323,11 +319,6 @@ void PLModel::removeItem( int i_id ) ...@@ -323,11 +319,6 @@ void PLModel::removeItem( int i_id )
/* callbacks and slots */ /* callbacks and slots */
void PLModel::addCallbacks() 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 */ /* One item has been updated */
var_AddCallback( p_playlist, "playlist-item-append", ItemAppended, this ); var_AddCallback( p_playlist, "playlist-item-append", ItemAppended, this );
var_AddCallback( p_playlist, "playlist-item-deleted", ItemDeleted, this ); var_AddCallback( p_playlist, "playlist-item-deleted", ItemDeleted, this );
...@@ -335,10 +326,6 @@ void PLModel::addCallbacks() ...@@ -335,10 +326,6 @@ void PLModel::addCallbacks()
void PLModel::delCallbacks() 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-append", ItemAppended, this );
var_DelCallback( p_playlist, "playlist-item-deleted", ItemDeleted, this ); var_DelCallback( p_playlist, "playlist-item-deleted", ItemDeleted, this );
} }
...@@ -659,7 +646,7 @@ void PLModel::customEvent( QEvent *event ) ...@@ -659,7 +646,7 @@ void PLModel::customEvent( QEvent *event )
{ {
int type = event->type(); int type = event->type();
if( type != ItemAppend_Type && if( type != ItemAppend_Type &&
type != ItemDelete_Type && type != PLUpdate_Type ) type != ItemDelete_Type )
return; return;
PLEvent *ple = static_cast<PLEvent *>(event); PLEvent *ple = static_cast<PLEvent *>(event);
...@@ -668,8 +655,6 @@ void PLModel::customEvent( QEvent *event ) ...@@ -668,8 +655,6 @@ void PLModel::customEvent( QEvent *event )
processItemAppend( &ple->add ); processItemAppend( &ple->add );
else if( type == ItemDelete_Type ) else if( type == ItemDelete_Type )
processItemRemoval( ple->i_id ); processItemRemoval( ple->i_id );
else
rebuild();
} }
/**** Events processing ****/ /**** Events processing ****/
...@@ -1186,25 +1171,6 @@ void PLModel::popupSortDesc() ...@@ -1186,25 +1171,6 @@ void PLModel::popupSortDesc()
/********************************************************************** /**********************************************************************
* Playlist callbacks * 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, static int ItemDeleted( vlc_object_t *p_this, const char *psz_variable,
vlc_value_t oval, vlc_value_t nval, void *param ) vlc_value_t oval, vlc_value_t nval, void *param )
......
...@@ -54,7 +54,6 @@ enum { ...@@ -54,7 +54,6 @@ enum {
ItemUpdate_Type = QEvent::User + PLEventType + 2, ItemUpdate_Type = QEvent::User + PLEventType + 2,
ItemDelete_Type = QEvent::User + PLEventType + 3, ItemDelete_Type = QEvent::User + PLEventType + 3,
ItemAppend_Type = QEvent::User + PLEventType + 4, ItemAppend_Type = QEvent::User + PLEventType + 4,
PLUpdate_Type = QEvent::User + PLEventType + 5,
}; };
class PLEvent : public QEvent class PLEvent : public QEvent
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment