Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change deployment to 10.10 #2295

Merged
merged 4 commits into from
Dec 13, 2016
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,13 @@ typedef NSInteger QSApplicationLaunchStatusFlags;

This category of NSApplication provides class methods to check which Mac OS X
version Quicksilver is running on.
Uses Gestalt API. See http://www.cocoadev.com/index.pl?DeterminingOSVersion for
reasons this is the best choice for determining the system version.
For future methods similar to these ones, keep the limitations of gestaltSystemVersion
in mind. Maybe use gestaltSystemVersionMajor/gestaltSystemVersionMinor instead.
*/
@interface NSApplication (VersionCheck)
/**
Returns the version as provided by Gestalt(gestaltSystemVersion,...)
@returns SInt32 Mac OS X version number as a hex number (eg: 0x1013 = 10.1.3)
Returns the version as provided by [NSProcessInfo processInfo]
@returns NSOperatingSystemVersion macOS version as a struct
*/
+ (SInt32)macOSXSystemVersion;
+ (NSOperatingSystemVersion)macOSXSystemVersion;
/**
Returns the major release of Mac OS X, for example 10.7
*/
Expand Down
35 changes: 11 additions & 24 deletions Quicksilver/Code-QuickStepFoundation/NSApplication_BLTRExtensions.m
Original file line number Diff line number Diff line change
Expand Up @@ -142,41 +142,28 @@ - (void)updateLaunchStatusInfo {

@end


@implementation NSApplication (VersionCheck)
+ (NSString *)macOSXFullVersion {
return [NSString stringWithFormat:@"%i.%i.%i",(int)[self macOSXMajorVersion],(int)[self macOSXMinorVersion],(int)[self macOSXBugfixVersion]];
}
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10
#error Switch to [[NSProcessInfo processInfo] operatingSystemVersion]
#else
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+ (SInt32)macOSXMajorVersion {
SInt32 versionMajor;
Gestalt (gestaltSystemVersionMajor, &versionMajor);
return versionMajor;
+ (NSInteger)macOSXMajorVersion {
NSOperatingSystemVersion osv = [[NSProcessInfo processInfo] operatingSystemVersion];
return osv.majorVersion;
}

+ (SInt32)macOSXMinorVersion {
SInt32 versionMinor;
Gestalt (gestaltSystemVersionMinor, &versionMinor);
return versionMinor;
+ (NSInteger)macOSXMinorVersion {
NSOperatingSystemVersion osv = [[NSProcessInfo processInfo] operatingSystemVersion];
return osv.minorVersion;
}

+ (SInt32)macOSXBugfixVersion {
SInt32 versionBugfix;
Gestalt (gestaltSystemVersionBugFix, &versionBugfix);
return versionBugfix;
+ (NSInteger)macOSXBugfixVersion {
NSOperatingSystemVersion osv = [[NSProcessInfo processInfo] operatingSystemVersion];
return osv.patchVersion;
}

+ (SInt32)macOSXSystemVersion {
SInt32 version;
Gestalt (gestaltSystemVersion, &version);
return version;
+ (NSOperatingSystemVersion)macOSXSystemVersion {
return [[NSProcessInfo processInfo] operatingSystemVersion];
}
#pragma clang diagnostic pop
#endif

+ (NSString *)macOSXReleaseVersion {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm... my comment disappeared. Although I clicked 'start a review' instead of 'add single comment' (some new GH feature?)

I was just saying that it's probably better to not cast to int, although it probably won't make much of a difference. I'd use %ld then cast to a long. Although this has other suggestions: http://stackoverflow.com/questions/4405006/nslog-printf-specifier-for-nsinteger

Tiny/nit-picking comment, sorry! :P

return [NSString stringWithFormat:@"%i.%i", (int)[self macOSXMajorVersion], (int)[self macOSXMinorVersion]];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm... my comment disappeared. Although I clicked 'start a review' instead of 'add single comment' (some new GH feature?)

I was just saying that it's probably better to not cast to int, although it probably won't make much of a difference. I'd use %ld then cast to a long. Although this has other suggestions: http://stackoverflow.com/questions/4405006/nslog-printf-specifier-for-nsinteger

Tiny/nit-picking comment, sorry! :P

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm... my comment disappeared. Although I clicked 'start a review' instead of 'add single comment' (some new GH feature?)

I was just saying that it's probably better to not cast to int, although it probably won't make much of a difference. I'd use %ld then cast to a long. Although this has other suggestions: http://stackoverflow.com/questions/4405006/nslog-printf-specifier-for-nsinteger

Tiny/nit-picking comment, sorry! :P

Expand Down
2 changes: 1 addition & 1 deletion Quicksilver/Configuration/Common.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ SDKROOT = macosx

SYMROOT = $(QS_BUILD_ROOT)/build

MACOSX_DEPLOYMENT_TARGET = 10.9
MACOSX_DEPLOYMENT_TARGET = 10.10

INFOPLIST_PREPROCESS = YES

Expand Down