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

D&D fixes

parent 6a2febe5
...@@ -38,7 +38,6 @@ PLSelector::PLSelector( QWidget *p, intf_thread_t *_p_intf, ...@@ -38,7 +38,6 @@ PLSelector::PLSelector( QWidget *p, intf_thread_t *_p_intf,
view->header()->hide(); view->header()->hide();
view->setModel( model ); view->setModel( model );
view->setDragEnabled(true);
view->setAcceptDrops(true); view->setAcceptDrops(true);
view->setDropIndicatorShown(true); view->setDropIndicatorShown(true);
......
...@@ -498,6 +498,10 @@ int playlist_TreeMove( playlist_t * p_playlist, playlist_item_t *p_item, ...@@ -498,6 +498,10 @@ int playlist_TreeMove( playlist_t * p_playlist, playlist_item_t *p_item,
{ {
/* Fixme: avoid useless lookups but we need some clean helpers */ /* Fixme: avoid useless lookups but we need some clean helpers */
{ {
/* Fixme: if we try to move a node on a top-level node, it will
* fail because the node doesn't exist in onelevel and we will
* do some shit in onelevel. We should recursively move all items
* within the node */
playlist_item_t *p_node_onelevel; playlist_item_t *p_node_onelevel;
playlist_item_t *p_item_onelevel; playlist_item_t *p_item_onelevel;
p_node_onelevel = playlist_ItemFindFromInputAndRoot( p_playlist, p_node_onelevel = playlist_ItemFindFromInputAndRoot( p_playlist,
...@@ -508,6 +512,7 @@ int playlist_TreeMove( playlist_t * p_playlist, playlist_item_t *p_item, ...@@ -508,6 +512,7 @@ int playlist_TreeMove( playlist_t * p_playlist, playlist_item_t *p_item,
p_item->p_input->i_id, p_item->p_input->i_id,
p_playlist->p_root_onelevel, p_playlist->p_root_onelevel,
VLC_FALSE ); VLC_FALSE );
if( p_node_onelevel && p_item_onelevel )
TreeMove( p_playlist, p_item_onelevel, p_node_onelevel, 0 ); TreeMove( p_playlist, p_item_onelevel, p_node_onelevel, 0 );
} }
{ {
...@@ -521,6 +526,7 @@ int playlist_TreeMove( playlist_t * p_playlist, playlist_item_t *p_item, ...@@ -521,6 +526,7 @@ int playlist_TreeMove( playlist_t * p_playlist, playlist_item_t *p_item,
p_item->p_input->i_id, p_item->p_input->i_id,
p_playlist->p_root_category, p_playlist->p_root_category,
VLC_FALSE ); VLC_FALSE );
if( p_node_category && p_item_category )
TreeMove( p_playlist, p_item_category, p_node_category, 0 ); TreeMove( p_playlist, p_item_category, p_node_category, 0 );
} }
return VLC_SUCCESS; return VLC_SUCCESS;
......
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