From 2ca7ac7473e2cfc590515a5e1cecb07818728263 Mon Sep 17 00:00:00 2001 From: Mike Gelfand Date: Fri, 8 Jan 2016 10:05:19 +0000 Subject: [PATCH] Get rid of some more deprecation warnings (OS X) --- macosx/Controller.m | 2 +- macosx/InfoFileViewController.m | 2 +- macosx/InfoWindowController.m | 4 ++-- macosx/PrefsController.m | 2 +- macosx/Torrent.m | 5 ++--- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/macosx/Controller.m b/macosx/Controller.m index 279634936..2c68104a2 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -3643,7 +3643,7 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy return NSZeroRect; frame.origin = [fTableView convertPoint: frame.origin toView: nil]; - frame.origin = [fWindow convertBaseToScreen: frame.origin]; + frame = [fWindow convertRectToScreen: frame]; frame.origin.y -= frame.size.height; return frame; } diff --git a/macosx/InfoFileViewController.m b/macosx/InfoFileViewController.m index 4bc4288c8..6d64ee8a8 100644 --- a/macosx/InfoFileViewController.m +++ b/macosx/InfoFileViewController.m @@ -195,7 +195,7 @@ return NSZeroRect; frame.origin = [fileOutlineView convertPoint: frame.origin toView: nil]; - frame.origin = [[[self view] window] convertBaseToScreen: frame.origin]; + frame = [[[self view] window] convertRectToScreen: frame]; frame.origin.y -= frame.size.height; return frame; } diff --git a/macosx/InfoWindowController.m b/macosx/InfoWindowController.m index 603132e64..a14fff8fc 100644 --- a/macosx/InfoWindowController.m +++ b/macosx/InfoWindowController.m @@ -297,7 +297,7 @@ typedef enum NSRect windowRect = [window frame], viewRect = [view frame]; - const CGFloat difference = (NSHeight(viewRect) - oldHeight) * [window userSpaceScaleFactor]; + const CGFloat difference = NSHeight(viewRect) - oldHeight; windowRect.origin.y -= difference; windowRect.size.height += difference; @@ -308,7 +308,7 @@ typedef enum const CGFloat screenHeight = NSHeight([[window screen] visibleFrame]); if (NSHeight(windowRect) > screenHeight) { - const CGFloat difference = (screenHeight - NSHeight(windowRect)) * [window userSpaceScaleFactor]; + const CGFloat difference = screenHeight - NSHeight(windowRect); windowRect.origin.y -= difference; windowRect.size.height += difference; diff --git a/macosx/PrefsController.m b/macosx/PrefsController.m index 35dccfa74..e0e09e44a 100644 --- a/macosx/PrefsController.m +++ b/macosx/PrefsController.m @@ -1462,7 +1462,7 @@ return; NSRect windowRect = [window frame]; - const CGFloat difference = (NSHeight([view frame]) - NSHeight([[window contentView] frame])) * [window userSpaceScaleFactor]; + const CGFloat difference = NSHeight([view frame]) - NSHeight([[window contentView] frame]); windowRect.origin.y -= difference; windowRect.size.height += difference; diff --git a/macosx/Torrent.m b/macosx/Torrent.m index c6bd81596..6b73daddb 100644 --- a/macosx/Torrent.m +++ b/macosx/Torrent.m @@ -652,10 +652,9 @@ bool trashDataFile(const char * filename, tr_error ** error) if ([self isMagnet]) return [NSImage imageNamed: @"Magnet"]; - #warning replace kGenericFolderIcon stuff with NSImageNameFolder on 10.6 if (!fIcon) - fIcon = [[[NSWorkspace sharedWorkspace] iconForFileType: [self isFolder] ? NSFileTypeForHFSTypeCode(kGenericFolderIcon) - : [[self name] pathExtension]] retain]; + fIcon = [self isFolder] ? [[NSImage imageNamed: NSImageNameFolder] retain] + : [[[NSWorkspace sharedWorkspace] iconForFileType: [[self name] pathExtension]] retain]; return fIcon; }