From ecffcf02f689de8f5d4e1785efbd0803d25263f2 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 5 Jul 2024 14:22:39 -0400 Subject: [PATCH] Modify TPCPreferencesImportExport Use same path in preferences controller for importing keys as migration so that values will go to correct container. Also remove code supporting old IRCWorld key --- .../Preferences/TPCPreferencesImportExport.m | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/Sources/App/Classes/Preferences/TPCPreferencesImportExport.m b/Sources/App/Classes/Preferences/TPCPreferencesImportExport.m index f7104030a..3390ead80 100644 --- a/Sources/App/Classes/Preferences/TPCPreferencesImportExport.m +++ b/Sources/App/Classes/Preferences/TPCPreferencesImportExport.m @@ -51,6 +51,10 @@ NS_ASSUME_NONNULL_BEGIN +@interface TPCPreferencesUserDefaults () +- (void)_migrateObject:(nullable id)value forKey:(NSString *)defaultName; +@end + @implementation TPCPreferencesImportExport + (void)importInWindow:(NSWindow *)window @@ -196,21 +200,9 @@ NS_ASSUME_NONNULL_BEGIN [self importClientConfiguration:object]; }]; } - else if ([key isEqualToString:@"World Controller"]) - { - if ([object isKindOfClass:[NSDictionary class]] == NO) { - return; - } - - NSArray *clientList = [object arrayForKey:@"clients"]; - - if (clientList) { - [self import:clientList withKey:IRCWorldClientListDefaultsKey]; - } - } else { - [RZUserDefaults() setObject:object forKey:key]; + [RZUserDefaults() _migrateObject:object forKey:key]; } }