summaryrefslogtreecommitdiffstats
path: root/osdep
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2012-08-16 22:35:27 +0200
committerStefano Pigozzi <stefano.pigozzi@gmail.com>2012-08-16 22:35:27 +0200
commitc15270d3b971fd90058bc1de43b8f170f7a15aef (patch)
treea6426c73fe4330d94993a33fcff8cc1d7d7b4b63 /osdep
parent39e28570f1d995a04a1e5f7ad283a12906930296 (diff)
downloadmpv-c15270d3b971fd90058bc1de43b8f170f7a15aef.tar.bz2
mpv-c15270d3b971fd90058bc1de43b8f170f7a15aef.tar.xz
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.
Diffstat (limited to 'osdep')
-rw-r--r--osdep/macosx_finder_args.m4
1 files changed, 3 insertions, 1 deletions
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)
}