mirror of
https://github.com/transmission/transmission
synced 2024-12-24 16:52:39 +00:00
Fix 'modalDelegate:' is deprecated to avoid contextInfo leaks.
This commit is contained in:
parent
4b65c4fa28
commit
019b493f36
5 changed files with 5 additions and 10 deletions
|
@ -81,7 +81,7 @@ AboutWindowController* fAboutBoxInstance = nil;
|
|||
- (IBAction)hideLicense:(id)sender
|
||||
{
|
||||
[self.fLicenseSheet orderOut:nil];
|
||||
[NSApp endSheet:self.fLicenseSheet];
|
||||
[self.window endSheet:self.fLicenseSheet];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -90,7 +90,7 @@ BlocklistDownloaderViewController* fBLViewController = nil;
|
|||
|
||||
- (void)setFinished
|
||||
{
|
||||
[NSApp endSheet:self.fStatusWindow];
|
||||
[self.fPrefsController.window endSheet:self.fStatusWindow];
|
||||
[self.fStatusWindow orderOut:self];
|
||||
|
||||
fBLViewController = nil;
|
||||
|
@ -98,7 +98,7 @@ BlocklistDownloaderViewController* fBLViewController = nil;
|
|||
|
||||
- (void)setFailed:(NSString*)error
|
||||
{
|
||||
[NSApp endSheet:self.fStatusWindow];
|
||||
[self.fPrefsController.window endSheet:self.fStatusWindow];
|
||||
[self.fStatusWindow orderOut:self];
|
||||
|
||||
NSAlert* alert = [[NSAlert alloc] init];
|
||||
|
@ -109,8 +109,6 @@ BlocklistDownloaderViewController* fBLViewController = nil;
|
|||
alert.informativeText = error;
|
||||
|
||||
[alert beginSheetModalForWindow:self.fPrefsController.window completionHandler:^(NSModalResponse returnCode) {
|
||||
[alert.window orderOut:self];
|
||||
|
||||
fBLViewController = nil;
|
||||
}];
|
||||
}
|
||||
|
|
|
@ -687,7 +687,6 @@ NSMutableSet* creatorWindowControllerSet = nil;
|
|||
|
||||
alert.informativeText = [NSString stringWithFormat:@"%s (%d)", error->message, error->code];
|
||||
[alert beginSheetModalForWindow:self.window completionHandler:^(NSModalResponse returnCode) {
|
||||
[alert.window orderOut:nil];
|
||||
[self.window close];
|
||||
}];
|
||||
tr_error_free(error);
|
||||
|
|
|
@ -296,7 +296,7 @@
|
|||
- (IBAction)cancelRules:(id)sender
|
||||
{
|
||||
[self.groupRulesSheetWindow orderOut:nil];
|
||||
[NSApp endSheet:self.groupRulesSheetWindow];
|
||||
[self.fTableView.window endSheet:self.groupRulesSheetWindow];
|
||||
|
||||
NSInteger index = [GroupsController.groups indexForRow:self.fTableView.selectedRow];
|
||||
if (![GroupsController.groups autoAssignRulesForIndex:index])
|
||||
|
@ -310,7 +310,7 @@
|
|||
- (IBAction)saveRules:(id)sender
|
||||
{
|
||||
[self.groupRulesSheetWindow orderOut:nil];
|
||||
[NSApp endSheet:self.groupRulesSheetWindow];
|
||||
[self.fTableView.window endSheet:self.groupRulesSheetWindow];
|
||||
|
||||
NSInteger index = [GroupsController.groups indexForRow:self.fTableView.selectedRow];
|
||||
[GroupsController.groups setUsesAutoAssignRules:YES forIndex:index];
|
||||
|
|
|
@ -159,8 +159,6 @@ tr_session* fLib = NULL;
|
|||
alert.showsSuppressionButton = YES;
|
||||
|
||||
[alert beginSheetModalForWindow:self.window completionHandler:^(NSModalResponse returnCode) {
|
||||
[alert.window orderOut:nil];
|
||||
|
||||
if (alert.suppressionButton.state == NSControlStateValueOn)
|
||||
{
|
||||
[NSUserDefaults.standardUserDefaults setBool:NO forKey:@"WarningResetStats"];
|
||||
|
|
Loading…
Reference in a new issue