[vlc-commits] macosx: fix typo and set path for open dialog correctly

David Fuhrmann git at videolan.org
Sun Nov 10 12:10:26 CET 2013


vlc | branch: master | David Fuhrmann <david.fuhrmann at googlemail.com> | Sun Nov 10 11:11:39 2013 +0100| [e7353f4b55b81c270e5433e41e64f627fbd7012c] | committer: David Fuhrmann

macosx: fix typo and set path for open dialog correctly

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e7353f4b55b81c270e5433e41e64f627fbd7012c
---

 modules/gui/macosx/MainMenu.m |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/modules/gui/macosx/MainMenu.m b/modules/gui/macosx/MainMenu.m
index fba4a6c..ab90e38 100644
--- a/modules/gui/macosx/MainMenu.m
+++ b/modules/gui/macosx/MainMenu.m
@@ -925,6 +925,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
     }
 
     char *path = input_item_GetURI(p_item);
+
     if (!path)
         path = strdup("");
 
@@ -932,11 +933,16 @@ static VLCMainMenu *_o_sharedInstance = nil;
     [openPanel setCanChooseFiles: YES];
     [openPanel setCanChooseDirectories: NO];
     [openPanel setAllowsMultipleSelection: YES];
-    [openPanel setAllowedFileTypes: [NSArray arrayWithObjects:@"cdg",@"@idx",@"srt",@"sub",@"utf",@"ass",@"ssa",@"aqt",@"jss",@"psb",@"rt",@"smi",@"txt",@"smil",nil]];
-    [openPanel setDirectoryURL:[NSURL fileURLWithPath:[[NSString stringWithUTF8String:path] stringByExpandingTildeInPath]]];
-    i_returnValue = [openPanel runModal];
+
+    [openPanel setAllowedFileTypes: [NSArray arrayWithObjects:@"cdg",@"idx",@"srt",@"sub",@"utf",@"ass",@"ssa",@"aqt",@"jss",@"psb",@"rt",@"smi",@"txt",@"smil",nil]];
+
+    NSURL *o_url = [NSURL URLWithString:[[NSString stringWithUTF8String:path] stringByExpandingTildeInPath]];
+    o_url = [o_url URLByDeletingLastPathComponent];
+    [openPanel setDirectoryURL: o_url];
     free(path);
 
+    i_returnValue = [openPanel runModal];
+
     if (i_returnValue == NSOKButton) {
         NSUInteger c = 0;
         if (!p_input)



More information about the vlc-commits mailing list