+ /* FIXME: having this Rebuild() is dirty */
+ Rebuild( true );
+}
+
+#if wxUSE_DRAG_AND_DROP
+PlaylistFileDropTarget::PlaylistFileDropTarget( Playlist *p ):p( p ){}
+
+/********************************************************************
+ * File Drag And Drop handling
+ ********************************************************************/
+bool PlaylistFileDropTarget::OnDropFiles( wxCoord x, wxCoord y,
+ const wxArrayString& filenames )
+{
+ int i_pos = 0;
+ playlist_item_t *p_dest;
+
+ LockPlaylist( p->p_intf->p_sys, p->p_playlist );
+
+ /* find the destination node and position in that node */
+ const wxPoint pt( x, y );
+ wxTreeItemId item = p->treectrl->HitTest( pt );
+
+ if( !item.IsOk() )
+ {
+ /* We were droped below the last item so we append to the
+ * general node */
+ msg_Err( p->p_playlist, "USE OF P_GENERAL" );
+ p_dest = p->p_playlist->p_local_category;
+ i_pos = PLAYLIST_END;
+ }
+ else
+ {
+ PlaylistItem *p_plitem =
+ (PlaylistItem *)p->treectrl->GetItemData( item );
+ p_dest = playlist_ItemGetById( p->p_playlist, p_plitem->i_id, true );
+
+ if( p_dest->i_children == -1 )