Commit a7de3a62 authored by Erwan Tulou's avatar Erwan Tulou Committed by Jean-Baptiste Kempf

skins2: fix vlc sometimes crashing with drag'n'drop.

This fixes #6599
(cherry picked from commit 15b1a1b9)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 2da9586d
...@@ -513,7 +513,8 @@ void CtrlTree::handleEvent( EvtGeneric &rEvent ) ...@@ -513,7 +513,8 @@ void CtrlTree::handleEvent( EvtGeneric &rEvent )
{ {
EvtDragDrop& evt = static_cast<EvtDragDrop&>(rEvent); EvtDragDrop& evt = static_cast<EvtDragDrop&>(rEvent);
Playtree& rPlaytree = static_cast<Playtree&>(m_rTree); Playtree& rPlaytree = static_cast<Playtree&>(m_rTree);
rPlaytree.insertItems( *m_itOver, evt.getFiles(), false ); VarTree& item = ( m_itOver != m_rTree.end() ) ? *m_itOver : m_rTree;
rPlaytree.insertItems( item, evt.getFiles(), false );
m_itOver = m_rTree.end(); m_itOver = m_rTree.end();
needRefresh = true; needRefresh = true;
} }
......
...@@ -280,15 +280,29 @@ void Playtree::insertItems( VarTree& elem, const list<string>& files, bool start ...@@ -280,15 +280,29 @@ void Playtree::insertItems( VarTree& elem, const list<string>& files, bool start
playlist_Lock( m_pPlaylist ); playlist_Lock( m_pPlaylist );
if( p_elem == this )
{
for( Iterator it = m_children.begin(); it != m_children.end(); ++it )
{
if( it->getId() == m_pPlaylist->p_local_category->i_id )
{
p_elem = &*it;
break;
}
}
}
if( p_elem->getId() == m_pPlaylist->p_local_category->i_id ) if( p_elem->getId() == m_pPlaylist->p_local_category->i_id )
{ {
p_node = m_pPlaylist->p_local_category; p_node = m_pPlaylist->p_local_category;
i_pos = 0; i_pos = 0;
p_elem->setExpanded( true );
} }
else if( p_elem->getId() == m_pPlaylist->p_ml_category->i_id ) else if( p_elem->getId() == m_pPlaylist->p_ml_category->i_id )
{ {
p_node = m_pPlaylist->p_ml_category; p_node = m_pPlaylist->p_ml_category;
i_pos = 0; i_pos = 0;
p_elem->setExpanded( true );
} }
else if( p_elem->size() && p_elem->isExpanded() ) else if( p_elem->size() && p_elem->isExpanded() )
{ {
......
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