Skip to content

Commit

Permalink
Update to XCode 5.0 ARC and rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
vjt committed Apr 20, 2014
1 parent f9e159f commit c687ba8
Show file tree
Hide file tree
Showing 14 changed files with 31 additions and 48 deletions.
4 changes: 1 addition & 3 deletions Afloat.m
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,8 @@ - (void) install {
if (index < [menu numberOfItems] && ![[menu itemAtIndex:index] isSeparatorItem])
[menu insertItem:[NSMenuItem separatorItem] atIndex:index];

[badge release];

[_menuWithItems release]; _menuWithItems = nil;
_menuWithItems = nil;

// Set up swizzling sendEvents: in NSApplication --------------

Expand Down Expand Up @@ -350,7 +349,6 @@ - (void) beginTrackingWindow:(NSWindow*) window {

L0Log(@"tracker = %@ view = %@", tracker, v);

[tracker release];
}

- (void) endTrackingWindow:(NSWindow*) window {
Expand Down
16 changes: 11 additions & 5 deletions Afloat.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@
089C1669FE841209C02AAC07 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0420;
LastUpgradeCheck = 0510;
};
buildConfigurationList = 1DEB913E08733D840010E9CD /* Build configuration list for PBXProject "Afloat" */;
compatibilityVersion = "Xcode 3.2";
Expand Down Expand Up @@ -502,14 +502,15 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 1512ABDB0E09AB7300BA67AC /* Afloat.xcconfig */;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
CLANG_ENABLE_OBJC_ARC = YES;
COMBINE_HIDPI_IMAGES = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)\"",
);
GCC_C_LANGUAGE_STANDARD = c99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_OBJC_GC = supported;
GCC_ENABLE_OBJC_GC = unsupported;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
Expand All @@ -533,14 +534,15 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 1512ABDB0E09AB7300BA67AC /* Afloat.xcconfig */;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
CLANG_ENABLE_OBJC_ARC = YES;
COMBINE_HIDPI_IMAGES = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)\"",
);
GCC_C_LANGUAGE_STANDARD = c99;
GCC_ENABLE_OBJC_GC = supported;
GCC_ENABLE_OBJC_GC = unsupported;
GCC_MODEL_TUNING = G5;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = Afloat_Prefix.pch;
Expand All @@ -561,13 +563,17 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 1512ABDB0E09AB7300BA67AC /* Afloat.xcconfig */;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD)";
ONLY_ACTIVE_ARCH = NO;
SDKROOT = macosx;
};
name = Debug;
};
1DEB914008733D840010E9CD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = "$(ARCHS_STANDARD)";
ONLY_ACTIVE_ARCH = NO;
SDKROOT = macosx;
};
name = Release;
Expand Down
2 changes: 1 addition & 1 deletion AfloatBadgeController.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ typedef NSUInteger AfloatBadgeType;
unsigned int enqueuedFades;
}

@property(retain) NSWindow* parentWindow;
@property(strong) NSWindow* parentWindow;

- (id) initAttachedToWindow:(NSWindow*) parentWindow;
+ (id) badgeControllerForWindow:(NSWindow*) w;
Expand Down
8 changes: 1 addition & 7 deletions AfloatBadgeController.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ + (id) badgeControllerForWindow:(NSWindow*) w {
if (panel)
return panel;
else
return [[[self alloc] initAttachedToWindow:w] autorelease];
return [[self alloc] initAttachedToWindow:w];
}

