From 52c87eaeca412957b5461705dabff288444eb0df Mon Sep 17 00:00:00 2001 From: Maarten Billemont Date: Sat, 16 May 2020 16:03:42 -0400 Subject: [PATCH] Keep sites sorted by name on export to ensure consistency. --- platform-darwin/Source/MPAppDelegate_Store.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platform-darwin/Source/MPAppDelegate_Store.m b/platform-darwin/Source/MPAppDelegate_Store.m index 65fb5674..53e69232 100644 --- a/platform-darwin/Source/MPAppDelegate_Store.m +++ b/platform-darwin/Source/MPAppDelegate_Store.m @@ -728,7 +728,9 @@ PearlAssociatedObjectProperty( NSNumber*, StoreCorrupted, storeCorrupted ); exportUser->defaultType = user.defaultType; exportUser->lastUsed = (time_t)user.lastUsed.timeIntervalSince1970; - for (MPSiteEntity *site in user.sites) { + for (MPSiteEntity *site in [user.sites sortedArrayUsingDescriptors:@[ + [NSSortDescriptor sortDescriptorWithKey:@"name" ascending:YES] + ]]) { MPCounterValue counter = MPCounterValueInitial; if ([site isKindOfClass:[MPGeneratedSiteEntity class]]) counter = ((MPGeneratedSiteEntity *)site).counter;