Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
1c2af88f
Commit
1c2af88f
authored
Aug 22, 2012
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx/playlist: add another sanity check and simplify the code a bit
parent
cdd9eec9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
20 deletions
+10
-20
modules/gui/macosx/playlist.m
modules/gui/macosx/playlist.m
+10
-20
No files found.
modules/gui/macosx/playlist.m
View file @
1c2af88f
...
...
@@ -672,15 +672,14 @@
deleted. We don't do it when not required since this verification takes
quite a long time on big playlists (yes, pretty hacky). */
-
(
BOOL
)
isItem
:
(
playlist_item_t
*
)
p_item
inNode
:
(
playlist_item_t
*
)
p_node
checkItemExistence
:(
BOOL
)
b_check
locked
:(
BOOL
)
b_locked
-
(
BOOL
)
isItem
:
(
playlist_item_t
*
)
p_item
inNode
:
(
playlist_item_t
*
)
p_node
checkItemExistence
:(
BOOL
)
b_check
locked
:(
BOOL
)
b_locked
{
playlist_t
*
p_playlist
=
pl_Get
(
VLCIntf
);
playlist_item_t
*
p_temp_item
=
p_item
;
if
(
!
p_node
)
return
NO
;
if
(
p_node
==
p_item
)
return
YES
;
...
...
@@ -699,7 +698,8 @@
in the playlist. Any cleaner solution welcomed. */
for
(
i
=
0
;
i
<
p_playlist
->
all_items
.
i_size
;
i
++
)
{
if
(
ARRAY_VAL
(
p_playlist
->
all_items
,
i
)
==
p_item
)
break
;
if
(
ARRAY_VAL
(
p_playlist
->
all_items
,
i
)
==
p_item
)
break
;
else
if
(
i
==
p_playlist
->
all_items
.
i_size
-
1
)
{
if
(
!
b_locked
)
PL_UNLOCK
;
...
...
@@ -722,13 +722,6 @@
return
NO
;
}
-
(
BOOL
)
isItem
:
(
playlist_item_t
*
)
p_item
inNode
:
(
playlist_item_t
*
)
p_node
checkItemExistence
:(
BOOL
)
b_check
{
return
[
self
isItem
:
p_item
inNode
:
p_node
checkItemExistence
:
b_check
locked
:
NO
];
}
/* This method is useful for instance to remove the selected children of an
already selected node */
-
(
void
)
removeItemsFrom
:(
id
)
o_items
ifChildrenOf
:(
id
)
o_nodes
...
...
@@ -1459,8 +1452,7 @@
o_playing_item
=
[
o_outline_dict
objectForKey
:
[
NSString
stringWithFormat
:
@"%p"
,
playlist_CurrentPlayingItem
(
p_playlist
)]];
PL_UNLOCK
;
if
(
[
self
isItem
:
[
o_playing_item
pointerValue
]
inNode
:
[
item
pointerValue
]
checkItemExistence
:
YES
]
if
(
[
self
isItem
:
[
o_playing_item
pointerValue
]
inNode
:
[
item
pointerValue
]
checkItemExistence
:
YES
locked
:
NO
]
||
[
o_playing_item
isEqual
:
item
]
)
{
[
cell
setFont
:
[[
NSFontManager
sharedFontManager
]
convertFont
:[
cell
font
]
toHaveTrait
:
NSBoldFontMask
]];
...
...
@@ -1604,8 +1596,8 @@
/* We refuse to drop an item in anything else than a child of the General
Node. We still accept items that would be root nodes of the outlineview
however, to allow drop in an empty playlist. */
if
(
!
(
([
self
isItem
:
[
item
pointerValue
]
inNode
:
p_playlist
->
p_local_category
checkItemExistence
:
NO
]
||
(
var_CreateGetBool
(
p_playlist
,
"media-library"
)
&&
[
self
isItem
:
[
item
pointerValue
]
inNode
:
p_playlist
->
p_ml_category
checkItemExistence
:
NO
]
)
)
||
item
==
nil
)
)
if
(
!
(
([
self
isItem
:
[
item
pointerValue
]
inNode
:
p_playlist
->
p_local_category
checkItemExistence
:
NO
locked
:
NO
]
||
(
var_CreateGetBool
(
p_playlist
,
"media-library"
)
&&
[
self
isItem
:
[
item
pointerValue
]
inNode
:
p_playlist
->
p_ml_category
checkItemExistence
:
NO
locked
:
NO
]
)
)
||
item
==
nil
)
)
{
return
NSDragOperationNone
;
}
...
...
@@ -1617,9 +1609,7 @@
for
(
NSUInteger
i
=
0
;
i
<
count
;
i
++
)
{
/* We refuse to Drop in a child of an item we are moving */
if
(
[
self
isItem
:
[
item
pointerValue
]
inNode
:
[[
o_nodes_array
objectAtIndex
:
i
]
pointerValue
]
checkItemExistence:
NO
]
)
if
(
[
self
isItem
:
[
item
pointerValue
]
inNode
:
[[
o_nodes_array
objectAtIndex
:
i
]
pointerValue
]
checkItemExistence
:
NO
locked
:
NO
]
)
{
return
NSDragOperationNone
;
}
...
...
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