Commit ebc698a5 authored by Clément Stenac's avatar Clément Stenac

Check type before cast

parent 0c5b1abc
...@@ -311,11 +311,16 @@ PLItem * PLModel::FindInner( PLItem *root, int i_id, bool b_input ) ...@@ -311,11 +311,16 @@ PLItem * PLModel::FindInner( PLItem *root, int i_id, bool b_input )
/************************* Updates handling *****************************/ /************************* Updates handling *****************************/
void PLModel::customEvent( QEvent *event ) void PLModel::customEvent( QEvent *event )
{ {
int type = event->type();
if( type != ItemUpdate_Type && type != ItemAppend_Type &&
type != ItemDelete_Type )
return;
PLEvent *ple = static_cast<PLEvent *>(event); PLEvent *ple = static_cast<PLEvent *>(event);
if( event->type() == ItemUpdate_Type ) if( type == ItemUpdate_Type )
ProcessInputItemUpdate( ple->i_id ); ProcessInputItemUpdate( ple->i_id );
else if( event->type() == ItemAppend_Type ) else if( type == ItemAppend_Type )
ProcessItemAppend( ple->p_add ); ProcessItemAppend( ple->p_add );
else else
ProcessItemRemoval( ple->i_id ); ProcessItemRemoval( ple->i_id );
......
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