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

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


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

macosx: fix typo and set path for open dialog correctly
(cherry picked from commit e7353f4b55b81c270e5433e41e64f627fbd7012c)

Signed-off-by: David Fuhrmann <david.fuhrmann at googlemail.com>

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

 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