1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-01-30 19:03:04 +00:00

Merge pull request #1579 from transmission/deprecation-cleanup

Fix a few deprecation warnings
This commit is contained in:
Mitch Livingston 2021-01-03 09:35:18 -05:00 committed by GitHub
commit d499c9c856
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 16 deletions

View file

@ -73,7 +73,7 @@ AboutWindowController * fAboutBoxInstance = nil;
[fLicenseView setString: licenseText]; [fLicenseView setString: licenseText];
[fLicenseCloseButton setTitle: NSLocalizedString(@"OK", "About window -> license close button")]; [fLicenseCloseButton setTitle: NSLocalizedString(@"OK", "About window -> license close button")];
[NSApp beginSheet: fLicenseSheet modalForWindow: [self window] modalDelegate: nil didEndSelector: nil contextInfo: nil]; [self.window beginSheet: fLicenseSheet completionHandler:nil];
} }
- (IBAction) hideLicense: (id) sender - (IBAction) hideLicense: (id) sender

View file

@ -146,7 +146,7 @@ BlocklistDownloaderViewController * fBLViewController = nil;
BlocklistDownloader * downloader = [BlocklistDownloader downloader]; BlocklistDownloader * downloader = [BlocklistDownloader downloader];
[downloader setViewController: self]; //do before showing the sheet to ensure it doesn't slide out with placeholder text [downloader setViewController: self]; //do before showing the sheet to ensure it doesn't slide out with placeholder text
[NSApp beginSheet: fStatusWindow modalForWindow: [fPrefsController window] modalDelegate: nil didEndSelector: nil contextInfo: nil]; [fPrefsController.window beginSheet: fStatusWindow completionHandler:nil];
} }
@end @end

View file

@ -1319,21 +1319,19 @@ static void removeKeRangerRansomware()
{ {
fUrlSheetController = [[URLSheetWindowController alloc] initWithController: self]; fUrlSheetController = [[URLSheetWindowController alloc] initWithController: self];
[NSApp beginSheet: [fUrlSheetController window] modalForWindow: fWindow modalDelegate: self didEndSelector: @selector(urlSheetDidEnd:returnCode:contextInfo:) contextInfo: nil]; [fWindow beginSheet: fUrlSheetController.window completionHandler:^(NSModalResponse returnCode) {
if (returnCode == 1)
{
NSString * urlString = [fUrlSheetController urlString];
dispatch_async(dispatch_get_main_queue(), ^{
[self openURL: urlString];
});
}
fUrlSheetController = nil;
}];
} }
} }
- (void) urlSheetDidEnd: (NSWindow *) sheet returnCode: (NSInteger) returnCode contextInfo: (void *) contextInfo
{
if (returnCode == 1)
{
NSString * urlString = [fUrlSheetController urlString];
[self performSelectorOnMainThread: @selector(openURL:) withObject: urlString waitUntilDone: NO];
}
fUrlSheetController = nil;
}
- (void) createFile: (id) sender - (void) createFile: (id) sender
{ {
[CreatorWindowController createTorrentFile: fLib]; [CreatorWindowController createTorrentFile: fLib];

View file

@ -465,7 +465,7 @@ NSMutableSet *creatorWindowControllerSet = nil;
[panel setMessage: NSLocalizedString(@"Select a file or folder for the torrent file.", "Create torrent -> select file")]; [panel setMessage: NSLocalizedString(@"Select a file or folder for the torrent file.", "Create torrent -> select file")];
BOOL success = [panel runModal] == NSOKButton; BOOL success = [panel runModal] == NSModalResponseOK;
return success ? [panel URLs][0] : nil; return success ? [panel URLs][0] : nil;
} }

View file

@ -709,7 +709,7 @@
+ (NSInteger) dateToTimeSum: (NSDate *) date + (NSInteger) dateToTimeSum: (NSDate *) date
{ {
NSCalendar * calendar = [NSCalendar currentCalendar]; NSCalendar * calendar = [NSCalendar currentCalendar];
NSDateComponents * components = [calendar components: NSHourCalendarUnit | NSMinuteCalendarUnit fromDate: date]; NSDateComponents * components = [calendar components: NSCalendarUnitHour | NSCalendarUnitMinute fromDate: date];
return [components hour] * 60 + [components minute]; return [components hour] * 60 + [components minute];
} }