if( type == ItemUpdate_Type )
ProcessInputItemUpdate( ple->i_id );
else if( type == ItemAppend_Type )
- ProcessItemAppend( ple->p_add );
+ ProcessItemAppend( &ple->add );
else if( type == ItemDelete_Type )
ProcessItemRemoval( ple->i_id );
else
removeItem( i_id );
}
-void PLModel::ProcessItemAppend( playlist_add_t *p_add )
+void PLModel::ProcessItemAppend( const playlist_add_t *p_add )
{
playlist_item_t *p_item = NULL;
PLItem *newItem = NULL;
vlc_value_t oval, vlc_value_t nval, void *param )
{
PLModel *p_model = (PLModel *) param;
- playlist_add_t *p_add = (playlist_add_t *)malloc( sizeof( playlist_add_t));
- memcpy( p_add, nval.p_address, sizeof( playlist_add_t ) );
-
+ const playlist_add_t *p_add = (playlist_add_t *)nval.p_address;
PLEvent *event = new PLEvent( p_add );
QApplication::postEvent( p_model, event );
return VLC_SUCCESS;
{
public:
PLEvent( int type, int id ) : QEvent( (QEvent::Type)(type) )
- { i_id = id; p_add = NULL; };
+ {
+ i_id = id;
+ add.i_node = -1;
+ add.i_item = -1;
+ };
- PLEvent( playlist_add_t *a ) : QEvent( (QEvent::Type)(ItemAppend_Type) )
- { p_add = a; };
+ PLEvent( const playlist_add_t *a ) : QEvent( (QEvent::Type)(ItemAppend_Type) )
+ {
+ add = *a;
+ };
- virtual ~PLEvent() { free( p_add ); };
+ virtual ~PLEvent() { };
int i_id;
- playlist_add_t *p_add;
+ playlist_add_t add;
};
/* Update processing */
void ProcessInputItemUpdate( int i_input_id );
void ProcessItemRemoval( int i_id );
- void ProcessItemAppend( playlist_add_t *p_add );
+ void ProcessItemAppend( const playlist_add_t *p_add );
void UpdateTreeItem( PLItem *, bool, bool force = false );
void UpdateTreeItem( playlist_item_t *, PLItem *, bool, bool forc = false );