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 @@
...
@@ -672,15 +672,14 @@
deleted. We don't do it when not required since this verification takes
deleted. We don't do it when not required since this verification takes
quite a long time on big playlists (yes, pretty hacky). */
quite a long time on big playlists (yes, pretty hacky). */
-
(
BOOL
)
isItem
:
(
playlist_item_t
*
)
p_item
-
(
BOOL
)
isItem
:
(
playlist_item_t
*
)
p_item
inNode
:
(
playlist_item_t
*
)
p_node
checkItemExistence
:(
BOOL
)
b_check
locked
:(
BOOL
)
b_locked
inNode
:
(
playlist_item_t
*
)
p_node
checkItemExistence
:(
BOOL
)
b_check
locked
:(
BOOL
)
b_locked
{
{
playlist_t
*
p_playlist
=
pl_Get
(
VLCIntf
);
playlist_t
*
p_playlist
=
pl_Get
(
VLCIntf
);
playlist_item_t
*
p_temp_item
=
p_item
;
playlist_item_t
*
p_temp_item
=
p_item
;
if
(
!
p_node
)
return
NO
;
if
(
p_node
==
p_item
)
if
(
p_node
==
p_item
)
return
YES
;
return
YES
;
...
@@ -699,7 +698,8 @@
...
@@ -699,7 +698,8 @@
in the playlist. Any cleaner solution welcomed. */
in the playlist. Any cleaner solution welcomed. */
for
(
i
=
0
;
i
<
p_playlist
->
all_items
.
i_size
;
i
++
)
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
)
else
if
(
i
==
p_playlist
->
all_items
.
i_size
-
1
)
{
{
if
(
!
b_locked
)
PL_UNLOCK
;
if
(
!
b_locked
)
PL_UNLOCK
;
...
@@ -722,13 +722,6 @@
...
@@ -722,13 +722,6 @@
return
NO
;
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
/* This method is useful for instance to remove the selected children of an
already selected node */
already selected node */
-
(
void
)
removeItemsFrom
:(
id
)
o_items
ifChildrenOf
:(
id
)
o_nodes
-
(
void
)
removeItemsFrom
:(
id
)
o_items
ifChildrenOf
:(
id
)
o_nodes
...
@@ -1459,8 +1452,7 @@
...
@@ -1459,8 +1452,7 @@
o_playing_item
=
[
o_outline_dict
objectForKey
:
[
NSString
stringWithFormat
:
@"%p"
,
playlist_CurrentPlayingItem
(
p_playlist
)]];
o_playing_item
=
[
o_outline_dict
objectForKey
:
[
NSString
stringWithFormat
:
@"%p"
,
playlist_CurrentPlayingItem
(
p_playlist
)]];
PL_UNLOCK
;
PL_UNLOCK
;
if
(
[
self
isItem
:
[
o_playing_item
pointerValue
]
inNode
:
if
(
[
self
isItem
:
[
o_playing_item
pointerValue
]
inNode
:
[
item
pointerValue
]
checkItemExistence
:
YES
locked
:
NO
]
[
item
pointerValue
]
checkItemExistence
:
YES
]
||
[
o_playing_item
isEqual
:
item
]
)
||
[
o_playing_item
isEqual
:
item
]
)
{
{
[
cell
setFont
:
[[
NSFontManager
sharedFontManager
]
convertFont
:[
cell
font
]
toHaveTrait
:
NSBoldFontMask
]];
[
cell
setFont
:
[[
NSFontManager
sharedFontManager
]
convertFont
:[
cell
font
]
toHaveTrait
:
NSBoldFontMask
]];
...
@@ -1604,8 +1596,8 @@
...
@@ -1604,8 +1596,8 @@
/* We refuse to drop an item in anything else than a child of the General
/* 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
Node. We still accept items that would be root nodes of the outlineview
however, to allow drop in an empty playlist. */
however, to allow drop in an empty playlist. */
if
(
!
(
([
self
isItem
:
[
item
pointerValue
]
inNode
:
p_playlist
->
p_local_category
checkItemExistence
:
NO
]
||
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
]
)
)
||
item
==
nil
)
)
(
var_CreateGetBool
(
p_playlist
,
"media-library"
)
&&
[
self
isItem
:
[
item
pointerValue
]
inNode
:
p_playlist
->
p_ml_category
checkItemExistence
:
NO
locked
:
NO
]
)
)
||
item
==
nil
)
)
{
{
return
NSDragOperationNone
;
return
NSDragOperationNone
;
}
}
...
@@ -1617,9 +1609,7 @@
...
@@ -1617,9 +1609,7 @@
for
(
NSUInteger
i
=
0
;
i
<
count
;
i
++
)
for
(
NSUInteger
i
=
0
;
i
<
count
;
i
++
)
{
{
/* We refuse to Drop in a child of an item we are moving */
/* We refuse to Drop in a child of an item we are moving */
if
(
[
self
isItem
:
[
item
pointerValue
]
inNode
:
if
(
[
self
isItem
:
[
item
pointerValue
]
inNode
:
[[
o_nodes_array
objectAtIndex
:
i
]
pointerValue
]
checkItemExistence
:
NO
locked
:
NO
]
)
[[
o_nodes_array
objectAtIndex
:
i
]
pointerValue
]
checkItemExistence:
NO
]
)
{
{
return
NSDragOperationNone
;
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