Commit 5fe636f6 authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: stop using NTableVieew's selectedRowEnumerator since it was deprecated in 10.3 ...

parent be6c6aa1
...@@ -825,67 +825,53 @@ ...@@ -825,67 +825,53 @@
- (IBAction)preparseItem:(id)sender - (IBAction)preparseItem:(id)sender
{ {
int i_count; int i_count;
NSMutableArray *o_to_preparse; NSIndexSet *o_selected_indexes;
intf_thread_t * p_intf = VLCIntf; intf_thread_t * p_intf = VLCIntf;
playlist_t * p_playlist = pl_Get( p_intf ); playlist_t * p_playlist = pl_Get( p_intf );
o_to_preparse = [NSMutableArray arrayWithArray:[[o_outline_view selectedRowEnumerator] allObjects]];
i_count = [o_to_preparse count];
int i, i_row;
NSNumber *o_number;
playlist_item_t *p_item = NULL; playlist_item_t *p_item = NULL;
for( i = 0; i < i_count; i++ ) o_selected_indexes = [o_outline_view selectedRowIndexes];
i_count = [o_selected_indexes count];
NSUInteger indexes[i_count];
[o_selected_indexes getIndexes:indexes maxCount:i_count inIndexRange:nil];
for (int i = 0; i < i_count; i++)
{ {
o_number = [o_to_preparse lastObject]; p_item = [[o_outline_view itemAtRow:indexes[i]] pointerValue];
i_row = [o_number intValue]; [o_outline_view deselectRow: indexes[i]];
p_item = [[o_outline_view itemAtRow:i_row] pointerValue];
[o_to_preparse removeObject: o_number];
[o_outline_view deselectRow: i_row];
if( p_item ) if( p_item )
{ {
if( p_item->i_children == -1 ) if( p_item->i_children == -1 )
{
playlist_PreparseEnqueue( p_playlist, p_item->p_input ); playlist_PreparseEnqueue( p_playlist, p_item->p_input );
}
else else
{
msg_Dbg( p_intf, "preparsing nodes not implemented" ); msg_Dbg( p_intf, "preparsing nodes not implemented" );
} }
} }
}
[self playlistUpdated]; [self playlistUpdated];
} }
- (IBAction)downloadCoverArt:(id)sender - (IBAction)downloadCoverArt:(id)sender
{ {
int i_count; int i_count;
NSMutableArray *o_to_preparse; NSIndexSet *o_selected_indexes;
intf_thread_t * p_intf = VLCIntf; intf_thread_t * p_intf = VLCIntf;
playlist_t * p_playlist = pl_Get( p_intf ); playlist_t * p_playlist = pl_Get( p_intf );
o_to_preparse = [NSMutableArray arrayWithArray:[[o_outline_view selectedRowEnumerator] allObjects]];
i_count = [o_to_preparse count];
int i, i_row;
NSNumber *o_number;
playlist_item_t *p_item = NULL; playlist_item_t *p_item = NULL;
for( i = 0; i < i_count; i++ ) o_selected_indexes = [o_outline_view selectedRowIndexes];
i_count = [o_selected_indexes count];
NSUInteger indexes[i_count];
[o_selected_indexes getIndexes:indexes maxCount:i_count inIndexRange:nil];
for (int i = 0; i < i_count; i++)
{ {
o_number = [o_to_preparse lastObject]; p_item = [[o_outline_view itemAtRow: indexes[i]] pointerValue];
i_row = [o_number intValue]; [o_outline_view deselectRow: indexes[i]];
p_item = [[o_outline_view itemAtRow:i_row] pointerValue];
[o_to_preparse removeObject: o_number];
[o_outline_view deselectRow: i_row];
if( p_item && p_item->i_children == -1 ) if( p_item && p_item->i_children == -1 )
{
playlist_AskForArtEnqueue( p_playlist, p_item->p_input ); playlist_AskForArtEnqueue( p_playlist, p_item->p_input );
} }
}
[self playlistUpdated]; [self playlistUpdated];
} }
...@@ -913,24 +899,22 @@ ...@@ -913,24 +899,22 @@
- (IBAction)deleteItem:(id)sender - (IBAction)deleteItem:(id)sender
{ {
int i_count, i_row; int i_count;
NSMutableArray *o_to_delete; NSIndexSet *o_selected_indexes;
NSNumber *o_number;
playlist_t * p_playlist; playlist_t * p_playlist;
intf_thread_t * p_intf = VLCIntf; intf_thread_t * p_intf = VLCIntf;
o_to_delete = [NSMutableArray arrayWithArray:[[o_outline_view selectedRowEnumerator] allObjects]]; o_selected_indexes = [o_outline_view selectedRowIndexes];
i_count = [o_to_delete count]; i_count = [o_selected_indexes count];
p_playlist = pl_Get( p_intf ); p_playlist = pl_Get( p_intf );
for( int i = 0; i < i_count; i++ ) NSUInteger indexes[i_count];
[o_selected_indexes getIndexes:indexes maxCount:i_count inIndexRange:nil];
for (int i = 0; i < i_count; i++)
{ {
o_number = [o_to_delete lastObject]; id o_item = [o_outline_view itemAtRow: indexes[i]];
i_row = [o_number intValue]; [o_outline_view deselectRow: indexes[i]];
id o_item = [o_outline_view itemAtRow: i_row];
[o_outline_view deselectRow: i_row];
PL_LOCK; PL_LOCK;
playlist_item_t *p_item = [o_item pointerValue]; playlist_item_t *p_item = [o_item pointerValue];
...@@ -938,14 +922,12 @@ ...@@ -938,14 +922,12 @@
msg_Dbg( p_intf, "deleting item %i (of %i) with id \"%i\", pointerValue \"%p\" and %i children", i+1, i_count, msg_Dbg( p_intf, "deleting item %i (of %i) with id \"%i\", pointerValue \"%p\" and %i children", i+1, i_count,
p_item->p_input->i_id, [o_item pointerValue], p_item->i_children +1 ); p_item->p_input->i_id, [o_item pointerValue], p_item->i_children +1 );
#endif #endif
[o_to_delete removeObject: o_number];
if( p_item->i_children != -1 ) if( p_item->i_children != -1 )
//is a node and not an item //is a node and not an item
{ {
if( playlist_Status( p_playlist ) != PLAYLIST_STOPPED && if( playlist_Status( p_playlist ) != PLAYLIST_STOPPED &&
[self isItem: playlist_CurrentPlayingItem( p_playlist ) inNode: [self isItem: playlist_CurrentPlayingItem( p_playlist ) inNode: ((playlist_item_t *)[o_item pointerValue])
((playlist_item_t *)[o_item pointerValue])
checkItemExistence: NO locked:YES] == YES ) checkItemExistence: NO locked:YES] == YES )
// if current item is in selected node and is playing then stop playlist // if current item is in selected node and is playing then stop playlist
playlist_Control(p_playlist, PLAYLIST_STOP, pl_Locked ); playlist_Control(p_playlist, PLAYLIST_STOP, pl_Locked );
...@@ -956,8 +938,7 @@ ...@@ -956,8 +938,7 @@
playlist_DeleteFromInput( p_playlist, p_item->p_input, pl_Locked ); playlist_DeleteFromInput( p_playlist, p_item->p_input, pl_Locked );
PL_UNLOCK; PL_UNLOCK;
[o_outline_dict removeObjectForKey:[NSString stringWithFormat:@"%p", [o_outline_dict removeObjectForKey:[NSString stringWithFormat:@"%p", [o_item pointerValue]]];
[o_item pointerValue]]];
[o_item release]; [o_item release];
} }
......
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