Skip to content

Commit

Permalink
Rename some methods and definitions to make them clearer.
Browse files Browse the repository at this point in the history
  • Loading branch information
emsquared committed Feb 19, 2012
1 parent e2317d3 commit 0e0699f
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 26 deletions.
4 changes: 2 additions & 2 deletions Classes/Controllers/GrowlController.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ - (id)init
{
if ((self = [super init])) {
#ifdef _USES_NATIVE_NOTIFICATION_CENTER
if ([Preferences applicationRanOnMountainLion]) {
if ([Preferences featureAvailableToOSXMountainLion]) {
[_NSUserNotificationCenter() setDelegate:self];

return self;
Expand Down Expand Up @@ -115,7 +115,7 @@ - (void)notify:(NotificationType)type title:(NSString *)title desc:(NSString *)d
}

#ifdef _USES_NATIVE_NOTIFICATION_CENTER
if ([Preferences applicationRanOnMountainLion]) {
if ([Preferences featureAvailableToOSXMountainLion]) {
NSUserNotification *notification = [NSUserNotification newad];

notification.title = title;
Expand Down
2 changes: 1 addition & 1 deletion Classes/Controllers/MasterController.m
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ - (void)dealloc

- (void)awakeFromNib
{
#ifdef _RUNNING_MAC_OS_LION
#ifdef _MAC_OS_LION_OR_NEWER
[window setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
#endif

Expand Down
6 changes: 3 additions & 3 deletions Classes/Controllers/MenuController.m
Original file line number Diff line number Diff line change
Expand Up @@ -1666,8 +1666,8 @@ - (void)onWantMainWindowShown:(id)sender

- (void)wantsFullScreenModeToggled:(id)sender
{
#ifdef _RUNNING_MAC_OS_LION
if ([Preferences applicationRanOnLion]) {
#ifdef _MAC_OS_LION_OR_NEWER
if ([Preferences featureAvailableToOSXLion]) {
if (isInFullScreenMode) {
[window toggleFullScreen:sender];
[master loadWindowState];
Expand Down Expand Up @@ -1702,7 +1702,7 @@ - (void)wantsFullScreenModeToggled:(id)sender
[NSApp setPresentationOptions:NSApplicationPresentationDefault];
}

#ifdef _RUNNING_MAC_OS_LION
#ifdef _MAC_OS_LION_OR_NEWER
}
#endif

Expand Down
5 changes: 3 additions & 2 deletions Classes/Headers/Preferences.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ typedef enum {
+ (NSInteger)totalRunTime;
+ (void)updateTotalRunTime;

+ (BOOL)applicationRanOnLion;
+ (BOOL)applicationRanOnMountainLion;
+ (BOOL)featureAvailableToOSXLion;
+ (BOOL)featureAvailableToOSXMountainLion;

+ (NSData *)applicationIcon;
+ (NSString *)applicationName;
+ (NSInteger)applicationProcessID;
Expand Down
17 changes: 9 additions & 8 deletions Classes/Headers/StaticDefinitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,29 @@
#define _LOAD_MAC_OS_LION_LIBRARIES 1

#if _LOAD_MAC_OS_LION_LIBRARIES
#if defined(MAC_OS_X_VERSION_10_7)
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
#define _RUNNING_MAC_OS_LION
#if defined(MAC_OS_X_VERSION_10_8)
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_8
#define _MAC_OS_MOUNTAIN_LION_OR_NEWER
#endif
#endif

#if defined(MAC_OS_X_VERSION_10_8)
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_8
#define _RUNNING_MAC_OS_MOUNTAIN_LION
#if defined(MAC_OS_X_VERSION_10_7)
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
#define _MAC_OS_LION_OR_NEWER
#endif
#endif

#endif

#define NSAppKitVersionNumber10_6 1038
#define NSAppKitVersionNumber10_7 1138
#define NSAppKitVersionNumber10_7_2 1138.23

#ifdef _RUNNING_MAC_OS_LION
#ifdef _MAC_OS_LION_OR_NEWER
#define _USES_MODERN_REGULAR_EXPRESSION
#endif

#ifdef _RUNNING_MAC_OS_MOUNTAIN_LION
#ifdef _MAC_OS_MOUNTAIN_LION_OR_NEWER
#define _USES_NATIVE_NOTIFICATION_CENTER
#endif

Expand Down
2 changes: 1 addition & 1 deletion Classes/Library/TXRegularExpression.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ @implementation TXRegularExpression

+ (BOOL)useNewRegularExpressionEngine
{
return [Preferences applicationRanOnLion];
return [Preferences featureAvailableToOSXLion];
}

+ (BOOL)string:(NSString *)haystack isMatchedByRegex:(NSString *)needle
Expand Down
4 changes: 2 additions & 2 deletions Classes/Preferences/Preferences.m
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,12 @@ + (NSInteger)commandUIndex:(NSString *)command
#pragma mark -
#pragma mark Application Information

+ (BOOL)applicationRanOnLion
+ (BOOL)featureAvailableToOSXLion
{
return (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_6);
}

+ (BOOL)applicationRanOnMountainLion
+ (BOOL)featureAvailableToOSXMountainLion
{
return (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_7);
}
Expand Down
4 changes: 2 additions & 2 deletions Classes/Views/Log/LogController.m
Original file line number Diff line number Diff line change
Expand Up @@ -1010,8 +1010,8 @@ - (void)setUpScroller
[(id)scrollView setAllowsHorizontalScrolling:NO];
}

#ifdef _RUNNING_MAC_OS_LION
if ([Preferences applicationRanOnLion]) {
#ifdef _MAC_OS_LION_OR_NEWER
if ([Preferences featureAvailableToOSXLion]) {
[scrollView setHorizontalScrollElasticity:NSScrollElasticityNone];
[scrollView setVerticalScrollElasticity:NSScrollElasticityNone];
}
Expand Down
2 changes: 1 addition & 1 deletion Classes/Views/MemberList/MemberListCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ - (void)drawModeBadge:(char)mcstring inCell:(NSRect)badgeFrame isSelected:(BOOL)
badgeTextPoint.y -= 1;
}

if ([Preferences applicationRanOnMountainLion]) {
if ([Preferences featureAvailableToOSXMountainLion]) {
badgeTextPoint.y -= 1;
}

Expand Down
2 changes: 1 addition & 1 deletion Classes/Views/ServerList.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ - (NSRect)frameOfCellAtColumn:(NSInteger)column row:(NSInteger)row
id childItem = [self itemAtRow:row];

if ([self isGroupItem:childItem] == NO) {
if ([Preferences applicationRanOnLion]) {
if ([Preferences featureAvailableToOSXLion]) {
nrect.origin.x += 35;
nrect.size.width = ([self frame].size.width - 35);
} else {
Expand Down
2 changes: 1 addition & 1 deletion Classes/Views/ServerListCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ - (NSInteger)drawMessageCountBadge:(NSAttributedString *)mcstring
badgeTextPoint = NSMakePoint( (NSMidX(badgeFrame) - (messageCountSize.width / 2.0)),
((NSMidY(badgeFrame) - (messageCountSize.height / 2.0)) + 1));

if ([Preferences applicationRanOnMountainLion]) {
if ([Preferences featureAvailableToOSXMountainLion]) {
badgeTextPoint.y -= 1;
}

Expand Down
4 changes: 2 additions & 2 deletions Resources/Miscellaneous/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<plist version="1.0">
<dict>
<key>Build Number</key>
<string>9617</string>
<string>9618</string>
<key>Build Reference</key>
<string>2.1-231-gd2ad5f2-unstable</string>
<string>2.1-232-ge2317d3-unstable</string>
<key>CFBundleExecutable</key>
<string>Textual</string>
<key>CFBundleIconFile</key>
Expand Down

0 comments on commit 0e0699f

Please sign in to comment.