From c15270d3b971fd90058bc1de43b8f170f7a15aef Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Thu, 16 Aug 2012 22:35:27 +0200 Subject: macosx_finder_args: fix file open order When files are double clicked or drag and dropped to the mplayer2 icon they can be in random order. This commit forces alphabetical order. Opening them with command + down arrow already worked correctly. --- osdep/macosx_finder_args.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'osdep') diff --git a/osdep/macosx_finder_args.m b/osdep/macosx_finder_args.m index fcdef4b494..56d314c100 100644 --- a/osdep/macosx_finder_args.m +++ b/osdep/macosx_finder_args.m @@ -36,8 +36,10 @@ bool psn_matches_current_process(char *psn_arg_to_check); @implementation FileOpenDelegate - (void)application:(NSApplication *)sender openFiles:(NSArray *)filenames { + NSArray *sorted_filenames = [filenames + sortedArrayUsingSelector:@selector(compare:)]; files = talloc_zero(NULL, struct playlist); - for (NSString *filename in filenames) + for (NSString *filename in sorted_filenames) playlist_add_file(files, [filename UTF8String]); [NSApp stop:nil]; // stop the runloop (give back control to mplayer2 code) } -- cgit v1.2.3