Commit f6d61f8b authored by François Cartegnie's avatar François Cartegnie 🤞

Qt: PLEvent: protect members

parent b2f19b19
......@@ -1029,19 +1029,19 @@ void MainInputManager::customEvent( QEvent *event )
{
case PLEvent::PLItemAppended_Type:
plEv = static_cast<PLEvent*>( event );
emit playlistItemAppended( plEv->i_item, plEv->i_parent );
emit playlistItemAppended( plEv->getItemId(), plEv->getParentId() );
return;
case PLEvent::PLItemRemoved_Type:
plEv = static_cast<PLEvent*>( event );
emit playlistItemRemoved( plEv->i_item );
emit playlistItemRemoved( plEv->getItemId() );
return;
case PLEvent::PLEmpty_Type:
plEv = static_cast<PLEvent*>( event );
emit playlistNotEmpty( plEv->i_item >= 0 );
emit playlistNotEmpty( plEv->getItemId() >= 0 );
return;
case PLEvent::LeafToParent_Type:
plEv = static_cast<PLEvent*>( event );
emit leafBecameParent( plEv->i_item );
emit leafBecameParent( plEv->getItemId() );
return;
default:
if( type != ItemChanged_Type ) return;
......
......@@ -110,7 +110,9 @@ public:
};
PLEvent( PLEventTypes t, int i, int p = 0 )
: QEvent( (QEvent::Type)(t) ), i_item(i), i_parent(p) {}
int getItemId() const { return i_item; };
int getParentId() const { return i_parent; };
private:
/* Needed for "playlist-item*" and "leaf-to-parent" callbacks
* !! Can be a input_item_t->i_id or a playlist_item_t->i_id */
int i_item;
......
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