mirror of
https://github.com/transmission/transmission
synced 2025-01-30 10:52:00 +00:00
Merge pull request #1579 from transmission/deprecation-cleanup
Fix a few deprecation warnings
This commit is contained in:
commit
d499c9c856
5 changed files with 14 additions and 16 deletions
|
@ -73,7 +73,7 @@ AboutWindowController * fAboutBoxInstance = nil;
|
|||
[fLicenseView setString: licenseText];
|
||||
[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
|
||||
|
|
|
@ -146,7 +146,7 @@ BlocklistDownloaderViewController * fBLViewController = nil;
|
|||
BlocklistDownloader * downloader = [BlocklistDownloader downloader];
|
||||
[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
|
||||
|
|
|
@ -1319,21 +1319,19 @@ static void removeKeRangerRansomware()
|
|||
{
|
||||
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
|
||||
{
|
||||
[CreatorWindowController createTorrentFile: fLib];
|
||||
|
|
|
@ -465,7 +465,7 @@ NSMutableSet *creatorWindowControllerSet = nil;
|
|||
|
||||
[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;
|
||||
}
|
||||
|
||||
|
|
|
@ -709,7 +709,7 @@
|
|||
+ (NSInteger) dateToTimeSum: (NSDate *) date
|
||||
{
|
||||
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];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue