1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-24 16:52:39 +00:00

Fixed archivedDataWithRootObject: is deprecated (#4310)

This commit is contained in:
Cœur 2022-12-14 14:42:49 +08:00 committed by GitHub
parent 6f1153cae4
commit 84c0001e2f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 4 deletions

View file

@ -3724,7 +3724,8 @@ void onTorrentCompletenessChanged(tr_torrent* tor, tr_completeness status, bool
}
[pasteboard declareTypes:@[ kTorrentTableViewDataType ] owner:self];
[pasteboard setData:[NSKeyedArchiver archivedDataWithRootObject:indexSet] forType:kTorrentTableViewDataType];
[pasteboard setData:[NSKeyedArchiver archivedDataWithRootObject:indexSet requiringSecureCoding:YES error:nil]
forType:kTorrentTableViewDataType];
return YES;
}
return NO;

View file

@ -356,7 +356,9 @@ GroupsController* fGroupsInstance = nil;
[groups addObject:tempDict];
}
[NSUserDefaults.standardUserDefaults setObject:[NSKeyedArchiver archivedDataWithRootObject:groups] forKey:@"GroupDicts"];
[NSUserDefaults.standardUserDefaults setObject:[NSKeyedArchiver archivedDataWithRootObject:groups requiringSecureCoding:YES
error:nil]
forKey:@"GroupDicts"];
}
- (NSImage*)imageForGroupNone

View file

@ -93,7 +93,8 @@ typedef NS_ENUM(NSInteger, SegmentTag) {
- (BOOL)tableView:(NSTableView*)tableView writeRowsWithIndexes:(NSIndexSet*)rowIndexes toPasteboard:(NSPasteboard*)pboard
{
[pboard declareTypes:@[ kGroupTableViewDataType ] owner:self];
[pboard setData:[NSKeyedArchiver archivedDataWithRootObject:rowIndexes] forType:kGroupTableViewDataType];
[pboard setData:[NSKeyedArchiver archivedDataWithRootObject:rowIndexes requiringSecureCoding:YES error:nil]
forType:kGroupTableViewDataType];
return YES;
}

View file

@ -156,7 +156,8 @@ static NSTimeInterval const kToggleProgressSeconds = 0.175;
- (void)saveCollapsedGroups
{
[self.fDefaults setObject:[NSKeyedArchiver archivedDataWithRootObject:self.fCollapsedGroups] forKey:@"CollapsedGroupIndexes"];
[self.fDefaults setObject:[NSKeyedArchiver archivedDataWithRootObject:self.fCollapsedGroups requiringSecureCoding:YES error:nil]
forKey:@"CollapsedGroupIndexes"];
}
- (BOOL)outlineView:(NSOutlineView*)outlineView isGroupItem:(id)item