Commit c5db7205 authored by David Fuhrmann's avatar David Fuhrmann

macosx: add new pl items to the end if they are dropped to a node

parent c6abf403
......@@ -26,9 +26,14 @@
#import "playlist.h"
#import "StringUtility.h"
#ifdef HAVE_CONFIG_H
# import "config.h"
#endif
#include <assert.h>
#include <vlc_playlist.h>
#include <vlc_input_item.h>
#import <vlc_input.h>
#include <vlc_input.h>
#include <vlc_url.h>
#define TRACKNUM_COLUMN @"tracknumber"
......@@ -448,10 +453,6 @@
{
NSPasteboard *o_pasteboard = [info draggingPasteboard];
// this is no valid target, sanitize to top of table
if (index == NSOutlineViewDropOnItemIndex)
index = 0;
if (targetItem == nil) {
targetItem = _rootItem;
}
......@@ -498,6 +499,10 @@
pp_items[j++] = p_item;
}
// drop on a node itself will append entries at the end
if (index == NSOutlineViewDropOnItemIndex)
index = p_new_parent->i_children;
if (playlist_TreeMoveMany(p_playlist, j, pp_items, p_new_parent, index) != VLC_SUCCESS) {
PL_UNLOCK;
free(pp_items);
......@@ -565,6 +570,9 @@
[o_array addObject: o_dic];
}
// drop on a node itself will append entries at the end
static_assert(NSOutlineViewDropOnItemIndex == -1, "Expect NSOutlineViewDropOnItemIndex to be -1");
[_playlist addPlaylistItems:o_array withParentItemId:[targetItem plItemId] atPos:index startPlayback:NO];
return YES;
}
......
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