Permalink
Browse files

(minor) Screw it, I’m tired of trying to conform.

  • Loading branch information...
1 parent dce061c commit 2b0a6cb8c4829aa285ddf076d07a580dfb5cf9e7 @ELLIOTTCABLE committed Jun 9, 2010
Showing with 28 additions and 34 deletions.
  1. +8 −8 Preference Pane/YRSolcounterPref.h
  2. +16 −21 Preference Pane/YRSolcounterPref.m
  3. +1 −1 YRSolcounter.h
  4. +3 −4 YRSolcounter.m
@@ -9,16 +9,16 @@
#import <PreferencePanes/PreferencePanes.h>
-@interface YRSolcounterPref : NSPreferencePane
-{
- IBOutlet NSButton *extraEnabled;
+@interface YRSolcounterPref: NSPreferencePane {
+ IBOutlet //»
+ NSButton *extraEnabled;
}
-- (void) mainViewDidLoad;
-- (IBAction) toggleExtra:(id)sender;
+-(void) mainViewDidLoad;
+-(IBAction) toggleExtra: (id)sender;
-- (void)loadExtra:(NSString *)extraPath;
-- (void)removeExtra:(NSString *)extraPath;
-- (BOOL)isExtraLoaded:(NSString *)extraPath;
+-(void) loadExtra: (NSString*)extraPath;
+-(void) removeExtra: (NSString*)extraPath;
+-(BOOL) isExtraLoaded: (NSString*)extraPath;
@end
@@ -24,36 +24,33 @@
@implementation YRSolcounterPref
-- (void) mainViewDidLoad
-{
+-(void) mainViewDidLoad {
NSString *extraPath = [[self bundle] pathForResource: @"Solcounter"
ofType: @"menu"
inDirectory: @""];
- if ([self isExtraLoaded:extraPath])
- [extraEnabled setState:NSOnState];
+ if ([self isExtraLoaded: extraPath])
+ [extraEnabled setState: NSOnState];
}
-- (IBAction)toggleExtra:(id)sender
-{
+-(IBAction) toggleExtra: (id)sender {
NSString *extraPath = [[self bundle] pathForResource: @"Solcounter"
ofType: @"menu"
inDirectory: @""];
- if (([sender state] == NSOnState) && ![self isExtraLoaded:extraPath]) {
- [self loadExtra:extraPath];
- if (![self isExtraLoaded:extraPath])
- [sender setState:NSOffState];
+ if (([sender state] == NSOnState) && ![self isExtraLoaded: extraPath]) {
+ [self loadExtra: extraPath];
+ if (![self isExtraLoaded: extraPath])
+ [sender setState: NSOffState];
} else //»
- if (([sender state] == NSOffState) && [self isExtraLoaded:extraPath]) {
- [self removeExtra:extraPath];
- if ([self isExtraLoaded:extraPath])
- [sender setState:NSOnState];
+ if (([sender state] == NSOffState) && [self isExtraLoaded: extraPath]) {
+ [self removeExtra: extraPath];
+ if ([self isExtraLoaded: extraPath])
+ [sender setState: NSOnState];
}
}
-- (void)loadExtra:(NSString *)extraPath
-{ int sleepCount;
+-(void) loadExtra: (NSString*)extraPath { int sleepCount;
NSURL *extraURL = [NSURL fileURLWithPath: extraPath];
CMEAddExtra((CFURLRef)extraURL, 0);
@@ -67,7 +64,7 @@ - (void)loadExtra:(NSString *)extraPath
inDirectory: @""];
if (extraPath != crackerPath && ![self isExtraLoaded: extraPath])
- [self loadExtra:crackerPath];
+ [self loadExtra: crackerPath];
CMEAddExtra((CFURLRef)extraURL, 0);
@@ -77,17 +74,15 @@ - (void)loadExtra:(NSString *)extraPath
usleep(sleepCount += 250000); }
}
-- (void)removeExtra:(NSString *)extraPath
-{ OpaqueMenuExtra *extra;
+-(void) removeExtra: (NSString*)extraPath { OpaqueMenuExtra *extra;
NSString *extraID = [[NSBundle bundleWithPath: extraPath]
objectForInfoDictionaryKey: @"CFBundleIdentifier"];
if ((CMEGetExtra((CFStringRef)extraID, &extra) == 0) && extra)
CMERemoveExtra(extra);
}
-- (BOOL)isExtraLoaded:(NSString *)extraPath
-{ OpaqueMenuExtra *extra;
+-(BOOL) isExtraLoaded: (NSString*)extraPath { OpaqueMenuExtra *extra;
NSString *extraID = [[NSBundle bundleWithPath: extraPath]
objectForInfoDictionaryKey: @"CFBundleIdentifier"];
View
@@ -13,7 +13,7 @@
@class YRSolcounterView;
-@interface YRSolcounter : NSMenuExtra {
+@interface YRSolcounter: NSMenuExtra {
IBOutlet //»
NSTextField *textField;
BundleUserDefaults *defaults;
View
@@ -11,8 +11,7 @@
@implementation YRSolcounter
-- (id)initWithBundle:(NSBundle *)bundle
-{
+-(id) initWithBundle: (NSBundle*)bundle {
if ( (self = [super initWithBundle: bundle]) == nil ) return nil;
[(defaults = [[BundleUserDefaults alloc]
@@ -35,7 +34,7 @@ - (id)initWithBundle:(NSBundle *)bundle
return self;
}
-- (void)handleTimer:(NSTimer *)_
+-(void) handleTimer: (NSTimer*)_
{
double date = [[NSDate date] timeIntervalSince1970];
@@ -48,7 +47,7 @@ - (void)handleTimer:(NSTimer *)_
(unsigned long long int)(date / 0.0000864) % 1000]];
}
-- (void)dealloc
+-(void) dealloc
{
[textField release];
[super dealloc];

0 comments on commit 2b0a6cb

Please sign in to comment.