- (id) initAttachedToWindow:(NSWindow*) parentWindow {
Expand Down Expand Up @@ -48,7 +48,6 @@ - (void) setParentWindow:(NSWindow*) newParent {
if (_parentWindow) {
[AfloatStorage removeSharedValueForWindow:_parentWindow key:kAfloatBadgeControllerKey];

[_parentWindow release];
}

if (newParent) {
Expand All @@ -58,7 +57,6 @@ - (void) setParentWindow:(NSWindow*) newParent {
// addObserver:self selector:@selector(parentWindowDidResize:) name:NSWindowDidResizeNotification object:_parentWindow];


[newParent retain];
}

_parentWindow = newParent;
Expand Down Expand Up @@ -188,9 +186,5 @@ + (NSImage*) didEndKeepingAfloatBadge {
}


- (void) dealloc {
self.parentWindow = nil;
[super dealloc];
}

@end
7 changes: 3 additions & 4 deletions AfloatNagPreferences.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,12 @@ enum {
typedef NSInteger AfloatNagAction;

static id AfloatNagGetPreferenceForKey(CFStringRef key, Class cl) {
id obj = (id) CFPreferencesCopyAppValue(key, kAfloatNagPreferencesIdentifier);
id obj = (id) CFBridgingRelease(CFPreferencesCopyAppValue(key, kAfloatNagPreferencesIdentifier));
if (cl && obj && ![obj isKindOfClass:cl]) {
[obj release];
obj = nil;
}

return [obj autorelease];
return obj;
}

static BOOL AfloatNagGetBooleanForKey(CFStringRef key) {
Expand All @@ -30,7 +29,7 @@ static BOOL AfloatNagGetBooleanForKey(CFStringRef key) {
}

static void AfloatNagSetPreferenceForKey(CFStringRef key, id obj) {
CFPreferencesSetAppValue(key, (CFPropertyListRef) obj, kAfloatNagPreferencesIdentifier);
CFPreferencesSetAppValue(key, (__bridge CFPropertyListRef) obj, kAfloatNagPreferencesIdentifier);
CFPreferencesAppSynchronize(kAfloatNagPreferencesIdentifier);
}

Expand Down
4 changes: 0 additions & 4 deletions AfloatPanel.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ - (id) initWithFrame:(NSRect) frame {
return self;
}

- (void) dealloc {
[_image release];
[super dealloc];
}

- (void) drawRect:(NSRect) r {
[[NSColor clearColor] set]; NSRectFill(r);
Expand Down
2 changes: 1 addition & 1 deletion AfloatPanelController.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ typedef enum {

- (IBAction) disableAllOverlays:(id) sender;

@property(retain) NSWindow* parentWindow;
@property(strong) NSWindow* parentWindow;
@property CGFloat alphaValue;
// @property(getter=isKeptAfloat) BOOL keptAfloat;
@property AfloatWindowState windowState;
Expand Down
6 changes: 1 addition & 5 deletions AfloatPanelController.m
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ - (void) setParentWindow:(NSWindow*) newParent {
[[NSNotificationCenter defaultCenter]
removeObserver:self name:NSWindowDidResizeNotification object:_parentWindow];

[_parentWindow release];
}

if (newParent) {
Expand All @@ -53,7 +52,6 @@ - (void) setParentWindow:(NSWindow*) newParent {
addObserver:self selector:@selector(parentWindowDidResize:) name:NSWindowDidResizeNotification object:_parentWindow];


[newParent retain];
}

_parentWindow = newParent;
Expand Down Expand Up @@ -98,13 +96,11 @@ + (id) panelControllerForWindow:(NSWindow*) w {
if (panel)
return panel;
else
return [[[self alloc] initAttachedToWindow:w] autorelease];
return [[self alloc] initAttachedToWindow:w];
}

- (void) dealloc {
[AfloatStorage removeSharedValueForWindow:self.parentWindow key:kAfloatPanelControllerKey];
self.parentWindow = nil;
[super dealloc];
}

- (IBAction) toggleWindow:(id) sender {
Expand Down
7 changes: 6 additions & 1 deletion AfloatScripting/AfloatScripting.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@
29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0420;
LastUpgradeCheck = 0510;
};
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "AfloatScripting" */;
compatibilityVersion = "Xcode 3.2";
Expand Down Expand Up @@ -285,6 +285,8 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ENABLE_OBJC_ARC = YES;
COMBINE_HIDPI_IMAGES = YES;
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_MODEL_TUNING = G5;
Expand All @@ -301,6 +303,8 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ENABLE_OBJC_ARC = YES;
COMBINE_HIDPI_IMAGES = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_MODEL_TUNING = G5;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
Expand All @@ -319,6 +323,7 @@
GCC_OPTIMIZATION_LEVEL = 0;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
};
name = Debug;
Expand Down
5 changes: 1 addition & 4 deletions AfloatScripting/AfloatScriptingAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ - (void) applicationDidFinishLaunching:(NSNotification*) n {
- (void) rearmDeathTimer {
if (deathTimer) {
[deathTimer invalidate];
[deathTimer release];
}

deathTimer = [[NSTimer scheduledTimerWithTimeInterval:60 target:self selector:@selector(deathTimerTicked:) userInfo:nil repeats:NO] retain];
deathTimer = [NSTimer scheduledTimerWithTimeInterval:60 target:self selector:@selector(deathTimerTicked:) userInfo:nil repeats:NO];
}

- (void) deathTimerTicked:(NSTimer*) t {
Expand All @@ -30,8 +29,6 @@ - (void) deathTimerTicked:(NSTimer*) t {

- (void) dealloc {
[deathTimer invalidate];
[deathTimer release];
[super dealloc];
}

@end
4 changes: 2 additions & 2 deletions AfloatStorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND

@interface AfloatStorage : NSObject {
NSMutableDictionary* _backingStorage;
id _delegate;
id __strong _delegate;
NSArray* _persistedKeys;
}

Expand All @@ -31,7 +31,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND

- (NSMutableDictionary*) mutableDictionaryForWindow:(NSWindow*) w;

@property(assign) id delegate;
@property(strong) id delegate;
@property(copy) NSArray* persistedKeys;

- (void) removeValueForWindow:(NSWindow*) w key:(NSString*) k;
Expand Down
2 changes: 0 additions & 2 deletions AfloatStorage.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ - (id) init {

- (void) dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
[_backingStorage release];
[super dealloc];
}

- (id) valueForWindow:(NSWindow*) w key:(NSString*) k {
Expand Down
10 changes: 2 additions & 8 deletions AfloatWindowIdentifier.m
Original file line number Diff line number Diff line change
Expand Up @@ -144,21 +144,15 @@ + (NSArray*) identifierSubclasses {
return classes;
}

- (void) dealloc {
self.category = nil;
self.key = nil;

[super dealloc];
}

@synthesize category = _category, key = _key, canMatchMultipleWindows = _canMatchMultipleWindows;

+ (NSArray*) allIdentifiersForWindow:(NSWindow*) w {
NSMutableArray* results = [NSArray array];
NSMutableArray* results = [NSMutableArray array];

for (Class c in [self identifierSubclasses]) {
if ([c canInitWithWindow:w])
[results addObject:[[[c alloc] initWithWindow:w] autorelease]];
[results addObject:[[c alloc] initWithWindow:w]];
}

return results;
Expand Down
2 changes: 1 addition & 1 deletion Afloat_AfloatScripting.m
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ - (void) installScriptingSupport {
[[NSDistributedNotificationCenter defaultCenter] addObserver:self selector:@selector(_scriptShouldShowWindowFileInFinder:) name:kAfloatScriptShowWindowFileInFinderNotification object:kAfloatScriptWireObject];

NSString* pathToScriptingApp = [[[[NSBundle bundleForClass:[self class]] bundlePath] stringByAppendingPathComponent:@"Contents"] stringByAppendingPathComponent:@"Afloat Scripting.app"];
LSRegisterURL((CFURLRef) [NSURL fileURLWithPath:pathToScriptingApp], false);
LSRegisterURL((__bridge CFURLRef) [NSURL fileURLWithPath:pathToScriptingApp], false);

L0LogS(@"Scripting support installed.");
}
Expand Down

0 comments on commit c687ba8

Please sign in to comment.