Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
07e7944d
Commit
07e7944d
authored
Mar 07, 2015
by
David Fuhrmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: playlist: simplify deletion code
parent
69731466
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
38 deletions
+19
-38
modules/gui/macosx/intf.m
modules/gui/macosx/intf.m
+1
-0
modules/gui/macosx/playlist.h
modules/gui/macosx/playlist.h
+3
-0
modules/gui/macosx/playlist.m
modules/gui/macosx/playlist.m
+15
-38
No files found.
modules/gui/macosx/intf.m
View file @
07e7944d
...
...
@@ -1324,6 +1324,7 @@ static bool f_appExit = false;
int
i_item
=
[
o_val
intValue
];
[[[
self
playlist
]
model
]
removeItem
:
i_item
];
[[
self
playlist
]
deletionCompleted
];
}
...
...
modules/gui/macosx/playlist.h
View file @
07e7944d
...
...
@@ -96,6 +96,9 @@
-
(
BOOL
)
isSelectionEmpty
;
-
(
void
)
deletionCompleted
;
-
(
IBAction
)
playItem
:(
id
)
sender
;
-
(
IBAction
)
revealItemInFinder
:(
id
)
sender
;
-
(
IBAction
)
preparseItem
:(
id
)
sender
;
...
...
modules/gui/macosx/playlist.m
View file @
07e7944d
...
...
@@ -562,56 +562,33 @@
[[[
VLCMain
sharedInstance
]
info
]
initPanel
];
}
-
(
void
)
deletionCompleted
{
// retain selection before deletion
[
o_outline_view
selectRowIndexes
:[
NSIndexSet
indexSetWithIndex
:
retainedRowSelection
]
byExtendingSelection
:
NO
];
}
-
(
IBAction
)
deleteItem
:(
id
)
sender
{
int
i_count
;
NSIndexSet
*
o_selected_indexes
;
intf_thread_t
*
p_intf
=
VLCIntf
;
playlist_t
*
p_playlist
=
pl_Get
(
p_intf
);
playlist_t
*
p_playlist
=
pl_Get
(
VLCIntf
);
// check if deletion is allowed
if
(
!
[[
self
model
]
editAllowed
])
return
;
o_selected_indexes
=
[
o_outline_view
selectedRowIndexes
];
i_count
=
[
o_selected_indexes
count
];
NSIndexSet
*
o_selected_indexes
=
[
o_outline_view
selectedRowIndexes
];
retainedRowSelection
=
[
o_selected_indexes
firstIndex
];
if
(
retainedRowSelection
==
NSNotFound
)
retainedRowSelection
=
0
;
[
o_selected_indexes
enumerateIndexesUsingBlock
:
^
(
NSUInteger
idx
,
BOOL
*
stop
)
{
PLItem
*
o_item
=
[
o_outline_view
itemAtRow
:
idx
];
if
(
!
o_item
)
return
;
NSUInteger
indexes
[
i_count
];
// if (i_count == [o_outline_view numberOfRows]) {
// PL_LOCK;
// playlist_NodeDelete(p_playlist, [self currentPlaylistRoot], true, false);
// PL_UNLOCK;
// [self playlistUpdated];
// return;
// }
[
o_selected_indexes
getIndexes
:
indexes
maxCount
:
i_count
inIndexRange
:
nil
];
for
(
int
i
=
0
;
i
<
i_count
;
i
++
)
{
PLItem
*
o_item
=
[
o_outline_view
itemAtRow
:
indexes
[
i
]];
[
o_outline_view
deselectRow
:
indexes
[
i
]];
/// TODO
// if (p_item->i_children != -1) {
// //is a node and not an item
// if (playlist_Status(p_playlist) != PLAYLIST_STOPPED &&
// [self isItem: playlist_CurrentPlayingItem(p_playlist) inNode: ((playlist_item_t *)[o_item pointerValue])
// checkItemExistence: NO locked:YES] == YES)
// // if current item is in selected node and is playing then stop playlist
// playlist_Control(p_playlist, PLAYLIST_STOP, pl_Locked);
//
// playlist_NodeDelete(p_playlist, p_item, true, false);
// } else
playlist_DeleteFromInput
(
p_playlist
,
[
o_item
input
],
pl_Unlocked
);
// [[o_item parent] deleteChild:o_item];
//
// [o_outline_view reloadData];
}
// [self playlistUpdated];
// model deletion is done via callback
playlist_DeleteFromInput
(
p_playlist
,
[
o_item
input
],
pl_Unlocked
);
}];
}
-
(
IBAction
)
sortNodeByName
:(
id
)
sender
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment