[vlc-devel] [vlc-commits] macosx: work-around for Mountain Lion which treats folder with the name ' BDMV' and the sub item 'INDEX.BDM' as a file with the UTI 'public.directory '
Felix Paul Kühne
fkuehne.videolan at gmail.com
Tue Feb 5 19:42:19 CET 2013
On 05.02.2013, at 19:17, David Fuhrmann <david.fuhrmann at gmail.com> wrote:
> Am 05.02.2013 um 01:00 schrieb Felix Paul Kühne <git at videolan.org>:
>> vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Tue Feb 5 01:00:46 2013 +0100| [79c8560a5e36d6f872a740aeeb6a62c8069c3eae] | committer: Felix Paul Kühne
>> macosx: work-around for Mountain Lion which treats folder with the name 'BDMV' and the sub item 'INDEX.BDM' as a file with the UTI 'public.directory'
>> modules/gui/macosx/open.m | 6 +++++-
>> 1 file changed, 5 insertions(+), 1 deletion(-)
>> diff --git a/modules/gui/macosx/open.m b/modules/gui/macosx/open.m
>> index 77a18ff..ccb8d9d 100644
>> --- a/modules/gui/macosx/open.m
>> +++ b/modules/gui/macosx/open.m
>> @@ -1097,11 +1097,15 @@ static VLCOpen *_o_sharedMainInstance = nil;
>> NSOpenPanel *o_open_panel = [NSOpenPanel openPanel];
>> [o_open_panel setAllowsMultipleSelection: NO];
>> - [o_open_panel setCanChooseFiles: NO];
>> [o_open_panel setCanChooseDirectories: YES];
>> [o_open_panel setTitle: [sender title]];
>> [o_open_panel setPrompt: _NS("Open")];
>> + /* work-around for Mountain Lion, which treats folders called "BDMV" including an item named "INDEX.BDM"
>> + * as a _FILE_. Don't ask, move on. There is nothing to see here */
> This also allows to open dvd packages / folders with the extension .dvdmedia with this dialog, and this this totally legitimate.
Yep, this is actually intentional.
> But on the other side, you can also open every other bundle now, such as applications.
Correct, but this what you can do with the ordinary Open File dialog since like ever, since we don't block any file type but let the user choose whatever s/he likes.
> But I suppose that they is no better solution to just allow the right packages and not all types?
Not really, since BDMV folders are treated in Mountain Lion as public.directory (note that this is different from public.folder) and as public.item, but there is no further UTI available to limit the selection. We could file a radar:// on this, but I strongly doubt that this would change the situation.
Anyway, if a user chooses to try to open an application or other file bundle using this very dialog, VLC will either complain that this is no valid DVD / BDMV folder or it will try to play the bundle contents, so certain imagery might be displayed but that's pretty much it. So, nothing dangerous will happen, so I'm ok and I hope that you are, too.
More information about the vlc-devel