From: Damiano Galassi Date: Mon, 12 Jun 2017 15:05:23 +0000 (+0200) Subject: MacGui: sort the keys of the exported json presets on 10.13 and later. X-Git-Tag: 1.1.0~530 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=46be9b0ac3d4b87269ba6b0732e5034778c2bb1d;p=handbrake MacGui: sort the keys of the exported json presets on 10.13 and later. --- diff --git a/macosx/HBPreset.m b/macosx/HBPreset.m index 97faea58a..5fad6ba4a 100644 --- a/macosx/HBPreset.m +++ b/macosx/HBPreset.m @@ -273,7 +273,8 @@ } 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]; }