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
ef6c3bbb
Commit
ef6c3bbb
authored
Jan 02, 2015
by
David Fuhrmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
macosx: simplify revealInFinder action
parent
8afbec28
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
21 deletions
+13
-21
modules/gui/macosx/playlist.m
modules/gui/macosx/playlist.m
+13
-21
No files found.
modules/gui/macosx/playlist.m
View file @
ef6c3bbb
...
@@ -487,32 +487,24 @@
...
@@ -487,32 +487,24 @@
-
(
IBAction
)
revealItemInFinder
:(
id
)
sender
-
(
IBAction
)
revealItemInFinder
:(
id
)
sender
{
{
NSIndexSet
*
selectedRows
=
[
o_outline_view
selectedRowIndexes
];
NSIndexSet
*
selectedRows
=
[
o_outline_view
selectedRowIndexes
];
NSUInteger
count
=
[
selectedRows
count
];
[
selectedRows
enumerateIndexesUsingBlock
:
^
(
NSUInteger
idx
,
BOOL
*
stop
)
{
NSUInteger
indexes
[
count
];
[
selectedRows
getIndexes
:
indexes
maxCount
:
count
inIndexRange
:
nil
];
NSMutableString
*
o_mrl
;
PLItem
*
o_item
=
[
o_outline_view
itemAtRow
:
idx
];
for
(
NSUInteger
i
=
0
;
i
<
count
;
i
++
)
{
PLItem
*
o_item
=
[
o_outline_view
itemAtRow
:
indexes
[
i
]];
char
*
psz_url
=
decode_URI
(
input_item_GetURI
([
o_item
input
]));
o_mrl
=
[[
NSMutableString
alloc
]
initWithString
:
[
NSString
stringWithUTF8String
:
psz_url
?
psz_url
:
""
]];
if
(
psz_url
!=
NULL
)
free
(
psz_url
);
/* perform some checks whether it is a file and if it is local at all... */
/* perform some checks whether it is a file and if it is local at all... */
if
([
o_mrl
length
]
>
0
)
{
char
*
psz_url
=
input_item_GetURI
([
o_item
input
]);
NSRange
prefix_range
=
[
o_mrl
rangeOfString
:
@"file:"
];
NSURL
*
url
=
[
NSURL
URLWithString
:
toNSStr
(
psz_url
)];
if
(
prefix_range
.
location
!=
NSNotFound
)
free
(
psz_url
);
[
o_mrl
deleteCharactersInRange
:
prefix_range
];
if
(
!
[
url
isFileURL
])
return
;
if
(
!
[[
NSFileManager
defaultManager
]
fileExistsAtPath
:[
url
path
]])
return
;
if
([
o_mrl
characterAtIndex
:
0
]
==
'/'
)
msg_Dbg
(
VLCIntf
,
"Reveal url %s in finder"
,
[[
url
path
]
UTF8String
]);
[[
NSWorkspace
sharedWorkspace
]
selectFile
:
o_mrl
inFileViewerRootedAtPath
:
o_mrl
];
[[
NSWorkspace
sharedWorkspace
]
selectFile
:
[
url
path
]
inFileViewerRootedAtPath
:
[
url
path
]
];
}
}];
[
o_mrl
release
];
}
}
}
/* When called retrieves the selected outlineview row and plays that node or item */
/* When called retrieves the selected outlineview row and plays that node or item */
...
...
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