]> granicus.if.org Git - handbrake/commitdiff
MacGui: sort the keys of the exported json presets on 10.13 and later.
authorDamiano Galassi <damiog@gmail.com>
Mon, 12 Jun 2017 15:05:23 +0000 (17:05 +0200)
committerDamiano Galassi <damiog@gmail.com>
Mon, 12 Jun 2017 15:05:23 +0000 (17:05 +0200)
macosx/HBPreset.m

index 97faea58a1a5d2d0a9226df96ca94bcb4c1ca1c7..5fad6ba4a55462cbd54bf71678195597034cc46f 100644 (file)
     }
     else
     {
-        NSData *jsonPreset = [NSJSONSerialization dataWithJSONObject:dict options:NSJSONWritingPrettyPrinted error:NULL];
+        NSUInteger sortKeys = (1UL << 1); // NSJSONWritingSortedKeys in 10.13 sdk;
+        NSData *jsonPreset = [NSJSONSerialization dataWithJSONObject:dict options:NSJSONWritingPrettyPrinted | sortKeys error:NULL];
         success = [jsonPreset writeToURL:url atomically:atomically];
     }