From d1ed42fef17c8615696ad617ef4f3f952008368c Mon Sep 17 00:00:00 2001 From: Allan Odgaard Date: Wed, 5 Aug 2015 12:29:33 +0200 Subject: [PATCH] Use isOperatingSystemAtLeastVersion: to check for 10.10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The method wasn’t public before 10.10 but since we need to check for 10.10 we can simply conclude that lack of this method means that we are not running on 10.10. --- Frameworks/OakAppKit/src/OakTabItemView.mm | 3 +-- Frameworks/OakFileBrowser/src/ui/OFBHeaderView.mm | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Frameworks/OakAppKit/src/OakTabItemView.mm b/Frameworks/OakAppKit/src/OakTabItemView.mm index a8442add..a2937d60 100644 --- a/Frameworks/OakAppKit/src/OakTabItemView.mm +++ b/Frameworks/OakAppKit/src/OakTabItemView.mm @@ -1,7 +1,6 @@ #import "OakTabItemView.h" #import "OakRolloverButton.h" #import "NSImage Additions.h" -#import @interface OakTabBarStyle () { @@ -139,7 +138,7 @@ _inactiveTabTextStyles = _activeTabTextStyles.mutableCopy; _inactiveTabTextStyles[NSForegroundColorAttributeName] = [NSColor colorWithCalibratedWhite:0.5 alpha:1]; - if(oak::os_tuple() >= std::make_tuple(10, 10, 0)) + if([[NSProcessInfo processInfo] respondsToSelector:@selector(isOperatingSystemAtLeastVersion:)] && [[NSProcessInfo processInfo] isOperatingSystemAtLeastVersion:{ 10, 10, 0 }]) { _selectedTabTextStyles = _activeTabTextStyles.mutableCopy; _selectedTabTextStyles[NSForegroundColorAttributeName] = [NSColor blackColor]; diff --git a/Frameworks/OakFileBrowser/src/ui/OFBHeaderView.mm b/Frameworks/OakFileBrowser/src/ui/OFBHeaderView.mm index 2424d408..95c38eae 100644 --- a/Frameworks/OakFileBrowser/src/ui/OFBHeaderView.mm +++ b/Frameworks/OakFileBrowser/src/ui/OFBHeaderView.mm @@ -3,7 +3,6 @@ #import #import #import -#import static NSButton* OakCreateImageButton (NSString* imageName) { @@ -47,7 +46,7 @@ static NSPopUpButton* OakCreateFolderPopUpButton () NSMutableParagraphStyle* parStyle = [NSMutableParagraphStyle new]; [parStyle setLineBreakMode:NSLineBreakByTruncatingMiddle]; - if(oak::os_tuple() >= std::make_tuple(10, 10, 0)) + if([[NSProcessInfo processInfo] respondsToSelector:@selector(isOperatingSystemAtLeastVersion:)] && [[NSProcessInfo processInfo] isOperatingSystemAtLeastVersion:{ 10, 10, 0 }]) { NSFont* font = [NSFont systemFontOfSize:12];