mirror of
https://github.com/Codeux-Software/Textual.git
synced 2026-06-16 13:24:32 +00:00
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
This commit is contained in:
@@ -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<NSDictionary *> *clientList = [object arrayForKey:@"clients"];
|
||||
|
||||
if (clientList) {
|
||||
[self import:clientList withKey:IRCWorldClientListDefaultsKey];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
[RZUserDefaults() setObject:object forKey:key];
|
||||
[RZUserDefaults() _migrateObject:object forKey:key];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user