From fa28b26e418f6f5c2f47ec78f9b7ef4910155b96 Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 14 Feb 2015 21:45:08 +0100 Subject: Move some duplicate code into a new class (This also affects PSMSequelProTabStyle, but see the comment there why it is left unchanged) --- Source/SPFavoritesOutlineView.m | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'Source/SPFavoritesOutlineView.m') diff --git a/Source/SPFavoritesOutlineView.m b/Source/SPFavoritesOutlineView.m index 01eb7b04..2e111925 100644 --- a/Source/SPFavoritesOutlineView.m +++ b/Source/SPFavoritesOutlineView.m @@ -39,8 +39,7 @@ static NSUInteger SPFavoritesOutlineViewUnindent = 6; - (void)awakeFromNib { - systemVersion = 0; - Gestalt(gestaltSystemVersion, &systemVersion); + isOSVersionAtLeast10_7_0 = [SPOSInfo isOSVersionAtLeastMajor:10 minor:7 patch:0]; } - (BOOL)acceptsFirstResponder @@ -129,7 +128,7 @@ static NSUInteger SPFavoritesOutlineViewUnindent = 6; NSRect superFrame = [super frameOfCellAtColumn:columnIndex row:rowIndex]; // On system versions lower than Lion, don't alter padding - if (systemVersion < 0x1070) { + if (!isOSVersionAtLeast10_7_0) { return superFrame; } @@ -159,7 +158,7 @@ static NSUInteger SPFavoritesOutlineViewUnindent = 6; } // On versions of Lion or above, amend the padding appropriately - if (systemVersion >= 0x1070) { + if (isOSVersionAtLeast10_7_0) { return NSMakeRect(superFrame.origin.x + SPFavoritesOutlineViewUnindent, superFrame.origin.y, superFrame.size.width, superFrame.size.height); } -- cgit v1.2.3