diff options
author | 2010-04-04 13:32:15 +0200 | |
---|---|---|
committer | 2010-04-04 13:32:15 +0200 | |
commit | 3e353f8d1a41585b4715eaf0dfeed057b8a23b15 (patch) | |
tree | c651c2443efaa6004c0ab19c56aefe2961c8d1b0 /plugins/gtkui/mainplaylist.c | |
parent | 1af02622022d9100b302c7dd7e8bc08793bead38 (diff) |
implemented dragndrop between different playlists
Diffstat (limited to 'plugins/gtkui/mainplaylist.c')
-rw-r--r-- | plugins/gtkui/mainplaylist.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/plugins/gtkui/mainplaylist.c b/plugins/gtkui/mainplaylist.c index 1815d0aa..4e8ddd93 100644 --- a/plugins/gtkui/mainplaylist.c +++ b/plugins/gtkui/mainplaylist.c @@ -98,8 +98,16 @@ int main_get_idx (DdbListviewIter it) { return idx; } -void main_drag_n_drop (DdbListviewIter before, uint32_t *indices, int length) { - deadbeef->pl_move_items (PL_MAIN, (DB_playItem_t *)before, indices, length); +void main_drag_n_drop (DdbListviewIter before, int playlist, uint32_t *indices, int length) { + deadbeef->plt_lock (); + int curr = deadbeef->plt_get_curr (); + if (playlist == curr) { + deadbeef->pl_move_items (PL_MAIN, (DB_playItem_t *)before, indices, length); + } + else { + deadbeef->pl_copy_items (PL_MAIN, playlist, (DB_playItem_t *)before, indices, length); + } + deadbeef->plt_unlock (); } void main_external_drag_n_drop (DdbListviewIter before, char *mem, int length) { |