--- a/Adium.xcodeproj/project.pbxproj Thu Sep 06 21:09:42 2012 +0200
+++ b/Adium.xcodeproj/project.pbxproj Sun Sep 09 12:24:39 2012 -0400
@@ -545,7 +545,7 @@
34A1A8E70DFB276E00AC78CF /* SocialNetworkingCustomStatus.xib in Resources */ = {isa = PBXBuildFile; fileRef = 34A1A8E60DFB276E00AC78CF /* SocialNetworkingCustomStatus.xib */; };
34A1A8ED0DFB27A800AC78CF /* AICustomSocialNetworkingStatusWindowController.h in Headers */ = {isa = PBXBuildFile; fileRef = 34A1A8EB0DFB27A800AC78CF /* AICustomSocialNetworkingStatusWindowController.h */; };
34A1A8EE0DFB27A800AC78CF /* AICustomSocialNetworkingStatusWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 34A1A8EC0DFB27A800AC78CF /* AICustomSocialNetworkingStatusWindowController.m */; };
- 34A1AB6C0DFC531000AC78CF /* AIXMLChatlogConverter.m in Sources */ = {isa = PBXBuildFile; fileRef = 34A1AB6B0DFC531000AC78CF /* AIXMLChatlogConverter.m */; };
+ 34A1AB6C0DFC531000AC78CF /* AIXMLChatlogConverter.m in Sources */ = {isa = PBXBuildFile; fileRef = 34A1AB6B0DFC531000AC78CF /* AIXMLChatlogConverter.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; 34A1AEE90DFD4BFE00AC78CF /* AIAddressBookInspectorPane.xib in Resources */ = {isa = PBXBuildFile; fileRef = 34A1AEE80DFD4BFE00AC78CF /* AIAddressBookInspectorPane.xib */; };
34A1AEEE0DFD4C4A00AC78CF /* AIAdvancedInspectorPane.xib in Resources */ = {isa = PBXBuildFile; fileRef = 34A1AEED0DFD4C4A00AC78CF /* AIAdvancedInspectorPane.xib */; };
34A1B2C30DFDBA1200AC78CF /* AIStringDebug.m in Sources */ = {isa = PBXBuildFile; fileRef = 34A1B2C20DFDBA1200AC78CF /* AIStringDebug.m */; };
@@ -639,7 +639,7 @@
34D8154213B663650022C8C4 /* AIFacebookXMPPService.h in Headers */ = {isa = PBXBuildFile; fileRef = 34D8153813B663650022C8C4 /* AIFacebookXMPPService.h */; };
34D8154313B663650022C8C4 /* AIFacebookXMPPService.m in Sources */ = {isa = PBXBuildFile; fileRef = 34D8153913B663650022C8C4 /* AIFacebookXMPPService.m */; };
34D8154613B663700022C8C4 /* JSONKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 34D8154413B663700022C8C4 /* JSONKit.h */; };
- 34D8154713B663700022C8C4 /* JSONKit.m in Sources */ = {isa = PBXBuildFile; fileRef = 34D8154513B663700022C8C4 /* JSONKit.m */; settings = {COMPILER_FLAGS = "-DNS_BLOCK_ASSERTIONS"; }; };
+ 34D8154713B663700022C8C4 /* JSONKit.m in Sources */ = {isa = PBXBuildFile; fileRef = 34D8154513B663700022C8C4 /* JSONKit.m */; settings = {COMPILER_FLAGS = "-DNS_BLOCK_ASSERTIONS -fno-objc-arc"; }; }; 34D8154D13B663A80022C8C4 /* auth_fb.c in Sources */ = {isa = PBXBuildFile; fileRef = 34D8154913B663A80022C8C4 /* auth_fb.c */; };
34D8154E13B663A80022C8C4 /* auth_fb.h in Headers */ = {isa = PBXBuildFile; fileRef = 34D8154A13B663A80022C8C4 /* auth_fb.h */; };
34D8154F13B663A80022C8C4 /* fbapi.c in Sources */ = {isa = PBXBuildFile; fileRef = 34D8154B13B663A80022C8C4 /* fbapi.c */; };
@@ -790,7 +790,7 @@
34DC8A8E0A7EEEF7003E1636 /* AISoundSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BD548AE086086B5008DF3CB /* AISoundSet.h */; settings = {ATTRIBUTES = (Public, ); }; };
34DC8A8F0A7EEEF7003E1636 /* AISoundSet.m in Sources */ = {isa = PBXBuildFile; fileRef = 4BD548AF086086B5008DF3CB /* AISoundSet.m */; };
34DC8A900A7EEEF7003E1636 /* AIToolbar.h in Headers */ = {isa = PBXBuildFile; fileRef = 34E6D38E0727354600A2643A /* AIToolbar.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 34DC8A910A7EEEF7003E1636 /* AIToolbar.m in Sources */ = {isa = PBXBuildFile; fileRef = 34E6D38F0727354600A2643A /* AIToolbar.m */; };
+ 34DC8A910A7EEEF7003E1636 /* AIToolbar.m in Sources */ = {isa = PBXBuildFile; fileRef = 34E6D38F0727354600A2643A /* AIToolbar.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; 34DC8A920A7EEEF7003E1636 /* AIColorPickerSliders.h in Headers */ = {isa = PBXBuildFile; fileRef = 34D369ED08E7544D00E15E40 /* AIColorPickerSliders.h */; settings = {ATTRIBUTES = (Public, ); }; };
34DC8A930A7EEEF7003E1636 /* AIColorPickerSliders.m in Sources */ = {isa = PBXBuildFile; fileRef = 34D369EE08E7544D00E15E40 /* AIColorPickerSliders.m */; };
34DC8A940A7EEEF7003E1636 /* AIPathUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = DA9CF854080F9784000C5249 /* AIPathUtilities.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -798,7 +798,7 @@
34DC8A960A7EEEF7003E1636 /* AISortController.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B422C0905ACB248005E720B /* AISortController.h */; settings = {ATTRIBUTES = (Public, ); }; };
34DC8A970A7EEEF7003E1636 /* AISortController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B422C0A05ACB248005E720B /* AISortController.m */; };
34DC8A980A7EEEF7003E1636 /* ESObjectWithProperties.h in Headers */ = {isa = PBXBuildFile; fileRef = 34111A5D06BE1B370005AF5C /* ESObjectWithProperties.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 34DC8A990A7EEEF7003E1636 /* ESObjectWithProperties.m in Sources */ = {isa = PBXBuildFile; fileRef = 34111A5E06BE1B370005AF5C /* ESObjectWithProperties.m */; };
+ 34DC8A990A7EEEF7003E1636 /* ESObjectWithProperties.m in Sources */ = {isa = PBXBuildFile; fileRef = 34111A5E06BE1B370005AF5C /* ESObjectWithProperties.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; 34DC8A9A0A7EEEF7003E1636 /* AIChat.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B82138E049CA6CC00A8010A /* AIChat.h */; settings = {ATTRIBUTES = (Public, ); }; };
34DC8A9B0A7EEEF7003E1636 /* AIChat.m in Sources */ = {isa = PBXBuildFile; fileRef = 4B82138F049CA6CC00A8010A /* AIChat.m */; };
34DC8A9C0A7EEEF7003E1636 /* AIListObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF5BA14042F3CB200A8010A /* AIListObject.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -1228,7 +1228,7 @@
633400890F9C14C2003C77A9 /* AIDateAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 6334FFBE0F9C14C1003C77A9 /* AIDateAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
6334008A0F9C14C2003C77A9 /* AIDateAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 6334FFBF0F9C14C1003C77A9 /* AIDateAdditions.m */; };
6334008B0F9C14C2003C77A9 /* AIDateFormatterAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 6334FFC00F9C14C1003C77A9 /* AIDateFormatterAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 6334008C0F9C14C2003C77A9 /* AIDateFormatterAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 6334FFC10F9C14C1003C77A9 /* AIDateFormatterAdditions.m */; };
+ 6334008C0F9C14C2003C77A9 /* AIDateFormatterAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 6334FFC10F9C14C1003C77A9 /* AIDateFormatterAdditions.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; }; 6334008D0F9C14C2003C77A9 /* AIDictionaryAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 6334FFC20F9C14C1003C77A9 /* AIDictionaryAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
6334008E0F9C14C2003C77A9 /* AIDictionaryAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 6334FFC30F9C14C1003C77A9 /* AIDictionaryAdditions.m */; };
6334008F0F9C14C2003C77A9 /* AIEventAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 6334FFC40F9C14C1003C77A9 /* AIEventAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -1247,8 +1247,6 @@
6334009C0F9C14C2003C77A9 /* AIMenuAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 6334FFD10F9C14C1003C77A9 /* AIMenuAdditions.m */; };
6334009D0F9C14C2003C77A9 /* AIMutableStringAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 6334FFD20F9C14C1003C77A9 /* AIMutableStringAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
6334009E0F9C14C2003C77A9 /* AIMutableStringAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 6334FFD30F9C14C1003C77A9 /* AIMutableStringAdditions.m */; };
- 6334009F0F9C14C2003C77A9 /* AIObjectAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 6334FFD40F9C14C1003C77A9 /* AIObjectAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 633400A00F9C14C2003C77A9 /* AIObjectAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 6334FFD50F9C14C1003C77A9 /* AIObjectAdditions.m */; };
633400A10F9C14C2003C77A9 /* AIOutlineViewAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 6334FFD60F9C14C1003C77A9 /* AIOutlineViewAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
633400A20F9C14C2003C77A9 /* AIOutlineViewAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 6334FFD70F9C14C1003C77A9 /* AIOutlineViewAdditions.m */; };
633400A30F9C14C2003C77A9 /* AIParagraphStyleAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 6334FFD80F9C14C1003C77A9 /* AIParagraphStyleAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -4167,8 +4165,6 @@
6334FFD10F9C14C1003C77A9 /* AIMenuAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AIMenuAdditions.m; path = "Frameworks/AIUtilities Framework/Source/AIMenuAdditions.m"; sourceTree = "<group>"; };
6334FFD20F9C14C1003C77A9 /* AIMutableStringAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AIMutableStringAdditions.h; path = "Frameworks/AIUtilities Framework/Source/AIMutableStringAdditions.h"; sourceTree = "<group>"; };
6334FFD30F9C14C1003C77A9 /* AIMutableStringAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AIMutableStringAdditions.m; path = "Frameworks/AIUtilities Framework/Source/AIMutableStringAdditions.m"; sourceTree = "<group>"; };
- 6334FFD40F9C14C1003C77A9 /* AIObjectAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AIObjectAdditions.h; path = "Frameworks/AIUtilities Framework/Source/AIObjectAdditions.h"; sourceTree = "<group>"; };
- 6334FFD50F9C14C1003C77A9 /* AIObjectAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AIObjectAdditions.m; path = "Frameworks/AIUtilities Framework/Source/AIObjectAdditions.m"; sourceTree = "<group>"; };
6334FFD60F9C14C1003C77A9 /* AIOutlineViewAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AIOutlineViewAdditions.h; path = "Frameworks/AIUtilities Framework/Source/AIOutlineViewAdditions.h"; sourceTree = "<group>"; };
6334FFD70F9C14C1003C77A9 /* AIOutlineViewAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AIOutlineViewAdditions.m; path = "Frameworks/AIUtilities Framework/Source/AIOutlineViewAdditions.m"; sourceTree = "<group>"; };
6334FFD80F9C14C1003C77A9 /* AIParagraphStyleAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AIParagraphStyleAdditions.h; path = "Frameworks/AIUtilities Framework/Source/AIParagraphStyleAdditions.h"; sourceTree = "<group>"; };
@@ -7850,8 +7846,6 @@
6334FFD10F9C14C1003C77A9 /* AIMenuAdditions.m */,
6334FFD20F9C14C1003C77A9 /* AIMutableStringAdditions.h */,
6334FFD30F9C14C1003C77A9 /* AIMutableStringAdditions.m */,
- 6334FFD40F9C14C1003C77A9 /* AIObjectAdditions.h */,
- 6334FFD50F9C14C1003C77A9 /* AIObjectAdditions.m */,
6334FFD60F9C14C1003C77A9 /* AIOutlineViewAdditions.h */,
6334FFD70F9C14C1003C77A9 /* AIOutlineViewAdditions.m */,
6334FFD80F9C14C1003C77A9 /* AIParagraphStyleAdditions.h */,
@@ -9111,7 +9105,6 @@
633400990F9C14C2003C77A9 /* AIImageDrawingAdditions.h in Headers */,
6334009B0F9C14C2003C77A9 /* AIMenuAdditions.h in Headers */,
6334009D0F9C14C2003C77A9 /* AIMutableStringAdditions.h in Headers */,
- 6334009F0F9C14C2003C77A9 /* AIObjectAdditions.h in Headers */,
633400A10F9C14C2003C77A9 /* AIOutlineViewAdditions.h in Headers */,
633400A30F9C14C2003C77A9 /* AIParagraphStyleAdditions.h in Headers */,
633400A50F9C14C2003C77A9 /* AIPopUpButtonAdditions.h in Headers */,
@@ -9301,9 +9294,7 @@
BuildIndependentTargetsInParallel = YES;
- LastUpgradeCheck = 0430;
- ORGANIZATIONNAME = "The Adium Team";
+ LastUpgradeCheck = 0440; buildConfigurationList = DADE8E3A085507450062B664 /* Build configuration list for PBXProject "Adium" */;
compatibilityVersion = "Xcode 3.2";
@@ -10593,7 +10584,6 @@
6334009A0F9C14C2003C77A9 /* AIImageDrawingAdditions.m in Sources */,
6334009C0F9C14C2003C77A9 /* AIMenuAdditions.m in Sources */,
6334009E0F9C14C2003C77A9 /* AIMutableStringAdditions.m in Sources */,
- 633400A00F9C14C2003C77A9 /* AIObjectAdditions.m in Sources */,
633400A20F9C14C2003C77A9 /* AIOutlineViewAdditions.m in Sources */,
633400A40F9C14C2003C77A9 /* AIParagraphStyleAdditions.m in Sources */,
633400A60F9C14C2003C77A9 /* AIPopUpButtonAdditions.m in Sources */,
@@ -12406,7 +12396,6 @@
"\"$(SRCROOT)/Frameworks\"",
"\"$(SRCROOT)/build/Debug\"",
- MACOSX_DEPLOYMENT_TARGET = 10.6;
@@ -12420,7 +12409,6 @@
"\"$(SRCROOT)/build/Debug\"",
GCC_PREPROCESSOR_DEFINITIONS = RELEASE_BUILD;
- MACOSX_DEPLOYMENT_TARGET = 10.6;
@@ -12437,7 +12425,6 @@
- MACOSX_DEPLOYMENT_TARGET = 10.6;
--- a/Frameworks/AIUtilities Framework/Source/AIAlternatingRowOutlineView.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIAlternatingRowOutlineView.h Sun Sep 09 12:24:39 2012 -0400
@@ -34,7 +34,7 @@
* Ignored if usesAlternatingRowBackgroundColors is NO.
-@property (readwrite, nonatomic, retain) NSColor *alternatingRowColor;
+@property (weak, readwrite, nonatomic) NSColor *alternatingRowColor; * @brief Whether the outlineView should draw its background
--- a/Frameworks/AIUtilities Framework/Source/AIAlternatingRowOutlineView.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIAlternatingRowOutlineView.m Sun Sep 09 12:24:39 2012 -0400
@@ -59,17 +59,9 @@
[self setUsesAlternatingRowBackgroundColors:NO];
drawsGradientSelection = NO;
- alternatingRowColor = [[NSColor colorWithCalibratedRed:(237.0f/255.0f) green:(243.0f/255.0f) blue:(254.0f/255.0f) alpha:1.0f] retain];
+ alternatingRowColor = [NSColor colorWithCalibratedRed:(237.0f/255.0f) green:(243.0f/255.0f) blue:(254.0f/255.0f) alpha:1.0f];
- [alternatingRowColor release];
//Configuring ----------------------------------------------------------------------
- (void)setDrawsGradientSelection:(BOOL)inDrawsGradientSelection
@@ -87,8 +79,7 @@
- (void)setAlternatingRowColor:(NSColor *)color
if (color != alternatingRowColor) {
- [alternatingRowColor release];
- alternatingRowColor = [color retain];
+ alternatingRowColor = color; [self setNeedsDisplay:YES];
--- a/Frameworks/AIUtilities Framework/Source/AIApplicationAdditions.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIApplicationAdditions.m Sun Sep 09 12:24:39 2012 -0400
@@ -16,12 +16,6 @@
#import "AIApplicationAdditions.h"
-// Make sure the version number defines exist; when compiling on 10.6, NSAppKitVersionNumber10_6 isn't defined
-#ifndef NSAppKitVersionNumber10_6
-#define NSAppKitVersionNumber10_6 1038
@implementation NSApplication (AIApplicationAdditions)
- (NSString *)applicationVersion
--- a/Frameworks/AIUtilities Framework/Source/AIArrayAdditions.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIArrayAdditions.h Sun Sep 09 12:24:39 2012 -0400
@@ -22,6 +22,5 @@
@interface NSMutableArray (ESArrayAdditions)
-- (void)addObjectsFromArrayIgnoringDuplicates:(NSArray *)inArray;
- (void)moveObject:(id)object toIndex:(NSUInteger)newIndex;
--- a/Frameworks/AIUtilities Framework/Source/AIArrayAdditions.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIArrayAdditions.m Sun Sep 09 12:24:39 2012 -0400
@@ -26,16 +26,7 @@
// Returns an array from the owners bundle with the specified name
+ (NSArray *)arrayNamed:(NSString *)name forClass:(Class)inClass
- ownerBundle = [NSBundle bundleForClass:inClass];
- arrayPath = [ownerBundle pathForResource:name ofType:@"plist"];
- return [[[NSArray alloc] initWithContentsOfFile:arrayPath] autorelease];
+ return [NSArray arrayWithContentsOfURL:[[NSBundle bundleForClass:inClass] URLForResource:name withExtension:@"plist"]]; - (NSComparisonResult)compare:(NSArray *)other
@@ -98,13 +89,6 @@
@implementation NSMutableArray (ESArrayAdditions)
-- (void)addObjectsFromArrayIgnoringDuplicates:(NSArray *)inArray
- for (id obj in inArray) {
- if (![self containsObject:obj]) [self addObject:obj];
- (void)moveObject:(id)object toIndex:(NSUInteger)newIndex
NSUInteger currentIndex = [self indexOfObject:object];
--- a/Frameworks/AIUtilities Framework/Source/AIAttributedStringAdditions.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIAttributedStringAdditions.m Sun Sep 09 12:24:39 2012 -0400
@@ -43,7 +43,6 @@
[self appendAttributedString:tempString];
- (NSUInteger)replaceOccurrencesOfString:(NSString *)target withString:(NSString*)replacement options:(NSStringCompareOptions)opts range:(NSRange)searchRange
@@ -85,8 +84,6 @@
- [replacementString release];
return numberOfReplacements;
@@ -289,7 +286,7 @@
if ([self length] && [self containsAttachments]) {
NSInteger currentLocation = 0;
- NSString *attachmentCharacterString = [NSString stringWithFormat:@"%C",NSAttachmentCharacter];
+ NSString *attachmentCharacterString = [NSString stringWithFormat:@"%C", (unichar)NSAttachmentCharacter]; attachmentRange = [[self string] rangeOfString:attachmentCharacterString
@@ -411,15 +408,15 @@
#define FONT_HEIGHT_STRING @"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789()"
+ (CGFloat)stringHeightForAttributes:(NSDictionary *)attributes
- NSAttributedString *string = [[[NSAttributedString alloc] initWithString:FONT_HEIGHT_STRING
- attributes:attributes] autorelease];
+ NSAttributedString *string = [[NSAttributedString alloc] initWithString:FONT_HEIGHT_STRING + attributes:attributes]; return [string heightWithWidth:1e7f];
+ (NSAttributedString *)stringWithString:(NSString *)inString
NSParameterAssert(inString != nil);
- return [[[NSAttributedString alloc] initWithString:inString] autorelease];
+ return [[NSAttributedString alloc] initWithString:inString]; + (NSAttributedString *)attributedStringWithString:(NSString *)inString linkRange:(NSRange)linkRange linkDestination:(id)inLink
@@ -432,7 +429,7 @@
NSParameterAssert(inLink != nil);
NSParameterAssert([inLink isKindOfClass:[NSURL class]]);
- NSMutableAttributedString *attributedString = [[[NSMutableAttributedString alloc] initWithString:inString] autorelease];
+ NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:inString]; //Throws NSInvalidArgumentException if the range is out-of-range.
[attributedString addAttribute:NSLinkAttributeName value:inLink range:linkRange];
@@ -449,7 +446,7 @@
NSParameterAssert([inLink isKindOfClass:[NSURL class]]);
NSDictionary *attributes = [NSDictionary dictionaryWithObject:inLink forKey:NSLinkAttributeName];
- return [[[self alloc] initWithString:inString attributes:attributes] autorelease];
+ return [[self alloc] initWithString:inString attributes:attributes]; - (CGFloat)heightWithWidth:(CGFloat)width
@@ -469,9 +466,6 @@
CGFloat height = [layoutManager usedRectForTextContainer:textContainer].size.height;
- [textContainer release];
- [layoutManager release];
@@ -500,7 +494,7 @@
* when the unarchiver is deallocated. We could rely upon autoreleasing the unarchiver, but it
* is cleaner to make the NSAttributedString autorelease itself.
- returnValue = (NSAttributedString *)[[[unarchiver decodeObject] retain] autorelease];
+ returnValue = (NSAttributedString *)[unarchiver decodeObject]; /* For reading previously stored NSData objects - we used to store them as RTF data, but that
@@ -508,11 +502,10 @@
* here isn't a speed problem. We previously used AIHTMLDecoder to handle Jaguar old-data unarchiving...
* but that's in Adium.framework and the cross over most certainly isn't worth it.
- returnValue = ([[[NSAttributedString alloc] initWithRTF:inData
- documentAttributes:nil] autorelease]);
+ returnValue = ([[NSAttributedString alloc] initWithRTF:inData + documentAttributes:nil]);
@@ -523,7 +516,7 @@
- (NSAttributedString *)attributedStringByConvertingAttachmentsToStrings
if ([self length] && [self containsAttachments]) {
- NSMutableAttributedString *newAttributedString = [[self mutableCopy] autorelease];
+ NSMutableAttributedString *newAttributedString = [self mutableCopy]; [newAttributedString convertAttachmentsToStringsUsingPlaceholder:AILocalizedString(@"<<Attachment>>", nil)];
return newAttributedString;
@@ -556,7 +549,7 @@
if (!newAttributedString) {
- newAttributedString = [[self mutableCopy] autorelease];
+ newAttributedString = [self mutableCopy]; currentAttributedString = newAttributedString;
@@ -588,7 +581,7 @@
- return (newAttributedString ? newAttributedString : [[self copy] autorelease]);
+ return (newAttributedString ? newAttributedString : [self copy]); - (NSAttributedString *)attributedStringByConvertingLinksToStrings
@@ -604,7 +597,7 @@
NSMutableAttributedString *str = [self mutableCopy];
[str addFormattingForLinks];
- return [str autorelease];
--- a/Frameworks/AIUtilities Framework/Source/AIAutoScrollView.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIAutoScrollView.m Sun Sep 09 12:24:39 2012 -0400
@@ -68,8 +68,6 @@
[[NSNotificationCenter defaultCenter] removeObserver:self
name:NSViewFrameDidChangeNotification
//Auto Scrolling ---------------------------------------------------------------
--- a/Frameworks/AIUtilities Framework/Source/AIBezierPathAdditions.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIBezierPathAdditions.m Sun Sep 09 12:24:39 2012 -0400
@@ -190,13 +190,13 @@
//these three return an autoreleased copy.
- (NSBezierPath *)bezierPathByFlippingHorizontally {
- return [[[self copy] autorelease] flipHorizontally];
+ return [[self copy] flipHorizontally]; - (NSBezierPath *)bezierPathByFlippingVertically {
- return [[[self copy] autorelease] flipVertically];
+ return [[self copy] flipVertically]; - (NSBezierPath *)bezierPathByScalingToSize:(NSSize)newSize {
- return [[[self copy] autorelease] scaleToSize:newSize];
+ return [[self copy] scaleToSize:newSize]; --- a/Frameworks/AIUtilities Framework/Source/AICharacterSetAdditions.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AICharacterSetAdditions.m Sun Sep 09 12:24:39 2012 -0400
@@ -29,7 +29,7 @@
- (NSCharacterSet *)immutableCopy
- return [[NSCharacterSet characterSetWithBitmapRepresentation:[self bitmapRepresentation]] retain];
+ return [NSCharacterSet characterSetWithBitmapRepresentation:[self bitmapRepresentation]]; --- a/Frameworks/AIUtilities Framework/Source/AIColorAdditions.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIColorAdditions.m Sun Sep 09 12:24:39 2012 -0400
@@ -82,17 +82,17 @@
} else if (ch[i] == '\n') {
if (state.prevChar != '\n') { //ignore blank lines
if ( ! ((state.redStart != NULL)
- && (state.greenStart != NULL)
- && (state.blueStart != NULL)
- && (state.nameStart != NULL)))
+ && (state.greenStart != NULL) + && (state.blueStart != NULL) + && (state.nameStart != NULL)))
NSLog(@"Parse error reading rgb.txt file: a non-comment line was encountered that did not have all four of red (%p), green (%p), blue (%p), and name (%p) - index is %u",
@@ -111,8 +111,8 @@
//only add the lowercase version if it isn't already defined
[mutableDict setObject:color forKey:lowercaseName];
- state.redStart = state.greenStart = state.blueStart = state.nameStart =
+ state.redStart = state.greenStart = state.blueStart = state.nameStart = state.redEnd = state.greenEnd = state.blueEnd = NULL;
} //if (prevChar != '\n')
} else if ((ch[i] != ' ') && (ch[i] != '\t')) {
@@ -135,14 +135,14 @@
} //for (unsigned i = 0; i < length; ++i)
//why not use -copy? because this is subclass-friendly.
//you can call this method on NSMutableDictionary and get a mutable dictionary back.
result = [[self alloc] initWithDictionary:mutableDict];
- return [result autorelease];
--- a/Frameworks/AIUtilities Framework/Source/AICompletingTextField.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AICompletingTextField.m Sun Sep 09 12:24:39 2012 -0400
@@ -76,14 +76,6 @@
- [impliedCompletionDictionary release];
//Sets the minimum string length required before completion kicks in
- (void)setMinStringLength:(int)length
@@ -98,10 +90,9 @@
//Set the strings that this field will use to auto-complete
- (void)setCompletingStrings:(NSArray *)strings
- stringSet = [[NSMutableSet setWithArray:strings] retain];
+ stringSet = [NSMutableSet setWithArray:strings]; - [impliedCompletionDictionary release]; impliedCompletionDictionary = nil;
+ impliedCompletionDictionary = nil; //Adds a string to the existing string list
@@ -218,8 +209,6 @@
NSArray *sortedArray = [possibleCompletions sortedArrayUsingSelector:@selector(compareLength:)];
- [possibleCompletions release];
if ([sortedArray count] > 0){
return [sortedArray objectAtIndex:0];
//When the AICompletingTextfield is modified to be able to provide multiple choices of completions, the entire array can be used later.
--- a/Frameworks/AIUtilities Framework/Source/AIDateFormatterAdditions.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIDateFormatterAdditions.m Sun Sep 09 12:24:39 2012 -0400
@@ -355,10 +355,10 @@
//build the strings for the parts
//Note: after checking with a linguistics student, it appears that we're fine leaving it as w, h, etc... rather than localizing.
- weeksString = [NSString stringWithFormat: @"%iw",weeks];
- daysString = [NSString stringWithFormat: @"%id",days];
- hoursString = [NSString stringWithFormat: @"%ih",hours];
- minutesString = [NSString stringWithFormat: @"%im",minutes];
+ weeksString = [NSString stringWithFormat: @"%liw",weeks]; + daysString = [NSString stringWithFormat: @"%lid",days]; + hoursString = [NSString stringWithFormat: @"%lih",hours]; + minutesString = [NSString stringWithFormat: @"%lim",minutes]; secondsString = [NSString stringWithFormat: @"%.0fs",seconds];
weeksString = (weeks == 1) ? ONE_WEEK : [NSString stringWithFormat:MULTIPLE_WEEKS, weeks];
@@ -468,7 +468,7 @@
[newFormat appendString:@"%Y"];
- [newFormat appendFormat:@"%%%iY", [span length]];
+ [newFormat appendFormat:@"%%%liY", [span length]]; --- a/Frameworks/AIUtilities Framework/Source/AIDictionaryAdditions.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIDictionaryAdditions.m Sun Sep 09 12:24:39 2012 -0400
@@ -109,8 +109,6 @@
NSLog(@"%s: Could not serialize. Error: \"%@\".", __PRETTY_FUNCTION__, retainedError);
[self validateAsPropertyList];
- if (retainedError) [retainedError release];
@@ -138,9 +136,8 @@
[mutable translate:translation add:addition remove:removal];
result = [[self class] dictionaryWithDictionary:mutable];
- result = [[self retain] autorelease];
@@ -207,7 +204,6 @@
NSMutableDictionary *mutableSelf = [self mutableCopy];
[mutableSelf intersectSetOfKeys:keys];
NSDictionary *result = [NSDictionary dictionaryWithDictionary:mutableSelf];
- (NSDictionary *)dictionaryWithDifferenceWithSetOfKeys:(NSSet *)keys
@@ -215,7 +211,6 @@
NSMutableDictionary *mutableSelf = [self mutableCopy];
[mutableSelf minusSetOfKeys:keys];
NSDictionary *result = [NSDictionary dictionaryWithDictionary:mutableSelf];
@@ -251,7 +246,6 @@
mutabilityOption:NSPropertyListMutableContainers
errorDescription:&error];
if (!dictionary && create) dictionary = [NSMutableDictionary dictionary];
@@ -276,8 +270,6 @@
//Add items that aren't in the removal set.
for (NSString *key in addition) {
if (!(removal && [removal containsObject:key])) {
--- a/Frameworks/AIUtilities Framework/Source/AIDockingWindow.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIDockingWindow.m Sun Sep 09 12:24:39 2012 -0400
@@ -16,7 +16,7 @@
#import "AIDockingWindow.h"
#import "AIEventAdditions.h"
-#import <AIUtilities/AIOSCompatibility.h>
#define WINDOW_DOCKING_DISTANCE 12 //Distance in pixels before the window is snapped to an edge
#define IGNORED_X_RESISTS 3
@@ -87,7 +87,6 @@
[[NSNotificationCenter defaultCenter] removeObserver:self
name:NSWindowDidMoveNotification
//Watch the window move. If it gets near an edge, dock it to that edge
--- a/Frameworks/AIUtilities Framework/Source/AIFileManagerAdditions.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIFileManagerAdditions.m Sun Sep 09 12:24:39 2012 -0400
@@ -153,11 +153,9 @@
- NSURL *folderURL = (NSURL *)CFURLCreateFromFSRef(kCFAllocatorSystemDefault, &folderRef);
+ NSURL *folderURL = (__bridge_transfer NSURL *)CFURLCreateFromFSRef(kCFAllocatorSystemDefault, &folderRef);
- [folderURL autorelease];
@@ -174,7 +172,7 @@
NSString *resolvedPath = nil;
- url = CFURLCreateWithFileSystemPath(/* allocator */ NULL, (CFStringRef)path,
+ url = CFURLCreateWithFileSystemPath(/* allocator */ NULL, (__bridge CFStringRef)path, kCFURLPOSIXPathStyle, /* isDir */ false);
@@ -184,7 +182,7 @@
&targetIsFolder, &wasAliased) == noErr && wasAliased) {
CFURLRef resolvedUrl = CFURLCreateFromFSRef(NULL, &fsRef);
- resolvedPath = [(NSString*)CFURLCopyFileSystemPath(resolvedUrl, kCFURLPOSIXPathStyle) autorelease];
+ resolvedPath = (__bridge_transfer NSString*)CFURLCopyFileSystemPath(resolvedUrl, kCFURLPOSIXPathStyle); @@ -192,7 +190,7 @@
- return (resolvedPath ? resolvedPath : [[path copy] autorelease]);
+ return (resolvedPath ? resolvedPath : [path copy]); --- a/Frameworks/AIUtilities Framework/Source/AIFlexibleLink.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIFlexibleLink.m Sun Sep 09 12:24:39 2012 -0400
@@ -23,19 +23,12 @@
if ((self = [super init])) {
trackingRect = inTrackingRect;
- title = [inTitle retain];
--- a/Frameworks/AIUtilities Framework/Source/AIFloater.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIFloater.m Sun Sep 09 12:24:39 2012 -0400
@@ -66,7 +66,7 @@
staticView = [[NSImageView alloc] initWithFrame:frame];
[staticView setImage:inImage];
[staticView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];
- [[panel contentView] addSubview:[staticView autorelease]];
+ [[panel contentView] addSubview:staticView]; @@ -98,11 +98,9 @@
- (IBAction)close:(id)sender
- [fadeAnimation stopAnimation]; [fadeAnimation release]; fadeAnimation = nil;
+ [fadeAnimation stopAnimation]; fadeAnimation = nil; - [panel release]; panel = nil;
- (void)setMaxOpacity:(CGFloat)inMaxOpacity
--- a/Frameworks/AIUtilities Framework/Source/AIGenericViewCell.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIGenericViewCell.m Sun Sep 09 12:24:39 2012 -0400
@@ -24,17 +24,10 @@
@implementation AIGenericViewCell
- [embeddedView release];
- (void)setEmbeddedView:(NSView *)inView
if (embeddedView != inView) {
- [embeddedView release];
- embeddedView = [inView retain];
@@ -42,7 +35,7 @@
- (id)copyWithZone:(NSZone *)zone
AIGenericViewCell *newCell = [super copyWithZone:zone];
- newCell->embeddedView = [embeddedView retain];
+ newCell->embeddedView = embeddedView; @@ -75,7 +68,7 @@
NSRect frame = [embeddedView frame];
NSRect usableFrame = NSMakeRect(0,0,frame.size.width,frame.size.height);
- image = [[[NSImage alloc] initWithSize:frame.size] autorelease];
+ image = [[NSImage alloc] initWithSize:frame.size]; [embeddedView setNeedsDisplay:YES];
[embeddedView drawRect:usableFrame];
@@ -86,7 +79,7 @@
NSRect subUsableFrame = NSMakeRect(0, 0, subFrame.size.width, subFrame.size.height);
- NSImage *subImage = [[[NSImage alloc] initWithSize:subFrame.size] autorelease];
+ NSImage *subImage = [[NSImage alloc] initWithSize:subFrame.size]; [subView drawRect:subUsableFrame];
--- a/Frameworks/AIUtilities Framework/Source/AIHighlightingTextField.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIHighlightingTextField.h Sun Sep 09 12:24:39 2012 -0400
@@ -25,11 +25,11 @@
@interface AIHighlightingTextField : NSTextField
- AIPreferencePane *pane;
+ __weak AIPreferencePane *pane; @property (assign, nonatomic) BOOL selected;
-@property (assign) AIPreferencePane *pane;
+@property (weak) AIPreferencePane *pane; - (void)setString:(NSString *)aString withPane:(AIPreferencePane *)aPane;
--- a/Frameworks/AIUtilities Framework/Source/AIHighlightingTextField.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIHighlightingTextField.m Sun Sep 09 12:24:39 2012 -0400
@@ -54,12 +54,11 @@
NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:aString];
- NSMutableParagraphStyle *mutParaStyle = [[[NSMutableParagraphStyle alloc] init] autorelease];
+ NSMutableParagraphStyle *mutParaStyle = [[NSMutableParagraphStyle alloc] init]; [mutParaStyle setFirstLineHeadIndent:15.0];
[attrStr addAttributes:[NSDictionary dictionaryWithObject:mutParaStyle forKey:NSParagraphStyleAttributeName]
range:NSMakeRange(0,[attrStr length])];
[super setObjectValue:attrStr];
--- a/Frameworks/AIUtilities Framework/Source/AIHostReachabilityMonitor.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIHostReachabilityMonitor.m Sun Sep 09 12:24:39 2012 -0400
@@ -90,18 +90,14 @@
[hostAndObserverListLock lock];
- [hosts release]; hosts = nil;
- [observers release]; observers = nil;
- [reachabilities release]; reachabilities = nil;
- [unconfiguredHostsAndObservers release]; unconfiguredHostsAndObservers = nil;
+ unconfiguredHostsAndObservers = nil; [hostAndObserverListLock unlock];
- [hostAndObserverListLock release];
[[NSNotificationCenter defaultCenter] removeObserver:self];
@@ -118,7 +114,6 @@
NSString *hostCopy = [host copy];
[self scheduleReachabilityMonitoringForHost:hostCopy
@@ -142,7 +137,7 @@
if ((!host) || ([host isEqualToString:[hosts objectAtIndex:i]])) {
[hosts removeObjectAtIndex:i];
[observers removeObjectAtIndex:i];
- SCNetworkReachabilityScheduleWithRunLoop((SCNetworkReachabilityRef)[reachabilities objectAtIndex:i],
+ SCNetworkReachabilityScheduleWithRunLoop((__bridge SCNetworkReachabilityRef)[reachabilities objectAtIndex:i], [reachabilities removeObjectAtIndex:i];
@@ -209,7 +204,7 @@
[hostAndObserverListLock lock];
- NSUInteger i = [reachabilities indexOfObjectIdenticalTo:(id)reachability];
+ NSUInteger i = [reachabilities indexOfObjectIdenticalTo:(__bridge id)reachability]; NSString *host = [hosts objectAtIndex:i];
id <AIHostReachabilityObserver> observer = [observers objectAtIndex:i];
@@ -221,7 +216,7 @@
if (![host isEqualToString:[hosts objectAtIndex:idx]])
- SCNetworkReachabilityRef otherReachability = (SCNetworkReachabilityRef)[reachabilities objectAtIndex:idx];
+ SCNetworkReachabilityRef otherReachability = (__bridge SCNetworkReachabilityRef)[reachabilities objectAtIndex:idx]; SCNetworkConnectionFlags flags;
if (SCNetworkReachabilityGetFlags(otherReachability, &flags)
@@ -261,7 +256,7 @@
(flags & kSCNetworkFlagsIsDirect) ? 'd' : '-');
- AIHostReachabilityMonitor *self = info;
+ AIHostReachabilityMonitor *self = (__bridge AIHostReachabilityMonitor *)info; [self reachabilityChanged:target];
@@ -272,7 +267,7 @@
static void hostResolvedCallback(CFHostRef theHost, CFHostInfoType typeInfo, const CFStreamError *error, void *info)
- NSDictionary *infoDict = info;
+ NSDictionary *infoDict = (__bridge NSDictionary *)info; AIHostReachabilityMonitor *self = [infoDict objectForKey:@"self"];
id observer = [infoDict objectForKey:@"observer"];
NSString *host = [infoDict objectForKey:@"host"];
@@ -293,7 +288,7 @@
// Only add 1 observer for IPv6 and one for IPv4.
BOOL addedIPv4 = NO, addedIPv6 = NO;
- for (NSData *saData in (NSArray *)addresses) {
+ for (NSData *saData in (__bridge NSArray *)addresses) { struct sockaddr *remoteAddr = (struct sockaddr *)saData.bytes;
if ((remoteAddr->sa_family == AF_INET && addedIPv4) || (remoteAddr->sa_family == AF_INET6 && addedIPv6)) {
@@ -308,7 +303,7 @@
SCNetworkReachabilityRef reachabilityRef;
SCNetworkReachabilityContext reachabilityContext = {
+ .info = (__bridge void *)self, .copyDescription = CFCopyDescription,
@@ -340,7 +335,7 @@
//Note that we succesfully configured for reachability notifications
- [self gotReachabilityRef:(SCNetworkReachabilityRef)[(NSObject *)reachabilityRef autorelease]
+ [self gotReachabilityRef:(SCNetworkReachabilityRef)reachabilityRef @@ -351,7 +346,7 @@
hostReachabilityChangedCallback(reachabilityRef,
+ (__bridge void *)self); /* Perform an immediate reachability check, since we've just scheduled checks for future changes
@@ -360,12 +355,12 @@
CFHostClientContext hostContext = {
- .info = [NSDictionary dictionaryWithObjectsAndKeys:
+ .info = (__bridge void *)([NSDictionary dictionaryWithObjectsAndKeys: [NSValue valueWithPointer:reachabilityRef], @"reachabilityRef",
.copyDescription = CFCopyDescription,
@@ -391,9 +386,9 @@
//Call the reachability changed callback directly
- hostReachabilityChangedCallback((SCNetworkReachabilityRef)[infoDict objectForKey:@"reachabilityRef"],
+ hostReachabilityChangedCallback((__bridge SCNetworkReachabilityRef)[infoDict objectForKey:@"reachabilityRef"],
+ (__bridge void *)self); //No further need for this CFHost to be in our run loop
CFHostUnscheduleFromRunLoop(theHost,
@@ -419,7 +414,7 @@
[observers addObject:observer];
- [reachabilities addObject:(id)reachabilityRef];
+ [reachabilities addObject:(__bridge id)reachabilityRef]; //Remove from our unconfigured array
[self removeUnconfiguredHost:host
@@ -446,17 +441,17 @@
//Resolve the remote host domain name to an IP asynchronously
CFHostClientContext hostContext = {
- .info = [NSDictionary dictionaryWithObjectsAndKeys:
+ .info = (__bridge void *)([NSDictionary dictionaryWithObjectsAndKeys:
.copyDescription = CFCopyDescription,
CFHostRef host = CFHostCreateWithName(kCFAllocatorDefault,
- (CFStringRef)nodename);
+ (__bridge CFStringRef)nodename); @@ -569,7 +564,7 @@
static void localIPsChangedCallback(SCDynamicStoreRef store, CFArrayRef changedKeys, void *info)
- AIHostReachabilityMonitor *self = info;
+ AIHostReachabilityMonitor *self = (__bridge AIHostReachabilityMonitor *)info; /* Wait one second after receiving the callback, as it seems to be sent in some cases the middle of the change
* rather than after it is complete.
@@ -594,7 +589,7 @@
//Create the CFRunLoopSourceRef we will want to add to our run loop to have
//localIPsChangedCallback() called when the IP list changes
status = CreateIPAddressListChangeCallbackSCF(localIPsChangedCallback,
+ (__bridge void *)(self), &ipChangesRunLoopSourceRef);
@@ -639,7 +634,7 @@
NSArray *oldObservers = [observers copy];
[reachabilities enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
- SCNetworkReachabilityUnscheduleFromRunLoop((SCNetworkReachabilityRef)obj,
+ SCNetworkReachabilityUnscheduleFromRunLoop((__bridge SCNetworkReachabilityRef)obj, @@ -658,9 +653,6 @@
[self addObserver:observer
- [oldObservers release];
--- a/Frameworks/AIUtilities Framework/Source/AIImageAdditions.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIImageAdditions.m Sun Sep 09 12:24:39 2012 -0400
@@ -119,7 +119,7 @@
NSSize size = [self size];
// Work with a temporary image so we don't modify self
- tempImage = [[[NSImage allocWithZone:[self zone]] initWithSize:size] autorelease];
+ tempImage = [[NSImage alloc] initWithSize:size]; // Lock before drawing to the temporary image
@@ -297,7 +297,7 @@
NSSize size = [self size];
NSRect rect = NSMakeRect(0.0f, 0.0f, size.width, size.height);
- NSBitmapImageRep *bm = [[[NSBitmapImageRep alloc] initWithFocusedViewRect:rect] autorelease];
+ NSBitmapImageRep *bm = [[NSBitmapImageRep alloc] initWithFocusedViewRect:rect]; @@ -338,7 +338,7 @@
NSUInteger height = ((CGFloat)imageRep.pixelsWide - 100.0f)*ratio;
// Create a new rep with the lowered size
- NSBitmapImageRep *newImageRep = [[[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL
+ NSBitmapImageRep *newImageRep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL bitsPerSample:imageRep.bitsPerSample
@@ -347,7 +347,7 @@
isPlanar:imageRep.isPlanar
colorSpaceName:NSCalibratedRGBColorSpace
bytesPerRow:imageRep.bytesPerRow
- bitsPerPixel:imageRep.bitsPerPixel] autorelease];
+ bitsPerPixel:imageRep.bitsPerPixel]; // Draw the old rep into the new rep
[NSGraphicsContext saveGraphicsState];
--- a/Frameworks/AIUtilities Framework/Source/AIImageButton.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIImageButton.m Sun Sep 09 12:24:39 2012 -0400
@@ -37,7 +37,7 @@
- (id)copyWithZone:(NSZone *)zone
AIImageButton *newButton = [super copyWithZone:zone];
- newButton->imageFloater = [imageFloater retain];
+ newButton->imageFloater = imageFloater; [newButton setCornerRadius:[self cornerRadius]];
@@ -46,9 +46,6 @@
[imageFloater close:nil];
- [imageFloater release];
@@ -84,7 +81,6 @@
[imageFloater close:nil];
- [imageFloater release];
@@ -103,7 +99,6 @@
[roundedImage unlockFocus];
[self setImage:roundedImage];
- [roundedImage release];
/* If the image would go off the right side of the screen from its origin, shift the origin left
@@ -114,7 +109,7 @@
- imageFloater = [[AIFloater newFloaterWithImage:bigImage styleMask:NSBorderlessWindowMask] retain];
+ imageFloater = [AIFloater newFloaterWithImage:bigImage styleMask:NSBorderlessWindowMask]; [imageFloater setMaxOpacity:1.0f];
[imageFloater moveFloaterToPoint:point];
[imageFloater setVisible:YES animate:NO];
@@ -145,7 +140,7 @@
if (!imageFloaterShouldBeOpen) {
[imageFloater close:nil];
- [imageFloater release]; imageFloater = nil;
--- a/Frameworks/AIUtilities Framework/Source/AIImageCollectionView.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIImageCollectionView.h Sun Sep 09 12:24:39 2012 -0400
@@ -28,10 +28,10 @@
@interface AIImageCollectionView : NSCollectionView {
- id <AIImageCollectionViewDelegate> delegate;
+ id <AIImageCollectionViewDelegate> __weak delegate; - IBOutlet NSArrayController *itemsController;
+ IBOutlet NSArrayController *__weak itemsController; NSInteger highlightStyle;
@@ -40,9 +40,9 @@
NSUInteger highlightedIndex;
-@property (readwrite, assign, nonatomic) id <AIImageCollectionViewDelegate> delegate;
+@property (readwrite, weak, nonatomic) id <AIImageCollectionViewDelegate> delegate; -@property (assign) IBOutlet NSArrayController *itemsController;
+@property (weak) IBOutlet NSArrayController *itemsController; @property (assign) NSInteger highlightStyle;
@property (assign) CGFloat highlightSize;
--- a/Frameworks/AIUtilities Framework/Source/AIImageCollectionView.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIImageCollectionView.m Sun Sep 09 12:24:39 2012 -0400
@@ -69,20 +69,20 @@
highlightedIndex = NSNotFound;
- [self addTrackingArea:[[[NSTrackingArea alloc] initWithRect:[self bounds]
+ [self addTrackingArea:[[NSTrackingArea alloc] initWithRect:[self bounds] options:(NSTrackingMouseEnteredAndExited |
NSTrackingActiveInKeyWindow |
- userInfo:nil] autorelease]];
// Temporary solution, 1st tracking area will only report MouseMoved Events
- [self addTrackingArea:[[[NSTrackingArea alloc] initWithRect:[self bounds]
+ [self addTrackingArea:[[NSTrackingArea alloc] initWithRect:[self bounds] options:(NSTrackingMouseMoved |
NSTrackingActiveInKeyWindow |
- userInfo:nil] autorelease]];
// Track for item's selection changes
[self addObserver:self forKeyPath:@"selectionIndexes"
@@ -99,8 +99,6 @@
[self removeObserver:self forKeyPath:@"selectionIndexes"];
[self removeObserver:self forKeyPath:@"content"];
- (void)drawRect:(NSRect)dirtyRect
--- a/Frameworks/AIUtilities Framework/Source/AIImageDrawingAdditions.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIImageDrawingAdditions.m Sun Sep 09 12:24:39 2012 -0400
@@ -94,7 +94,7 @@
// Proceed only if size or delta are changing
if ((NSEqualSizes(originalSize, size)) && (delta == 1.0) && !flipImage) {
- return [[self copy] autorelease];
@@ -161,9 +161,6 @@
// Write GIF Extension Blocks
[self writeGIFExtensionBlocksInData:GIFRepresentationData forRepresenation:(NSBitmapImageRep *)bestRep];
- //You must release before you re-allocate. The data is retained in an autorelease loop in the images array.
newImage = [[NSImage alloc] initWithData:GIFRepresentationData];
@@ -178,7 +175,7 @@
- return [newImage autorelease];
@@ -195,7 +192,7 @@
// Proceed only if size or delta are changing
if ((NSEqualSizes(originalSize, size)) && (delta == 1.0) && !flipImage) {
- return [[self copy] autorelease];
// Scale proportionally (rather than stretching to fit) if requested and needed
@@ -282,9 +279,6 @@
// Write GIF Extension Blocks
[self writeGIFExtensionBlocksInData:GIFRepresentationData forRepresenation:(NSBitmapImageRep *)bestRep];
- // Release before you re-allocate.
newImage = [[NSImage alloc] initWithData:GIFRepresentationData];
@@ -310,9 +304,7 @@
- return [newImage autorelease];
--- a/Frameworks/AIUtilities Framework/Source/AIImageTextCell.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIImageTextCell.m Sun Sep 09 12:24:39 2012 -0400
@@ -46,15 +46,6 @@
- [font release]; font = nil;
- (id)copyWithZone:(NSZone *)zone
@@ -98,8 +89,7 @@
- (void)setFont:(NSFont *)inFont
- font = [inFont retain];
@@ -112,8 +102,7 @@
- (void)setSubString:(NSString *)inSubString
if (subString != inSubString) {
- subString = [inSubString retain];
+ subString = inSubString; @@ -422,8 +411,6 @@
[NSGraphicsContext restoreGraphicsState];
- [attributedMainString release];
NSAffineTransform *subStringTranslation = [NSAffineTransform transform];
@@ -433,7 +420,6 @@
[attributedSubString drawInRect:cellFrame];
- [attributedSubString release];
[NSGraphicsContext restoreGraphicsState];
--- a/Frameworks/AIUtilities Framework/Source/AIImageViewWithImagePicker.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIImageViewWithImagePicker.h Sun Sep 09 12:24:39 2012 -0400
@@ -26,7 +26,7 @@
- id activeRecentPicture;
+ id __weak activeRecentPicture; BOOL presentPictureTakerAsSheet;
@@ -40,10 +40,10 @@
-@property (readwrite, assign, nonatomic) IBOutlet id delegate;
+@property (readwrite, nonatomic) IBOutlet id delegate; -@property (retain) NSString *title;
-@property (assign) id activeRecentPicture;
+@property (weak) NSString *title; +@property (weak) id activeRecentPicture; @property (assign) BOOL usePictureTaker;
@property (assign) BOOL presentPictureTakerAsSheet;
@property (assign) BOOL shouldUpdateRecentRepository;
--- a/Frameworks/AIUtilities Framework/Source/AIImageViewWithImagePicker.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIImageViewWithImagePicker.m Sun Sep 09 12:24:39 2012 -0400
@@ -115,17 +115,10 @@
- [activeRecentPicture release];
- [pictureTaker release], pictureTaker = nil;
#pragma mark Getters and Setters
@@ -144,7 +137,7 @@
[pictureTaker setInputImage:inImage];
- [activeRecentPicture release], activeRecentPicture = nil;
+ activeRecentPicture = nil; @@ -156,8 +149,7 @@
- (void)setTitle:(NSString *)inTitle
- title = [inTitle retain];
[pictureTaker setTitle:title];
@@ -278,7 +270,6 @@
@@ -362,7 +353,7 @@
- (void)concludeDragOperation:(id <NSDraggingInfo>)sender
- NSImage *droppedImage = [[[NSImage alloc] initWithPasteboard:[sender draggingPasteboard]] autorelease];
+ NSImage *droppedImage = [[NSImage alloc] initWithPasteboard:[sender draggingPasteboard]]; @@ -447,7 +438,7 @@
NSData *imageData = (type ? [pb dataForType:type] : nil);
- NSImage *image = [[[NSImage alloc] initWithData:imageData] autorelease];
+ NSImage *image = [[NSImage alloc] initWithData:imageData]; NSSize imageSize = [image size];
@@ -551,7 +542,7 @@
- pictureTaker = [[IKPictureTaker pictureTaker] retain];
+ pictureTaker = [IKPictureTaker pictureTaker]; [pictureTaker setDelegate:self];
@@ -606,7 +597,7 @@
imageData = [NSData dataWithContentsOfURL:[[openPanel URLs] objectAtIndex:0]];
- image = (imageData ? [[[NSImage alloc] initWithData:imageData] autorelease] : nil);
+ image = (imageData ? [[NSImage alloc] initWithData:imageData] : nil); imageSize = (image ? [image size] : NSZeroSize);
if ((maxSize.width > 0 && imageSize.width > maxSize.width) ||
@@ -643,7 +634,7 @@
- (void)setRecentPictureAsImageInput:(IKPictureTakerRecentPicture *)recentPicture
if (activeRecentPicture != recentPicture) {
- [activeRecentPicture release]; activeRecentPicture = [recentPicture retain];
+ activeRecentPicture = recentPicture; //Update any open picture taker immediately.
--- a/Frameworks/AIUtilities Framework/Source/AIKeychain.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIKeychain.m Sun Sep 09 12:24:39 2012 -0400
@@ -100,26 +100,25 @@
+ (BOOL)unlockDefaultKeychainWithPassword:(NSString *)password error:(out NSError **)outError
NSData *data = [password dataUsingEncoding:NSUTF8StringEncoding];
NSAssert( UINT_MAX >= [data length], @"Attempting to send more data than Keychain can handle. Abort." );
OSStatus err = SecKeychainUnlock(/* keychain */ NULL, (UInt32)[data length], [data bytes], /* usePassword */ true);
NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys:
- [NSValue valueWithPointer:SecKeychainUnlock], AIKEYCHAIN_ERROR_USERINFO_SECURITYFUNCTION,
- @"SecKeychainUnlock", AIKEYCHAIN_ERROR_USERINFO_SECURITYFUNCTIONNAME,
- AI_LOCALIZED_SECURITY_ERROR_DESCRIPTION(err), AIKEYCHAIN_ERROR_USERINFO_ERRORDESCRIPTION,
+ [NSValue valueWithPointer:SecKeychainUnlock], AIKEYCHAIN_ERROR_USERINFO_SECURITYFUNCTION, + @"SecKeychainUnlock", AIKEYCHAIN_ERROR_USERINFO_SECURITYFUNCTIONNAME, + AI_LOCALIZED_SECURITY_ERROR_DESCRIPTION(err), AIKEYCHAIN_ERROR_USERINFO_ERRORDESCRIPTION, error = [NSError errorWithDomain:AIKEYCHAIN_ERROR_DOMAIN code:err userInfo:userInfo];
@@ -247,13 +246,12 @@
if (!lastKnownDefaultKeychain ||
([lastKnownDefaultKeychain keychainRef] && (aKeychainRef != [lastKnownDefaultKeychain keychainRef]))) {
- [lastKnownDefaultKeychain release];
lastKnownDefaultKeychain = [[self alloc] init];
- return [[lastKnownDefaultKeychain retain] autorelease];
+ return lastKnownDefaultKeychain; NSLog(@"No default keychain!");
@@ -283,8 +281,7 @@
- [lastKnownDefaultKeychain release];
- lastKnownDefaultKeychain = [newDefaultKeychain retain];
+ lastKnownDefaultKeychain = newDefaultKeychain; @@ -292,7 +289,7 @@
+ (AIKeychain *)keychainWithContentsOfFile:(NSString *)path error:(out NSError **)outError
- return [[[self alloc] initWithContentsOfFile:path error:outError] autorelease];
+ return [[self alloc] initWithContentsOfFile:path error:outError]; - (id)initWithContentsOfFile:(NSString *)path error:(out NSError **)outError
@@ -316,7 +313,7 @@
- [self release], self = nil;
@@ -327,7 +324,7 @@
+ (AIKeychain *)keychainWithPath:(NSString *)path password:(NSString *)password promptUser:(BOOL)prompt initialAccess:(SecAccessRef)initialAccess error:(out NSError **)outError
- return [[[self alloc] initWithPath:path password:password promptUser:prompt initialAccess:initialAccess error:outError] autorelease];
+ return [[self alloc] initWithPath:path password:password promptUser:prompt initialAccess:initialAccess error:outError]; - (id)initWithPath:(NSString *)path password:(NSString *)password promptUser:(BOOL)prompt initialAccess:(SecAccessRef)initialAccess error:(out NSError **)outError
@@ -337,39 +334,37 @@
* We create our own pool to ensure that both objects are released ASAP.
void *passwordBytes = NULL;
u_int32_t passwordLength = 0;
NSData *data = [password dataUsingEncoding:NSUTF8StringEncoding];
passwordBytes = (void *)[data bytes];
NSAssert( UINT_MAX >= [data length], @"Attempting to send more data than Keychain can handle. Abort." );
passwordLength = (UInt32)[data length];
OSStatus err = SecKeychainCreate([path fileSystemRepresentation], passwordLength, passwordBytes, prompt, initialAccess, &keychainRef);
NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys:
- [NSValue valueWithPointer:SecKeychainCreate], AIKEYCHAIN_ERROR_USERINFO_SECURITYFUNCTION,
- @"SecKeychainCreate", AIKEYCHAIN_ERROR_USERINFO_SECURITYFUNCTIONNAME,
- AI_LOCALIZED_SECURITY_ERROR_DESCRIPTION(err), AIKEYCHAIN_ERROR_USERINFO_ERRORDESCRIPTION,
+ [NSValue valueWithPointer:SecKeychainCreate], AIKEYCHAIN_ERROR_USERINFO_SECURITYFUNCTION, + @"SecKeychainCreate", AIKEYCHAIN_ERROR_USERINFO_SECURITYFUNCTIONNAME, + AI_LOCALIZED_SECURITY_ERROR_DESCRIPTION(err), AIKEYCHAIN_ERROR_USERINFO_ERRORDESCRIPTION, error = [NSError errorWithDomain:AIKEYCHAIN_ERROR_DOMAIN code:err userInfo:userInfo];
@@ -377,7 +372,7 @@
+ (AIKeychain *)keychainWithKeychainRef:(SecKeychainRef)newKeychainRef
- return [[[self alloc] initWithKeychainRef:newKeychainRef] autorelease];
+ return [[self alloc] initWithKeychainRef:newKeychainRef]; - (id)initWithKeychainRef:(SecKeychainRef)newKeychainRef
@@ -584,29 +579,29 @@
- (BOOL)unlockKeychainWithPassword:(NSString *)password error:(out NSError **)outError
NSData *data = [password dataUsingEncoding:NSUTF8StringEncoding];
// If keychainRef is NULL, the default keychain will unlocked
NSAssert( UINT_MAX >= [data length], @"Attempting to send more data than Keychain can handle. Abort." );
OSStatus err = SecKeychainUnlock(keychainRef, (UInt32)[data length], [data bytes], /* usePassword */ true);
NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys:
- [NSValue valueWithPointer:SecKeychainUnlock], AIKEYCHAIN_ERROR_USERINFO_SECURITYFUNCTION,
- @"SecKeychainUnlock", AIKEYCHAIN_ERROR_USERINFO_SECURITYFUNCTIONNAME,
- AI_LOCALIZED_SECURITY_ERROR_DESCRIPTION(err), AIKEYCHAIN_ERROR_USERINFO_ERRORDESCRIPTION,
- [NSValue valueWithPointer:keychainRef], AIKEYCHAIN_ERROR_USERINFO_KEYCHAIN,
+ [NSValue valueWithPointer:SecKeychainUnlock], AIKEYCHAIN_ERROR_USERINFO_SECURITYFUNCTION, + @"SecKeychainUnlock", AIKEYCHAIN_ERROR_USERINFO_SECURITYFUNCTIONNAME, + AI_LOCALIZED_SECURITY_ERROR_DESCRIPTION(err), AIKEYCHAIN_ERROR_USERINFO_ERRORDESCRIPTION, + [NSValue valueWithPointer:keychainRef], AIKEYCHAIN_ERROR_USERINFO_KEYCHAIN, error = [NSError errorWithDomain:AIKEYCHAIN_ERROR_DOMAIN code:err userInfo:userInfo];
@@ -666,61 +661,63 @@
NSParameterAssert(password != nil);
NSParameterAssert(server != nil);
- NSData *passwordData = [password dataUsingEncoding:NSUTF8StringEncoding];
- NSData *serverData = [server dataUsingEncoding:NSUTF8StringEncoding];
- NSData *domainData = [domain dataUsingEncoding:NSUTF8StringEncoding];
- NSData *accountData = [account dataUsingEncoding:NSUTF8StringEncoding];
- NSData *pathData = [path dataUsingEncoding:NSUTF8StringEncoding];
- NSAssert( (UINT_MAX >= [passwordData length]) &&
- (UINT_MAX >= [serverData length]) &&
- (UINT_MAX >= [domainData length]) &&
- (UINT_MAX >= [accountData length]) &&
- (UINT_MAX >= [pathData length]),
- @"Attempting to send more data than Keychain can handle. Abort." );
- // If keychainRef is NNULL, the password will be added to the default keychain
- OSStatus err = SecKeychainAddInternetPassword(keychainRef,
- (UInt32)[serverData length], [serverData bytes],
- // Domain is optional, so be sure to handle domain == nil
- domainData ? (UInt32)[domainData length] : 0,
- domainData ? [domainData bytes] : NULL,
- // Account appears optional, even though it isn't so documented
- accountData ? (UInt32)[accountData length] : 0,
- accountData ? [accountData bytes] : NULL,
- // Path appears optional, even though it isn't so documented
- pathData ? (UInt32)[pathData length] : 0,
- pathData ? [pathData bytes] : NULL,
- (UInt32)[passwordData length], [passwordData bytes],
- NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys:
- [NSValue valueWithPointer:SecKeychainAddInternetPassword], AIKEYCHAIN_ERROR_USERINFO_SECURITYFUNCTION,
- @"SecKeychainAddInternetPassword", AIKEYCHAIN_ERROR_USERINFO_SECURITYFUNCTIONNAME,
- AI_LOCALIZED_SECURITY_ERROR_DESCRIPTION(err), AIKEYCHAIN_ERROR_USERINFO_ERRORDESCRIPTION,
- server, AIKEYCHAIN_ERROR_USERINFO_SERVER,
- domain, AIKEYCHAIN_ERROR_USERINFO_DOMAIN,
- account, AIKEYCHAIN_ERROR_USERINFO_ACCOUNT,
- NSFileTypeForHFSTypeCode(protocol), AIKEYCHAIN_ERROR_USERINFO_PROTOCOL,
- NSFileTypeForHFSTypeCode(authType), AIKEYCHAIN_ERROR_USERINFO_AUTHENTICATIONTYPE,
- [NSValue valueWithPointer:keychainRef], AIKEYCHAIN_ERROR_USERINFO_KEYCHAIN,
- error = [NSError errorWithDomain:AIKEYCHAIN_ERROR_DOMAIN code:err userInfo:userInfo];
+ NSData *passwordData = [password dataUsingEncoding:NSUTF8StringEncoding]; + NSData *serverData = [server dataUsingEncoding:NSUTF8StringEncoding]; + NSData *domainData = [domain dataUsingEncoding:NSUTF8StringEncoding]; + NSData *accountData = [account dataUsingEncoding:NSUTF8StringEncoding]; + NSData *pathData = [path dataUsingEncoding:NSUTF8StringEncoding]; + NSAssert( (UINT_MAX >= [passwordData length]) && + (UINT_MAX >= [serverData length]) && + (UINT_MAX >= [domainData length]) && + (UINT_MAX >= [accountData length]) && + (UINT_MAX >= [pathData length]), + @"Attempting to send more data than Keychain can handle. Abort." ); + // If keychainRef is NNULL, the password will be added to the default keychain + OSStatus err = SecKeychainAddInternetPassword(keychainRef, + (UInt32)[serverData length], [serverData bytes], + // Domain is optional, so be sure to handle domain == nil + domainData ? (UInt32)[domainData length] : 0, + domainData ? [domainData bytes] : NULL, + // Account appears optional, even though it isn't so documented + accountData ? (UInt32)[accountData length] : 0, + accountData ? [accountData bytes] : NULL, + // Path appears optional, even though it isn't so documented + pathData ? (UInt32)[pathData length] : 0, + pathData ? [pathData bytes] : NULL, + (UInt32)[passwordData length], [passwordData bytes], + NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys: + [NSValue valueWithPointer:SecKeychainAddInternetPassword], AIKEYCHAIN_ERROR_USERINFO_SECURITYFUNCTION, + @"SecKeychainAddInternetPassword", AIKEYCHAIN_ERROR_USERINFO_SECURITYFUNCTIONNAME, + AI_LOCALIZED_SECURITY_ERROR_DESCRIPTION(err), AIKEYCHAIN_ERROR_USERINFO_ERRORDESCRIPTION, + server, AIKEYCHAIN_ERROR_USERINFO_SERVER, + domain, AIKEYCHAIN_ERROR_USERINFO_DOMAIN, + account, AIKEYCHAIN_ERROR_USERINFO_ACCOUNT, + NSFileTypeForHFSTypeCode(protocol), AIKEYCHAIN_ERROR_USERINFO_PROTOCOL, + NSFileTypeForHFSTypeCode(authType), AIKEYCHAIN_ERROR_USERINFO_AUTHENTICATIONTYPE, + [NSValue valueWithPointer:keychainRef], AIKEYCHAIN_ERROR_USERINFO_KEYCHAIN, + error = [NSError errorWithDomain:AIKEYCHAIN_ERROR_DOMAIN code:err userInfo:userInfo];
- (BOOL)addInternetPassword:(NSString *)password forServer:(NSString *)server account:(NSString *)account protocol:(SecProtocolType)protocol error:(out NSError **)outError
@@ -946,7 +943,7 @@
SecKeychainItemRef item = NULL;
[self findInternetPasswordForServer:server
@@ -956,17 +953,16 @@
authenticationType:authType
- [(NSObject *)item autorelease]; // Might as well
// Retain this because of the autorelease pool
- *outError = [error retain];
NSData *passwordData = [password dataUsingEncoding:NSUTF8StringEncoding];
NSAssert( UINT_MAX >= [passwordData length], @"Attempting to send more data than Keychain can handle. Abort." );
err = SecKeychainItemModifyAttributesAndData(item,
@@ -977,28 +973,26 @@
NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys:
- [NSValue valueWithPointer:SecKeychainItemModifyAttributesAndData], AIKEYCHAIN_ERROR_USERINFO_SECURITYFUNCTION,
- @"SecKeychainItemModifyAttributesAndData", AIKEYCHAIN_ERROR_USERINFO_SECURITYFUNCTIONNAME,
- AI_LOCALIZED_SECURITY_ERROR_DESCRIPTION(err), AIKEYCHAIN_ERROR_USERINFO_ERRORDESCRIPTION,
- server, AIKEYCHAIN_ERROR_USERINFO_SERVER,
- domain, AIKEYCHAIN_ERROR_USERINFO_DOMAIN,
- account, AIKEYCHAIN_ERROR_USERINFO_ACCOUNT,
- NSFileTypeForHFSTypeCode(protocol), AIKEYCHAIN_ERROR_USERINFO_PROTOCOL,
- NSFileTypeForHFSTypeCode(authType), AIKEYCHAIN_ERROR_USERINFO_AUTHENTICATIONTYPE,
- [NSValue valueWithPointer:keychainRef], AIKEYCHAIN_ERROR_USERINFO_KEYCHAIN,
+ [NSValue valueWithPointer:SecKeychainItemModifyAttributesAndData], AIKEYCHAIN_ERROR_USERINFO_SECURITYFUNCTION, + @"SecKeychainItemModifyAttributesAndData", AIKEYCHAIN_ERROR_USERINFO_SECURITYFUNCTIONNAME, + AI_LOCALIZED_SECURITY_ERROR_DESCRIPTION(err), AIKEYCHAIN_ERROR_USERINFO_ERRORDESCRIPTION, + server, AIKEYCHAIN_ERROR_USERINFO_SERVER, + domain, AIKEYCHAIN_ERROR_USERINFO_DOMAIN, + account, AIKEYCHAIN_ERROR_USERINFO_ACCOUNT, + NSFileTypeForHFSTypeCode(protocol), AIKEYCHAIN_ERROR_USERINFO_PROTOCOL, + NSFileTypeForHFSTypeCode(authType), AIKEYCHAIN_ERROR_USERINFO_AUTHENTICATIONTYPE, + [NSValue valueWithPointer:keychainRef], AIKEYCHAIN_ERROR_USERINFO_KEYCHAIN, // Retain this because of the autorelease pool
- error = [[NSError errorWithDomain:AIKEYCHAIN_ERROR_DOMAIN code:err userInfo:userInfo] retain];
+ error = [NSError errorWithDomain:AIKEYCHAIN_ERROR_DOMAIN code:err userInfo:userInfo]; } // if (!error) (findInternetPasswordForServer:...)
+ } // if (err == errSecDuplicateItem)
- } // if (err == errSecDuplicateItem)
- success = (err == noErr);
+ success = (err == noErr); } // if (error) (addInternetPassword:...)
@@ -1039,7 +1033,7 @@
SecKeychainItemRef keychainItem = NULL;
[self findInternetPasswordForServer:server
@@ -1049,7 +1043,7 @@
authenticationType:authType
keychainItem:&keychainItem
@@ -1061,24 +1055,24 @@
NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys:
- [NSValue valueWithPointer:SecKeychainFindInternetPassword], AIKEYCHAIN_ERROR_USERINFO_SECURITYFUNCTION,
- @"SecKeychainFindInternetPassword", AIKEYCHAIN_ERROR_USERINFO_SECURITYFUNCTIONNAME,
- AI_LOCALIZED_SECURITY_ERROR_DESCRIPTION(err), AIKEYCHAIN_ERROR_USERINFO_ERRORDESCRIPTION,
- server, AIKEYCHAIN_ERROR_USERINFO_SERVER,
- account, AIKEYCHAIN_ERROR_USERINFO_ACCOUNT,
- NSFileTypeForHFSTypeCode(protocol), AIKEYCHAIN_ERROR_USERINFO_PROTOCOL,
- NSFileTypeForHFSTypeCode(kSecAuthenticationTypeDefault), AIKEYCHAIN_ERROR_USERINFO_AUTHENTICATIONTYPE,
- [NSValue valueWithPointer:keychainRef], AIKEYCHAIN_ERROR_USERINFO_KEYCHAIN,
+ [NSValue valueWithPointer:SecKeychainFindInternetPassword], AIKEYCHAIN_ERROR_USERINFO_SECURITYFUNCTION, + @"SecKeychainFindInternetPassword", AIKEYCHAIN_ERROR_USERINFO_SECURITYFUNCTIONNAME, + AI_LOCALIZED_SECURITY_ERROR_DESCRIPTION(err), AIKEYCHAIN_ERROR_USERINFO_ERRORDESCRIPTION, + server, AIKEYCHAIN_ERROR_USERINFO_SERVER, + account, AIKEYCHAIN_ERROR_USERINFO_ACCOUNT, + NSFileTypeForHFSTypeCode(protocol), AIKEYCHAIN_ERROR_USERINFO_PROTOCOL, + NSFileTypeForHFSTypeCode(kSecAuthenticationTypeDefault), AIKEYCHAIN_ERROR_USERINFO_AUTHENTICATIONTYPE, + [NSValue valueWithPointer:keychainRef], AIKEYCHAIN_ERROR_USERINFO_KEYCHAIN, error = [NSError errorWithDomain:AIKEYCHAIN_ERROR_DOMAIN code:err userInfo:userInfo];
success = (err == noErr);
- *outError = [error retain];
@@ -1087,10 +1081,6 @@
- [*outError autorelease];
@@ -1121,37 +1111,37 @@
NSParameterAssert(account != nil);
NSData *passwordData = [password dataUsingEncoding:NSUTF8StringEncoding];
NSData *serviceData = [service dataUsingEncoding:NSUTF8StringEncoding];
NSData *accountData = [account dataUsingEncoding:NSUTF8StringEncoding];
NSAssert( (UINT_MAX >= [passwordData length]) &&
- (UINT_MAX >= [serviceData length]) &&
- (UINT_MAX >= [accountData length]),
- @"Attempting to send more data than Keychain can handle. Abort." );
+ (UINT_MAX >= [serviceData length]) && + (UINT_MAX >= [accountData length]), + @"Attempting to send more data than Keychain can handle. Abort." ); // If keychainRef is NULL, the default keychain will be used
OSStatus err = SecKeychainAddGenericPassword(keychainRef,
- (UInt32)[serviceData length], [serviceData bytes],
- (UInt32)[accountData length], [accountData bytes],
+ (UInt32)[serviceData length], [serviceData bytes], + (UInt32)[accountData length], [accountData bytes], (UInt32)[passwordData length], [passwordData bytes],
NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys:
- [NSValue valueWithPointer:SecKeychainAddGenericPassword], AIKEYCHAIN_ERROR_USERINFO_SECURITYFUNCTION,
- @"SecKeychainAddGenericPassword", AIKEYCHAIN_ERROR_USERINFO_SECURITYFUNCTIONNAME,
- AI_LOCALIZED_SECURITY_ERROR_DESCRIPTION(err), AIKEYCHAIN_ERROR_USERINFO_ERRORDESCRIPTION,
- service, AIKEYCHAIN_ERROR_USERINFO_SERVICE,
- account, AIKEYCHAIN_ERROR_USERINFO_ACCOUNT,
- [NSValue valueWithPointer:keychainRef], AIKEYCHAIN_ERROR_USERINFO_KEYCHAIN,
+ [NSValue valueWithPointer:SecKeychainAddGenericPassword], AIKEYCHAIN_ERROR_USERINFO_SECURITYFUNCTION, + @"SecKeychainAddGenericPassword", AIKEYCHAIN_ERROR_USERINFO_SECURITYFUNCTIONNAME, + AI_LOCALIZED_SECURITY_ERROR_DESCRIPTION(err), AIKEYCHAIN_ERROR_USERINFO_ERRORDESCRIPTION, + service, AIKEYCHAIN_ERROR_USERINFO_SERVICE, + account, AIKEYCHAIN_ERROR_USERINFO_ACCOUNT, + [NSValue valueWithPointer:keychainRef], AIKEYCHAIN_ERROR_USERINFO_KEYCHAIN, error = [NSError errorWithDomain:AIKEYCHAIN_ERROR_DOMAIN code:err userInfo:userInfo];
@@ -1216,7 +1206,7 @@
SecKeychainItemRef keychainItem = NULL;
[self findGenericPasswordForService:service
keychainItem:&keychainItem
@@ -1226,7 +1216,7 @@
OSStatus err = SecKeychainItemDelete(keychainItem);
@@ -1242,7 +1232,7 @@
error = [NSError errorWithDomain:AIKEYCHAIN_ERROR_DOMAIN code:err userInfo:userInfo];
--- a/Frameworks/AIUtilities Framework/Source/AILinkTextView.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AILinkTextView.m Sun Sep 09 12:24:39 2012 -0400
@@ -51,7 +51,7 @@
- (void)_initLinkTextView
- linkTrackingController = [[AILinkTrackingController linkTrackingControllerForTextView:self] retain];
+ linkTrackingController = [AILinkTrackingController linkTrackingControllerForTextView:self]; [[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(frameDidChange:)
name:NSViewFrameDidChangeNotification
@@ -63,9 +63,6 @@
[[NSNotificationCenter defaultCenter] removeObserver:self];
- [linkTrackingController release];
//Pass clicks to the link tracking controller
@@ -118,7 +115,7 @@
linkMenuItems = [linkTrackingController menuItemsForEvent:theEvent withOffset:NSMakePoint(0,0)];
if ([linkMenuItems count]) {
- if (!menu) menu = [[[NSMenu alloc] init] autorelease];
+ if (!menu) menu = [[NSMenu alloc] init]; [linkMenuItems enumerateObjectsWithOptions:NSEnumerationReverse
usingBlock:^(id menuItem, NSUInteger idx, BOOL *stop) {
--- a/Frameworks/AIUtilities Framework/Source/AILinkTrackingController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AILinkTrackingController.m Sun Sep 09 12:24:39 2012 -0400
@@ -47,13 +47,13 @@
//Create a link tracking controller for any view
+ (id)linkTrackingControllerForView:(NSView *)inControlView withTextStorage:(NSTextStorage *)inTextStorage layoutManager:(NSLayoutManager *)inLayoutManager textContainer:(NSTextContainer *)inTextContainer
- return [[[self alloc] initForView:inControlView withTextStorage:inTextStorage layoutManager:inLayoutManager textContainer:inTextContainer] autorelease];
+ return [[self alloc] initForView:inControlView withTextStorage:inTextStorage layoutManager:inLayoutManager textContainer:inTextContainer]; //Create a tracking controller for a text view
+ (id)linkTrackingControllerForTextView:(NSTextView *)inTextView
- return [[[self alloc] initForView:inTextView withTextStorage:[inTextView textStorage] layoutManager:[inTextView layoutManager] textContainer:[inTextView textContainer]] autorelease];
+ return [[self alloc] initForView:inTextView withTextStorage:[inTextView textStorage] layoutManager:[inTextView layoutManager] textContainer:[inTextView textContainer]]; //Track links in the passed rect. Returns YES if links exist within our text. Pass a 0 width/height visible rect to stop any link tracking.
@@ -96,7 +96,7 @@
//Called when the mouse leaves the link
- (void)mouseExited:(NSEvent *)theEvent
- [self _setMouseOverLink:NO atPoint:NSMakePoint(0,0)];
+ [self _setMouseOverLink:nil atPoint:NSMakePoint(0,0)]; //Handle a mouse down. Returns NO if the mouse down event should continue to be processed
@@ -108,7 +108,7 @@
NSRectArray linkRects = nil;
- [self _setMouseOverLink:NO atPoint:NSMakePoint(0,0)]; //Remove any tooltips
+ [self _setMouseOverLink:nil atPoint:NSMakePoint(0,0)]; //Remove any tooltips //Find clicked char index
mouseLoc = [controlView convertPoint:[theEvent locationInWindow] fromView:nil];
@@ -236,12 +236,6 @@
[self _endCursorTracking];
- [hoveredString release];
//Begins cursor tracking, registering tracking rects for all our available links
@@ -299,15 +293,15 @@
visibleLinkRect = NSIntersectionRect(linkRect, visibleRect);
//Create a flexible link instance
- trackedLink = [[[AIFlexibleLink alloc] initWithTrackingRect:linkRect
+ trackedLink = [[AIFlexibleLink alloc] initWithTrackingRect:linkRect - title:[[textStorage string] substringWithRange:scanRange]] autorelease];
+ title:[[textStorage string] substringWithRange:scanRange]]; if (!linkArray) linkArray = [[NSMutableArray alloc] init];
[linkArray addObject:trackedLink];
//Install a tracking rect for the link (The userData of each tracking rect is the AIFlexibleLink it covers)
- trackingTag = [controlView addTrackingRect:visibleLinkRect owner:self userData:trackedLink assumeInside:NO];
+ trackingTag = [controlView addTrackingRect:visibleLinkRect owner:self userData:(__bridge void *)trackedLink assumeInside:NO]; [trackedLink setTrackingTag:trackingTag];
@@ -323,7 +317,7 @@
- [linkArray release]; linkArray = nil;
//Configure the mouse for being over a link or not
@@ -340,8 +334,8 @@
[[inHoveredLink title] caseInsensitiveCompare:[inHoveredLink url]] != NSOrderedSame &&
[[@"http://" stringByAppendingString:[inHoveredLink title]] caseInsensitiveCompare:[inHoveredLink url]] != NSOrderedSame) {
- [hoveredLink release]; hoveredLink = [inHoveredLink retain];
- [hoveredString release]; hoveredString = [[NSString stringWithFormat:@"%@", [hoveredLink url]] retain];
+ hoveredLink = inHoveredLink; + hoveredString = [NSString stringWithFormat:@"%@", [hoveredLink url]]; [AITooltipUtilities showTooltipWithString:hoveredString onWindow:nil atPoint:inPoint orientation:TooltipAbove]; //Show tooltip
@@ -352,8 +346,8 @@
[AITooltipUtilities showTooltipWithString:nil onWindow:nil atPoint:NSMakePoint(0,0) orientation:TooltipAbove]; //Hide the tooltip
- [hoveredLink release]; hoveredLink = nil;
- [hoveredString release]; hoveredString = nil;
@@ -394,11 +388,11 @@
- menuItemsArray = [[[NSMutableArray alloc] init] autorelease];
- menuItem = [[[NSMenuItem alloc] initWithTitle:COPY_LINK
+ menuItemsArray = [[NSMutableArray alloc] init]; + menuItem = [[NSMenuItem alloc] initWithTitle:COPY_LINK action:@selector(copyLink:)
- keyEquivalent:@""] autorelease];
[menuItem setRepresentedObject:linkURL];
[menuItemsArray addObject:menuItem];
@@ -409,7 +403,7 @@
//Copy the absolute URL to the clipboard
- (void)copyLink:(id)sender
- NSAttributedString *copyString = [[[NSAttributedString alloc] initWithString:[(NSURL *)[sender representedObject] absoluteString] attributes:nil] autorelease];
+ NSAttributedString *copyString = [[NSAttributedString alloc] initWithString:[(NSURL *)[sender representedObject] absoluteString] attributes:nil]; [[NSPasteboard generalPasteboard] declareTypes:[NSArray arrayWithObject:NSRTFPboardType] owner:nil];
[[NSPasteboard generalPasteboard] setData:[copyString RTFFromRange:NSMakeRange(0,[copyString length]) documentAttributes:nil] forType:NSRTFPboardType];
--- a/Frameworks/AIUtilities Framework/Source/AIMenuAdditions.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIMenuAdditions.m Sun Sep 09 12:24:39 2012 -0400
@@ -20,34 +20,34 @@
- (NSMenuItem *)addItemWithTitle:(NSString *)aString target:(id)target action:(SEL)aSelector keyEquivalent:(NSString *)charCode
- NSMenuItem *theMenuItem = [[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:aString action:aSelector keyEquivalent:charCode];
+ NSMenuItem *theMenuItem = [[NSMenuItem alloc] initWithTitle:aString action:aSelector keyEquivalent:charCode]; [theMenuItem setTarget:target];
[self addItem:theMenuItem];
- return [theMenuItem autorelease];
- (NSMenuItem *)addItemWithTitle:(NSString *)aString target:(id)target action:(SEL)aSelector keyEquivalent:(NSString *)charCode tag:(NSInteger)tag
- NSMenuItem *theMenuItem = [[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:aString action:aSelector keyEquivalent:charCode];
+ NSMenuItem *theMenuItem = [[NSMenuItem alloc] initWithTitle:aString action:aSelector keyEquivalent:charCode]; [theMenuItem setTarget:target];
[theMenuItem setTag:tag];
[self addItem:theMenuItem];
- return [theMenuItem autorelease];
- (NSMenuItem *)addItemWithTitle:(NSString *)aString target:(id)target action:(SEL)aSelector keyEquivalent:(NSString *)charCode representedObject:(id)object
- NSMenuItem *theMenuItem = [[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:aString action:aSelector keyEquivalent:charCode];
+ NSMenuItem *theMenuItem = [[NSMenuItem alloc] initWithTitle:aString action:aSelector keyEquivalent:charCode]; [theMenuItem setTarget:target];
[theMenuItem setRepresentedObject:object];
[self addItem:theMenuItem];
- return [theMenuItem autorelease];
- (void)removeAllItemsButFirst
@@ -119,11 +119,9 @@
NSMenu *menu = [self menu];
NSInteger idx = [menu indexOfItem:self];
[menu removeItemAtIndex:idx];
[self setKeyEquivalent:@""];
[menu insertItem:self atIndex:idx];
- (NSComparisonResult)titleCompare:(NSMenuItem *)inMenuItem
@@ -157,10 +155,10 @@
if (itemA == itemB) return;
- NSMenu *menuA = [[itemA retain] menu];
+ NSMenu *menuA = [itemA menu]; NSInteger indexA = menuA ? [menuA indexOfItem:itemA] : -1;
- NSMenu *menuB = [[itemB retain] menu];
+ NSMenu *menuB = [itemB menu]; NSInteger indexB = menuB ? [menuB indexOfItem:itemB] : -1;
if ((menuA == menuB) && (indexA < indexB)) {
@@ -194,16 +192,12 @@
NSMenuItem *primaryItem = [containingMenu itemAtIndex:(menuItemIndex-1)];
//Remove the primary item and readd it
[containingMenu removeItemAtIndex:(menuItemIndex-1)];
[containingMenu insertItem:primaryItem atIndex:(menuItemIndex-1)];
//Remove the alternate item and readd it
- [alternateItem retain];
[containingMenu removeItemAtIndex:menuItemIndex];
[containingMenu insertItem:alternateItem atIndex:menuItemIndex];
- [alternateItem release];
--- a/Frameworks/AIUtilities Framework/Source/AIMultiCellOutlineView.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIMultiCellOutlineView.m Sun Sep 09 12:24:39 2012 -0400
@@ -46,19 +46,10 @@
//Cell used for content rows
- (void)setContentCell:(NSCell *)cell{
if (contentCell != cell) {
- contentCell = [cell retain];
contentRowHeight = [contentCell cellSize].height;
[self noteHeightOfRowsWithIndexesChanged:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, [self numberOfRows])]];
@@ -70,8 +61,7 @@
//Cell used for group rows
- (void)setGroupCell:(NSCell *)cell{
- groupCell = [cell retain];
groupRowHeight = [groupCell cellSize].height;
--- a/Frameworks/AIUtilities Framework/Source/AIMutableOwnerArray.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIMutableOwnerArray.h Sun Sep 09 12:24:39 2012 -0400
@@ -84,14 +84,14 @@
* @result The object with the highest priority, performing no other comparison
-@property (readonly, nonatomic) id objectValue;
+@property (weak, readonly, nonatomic) id objectValue; * @brief Greatest NSNumber value
* Assumes the \c AIMutableOwnerArray contains \c NSNumber instances
* @result Returns the greatest (highest value) contained \c NSNumber value.
-@property (readonly, nonatomic) NSNumber *numberValue;
+@property (weak, readonly, nonatomic) NSNumber *numberValue; * @brief Greatest integer value
@@ -112,7 +112,7 @@
* Assuming the \c AIMutableOwnerArray contains \c NSDate instances, returns the earliest one.
* @return Returns the earliest contained date.
-@property (readonly, nonatomic) NSDate *date;
+@property (weak, readonly, nonatomic) NSDate *date; * @brief Retrieve object by owner
@@ -151,7 +151,7 @@
* Retrieve an \c NSEnumerator for all objects in the \c AIMutableOwnerArray. Order is not guaranteed.
* @return Returns \c NSEnumerator for all objects.
-@property (readonly, nonatomic) NSEnumerator *objectEnumerator;
+@property (weak, readonly, nonatomic) NSEnumerator *objectEnumerator; * @brief Retrieve array of values
@@ -176,6 +176,6 @@
* to be notified with the \c AIMutableOwnerArray is modified.
* @param inDelegate The delegate
-@property (readwrite, nonatomic, assign) id delegate;
+@property (readwrite, nonatomic, weak) id delegate; --- a/Frameworks/AIUtilities Framework/Source/AIMutableOwnerArray.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIMutableOwnerArray.m Sun Sep 09 12:24:39 2012 -0400
@@ -51,13 +51,12 @@
- (NSString *)description
- NSMutableString *desc = [[NSMutableString alloc] initWithFormat:@"<%@: %x: ", NSStringFromClass([self class]), self];
+ NSMutableString *desc = [[NSMutableString alloc] initWithFormat:@"<%@: %p: ", NSStringFromClass([self class]), self]; for (id object in self) {
@@ -66,7 +65,7 @@
[desc appendString:@">"];
- return [desc autorelease];
@@ -356,9 +355,9 @@
//Destroy our storage arrays
- [contentArray release]; contentArray = nil;
- [priorityArray release]; priorityArray = nil;
- [ownerArray release]; ownerArray = nil;
//Delegation -----------------------------------------------------------------------------------------
@@ -375,7 +374,7 @@
-- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id *)stackbuf count:(NSUInteger)len;
+- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id __unsafe_unretained [])stackbuf count:(NSUInteger)len; return [contentArray countByEnumeratingWithState:state objects:stackbuf count:len];
--- a/Frameworks/AIUtilities Framework/Source/AIMutableStringAdditions.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIMutableStringAdditions.m Sun Sep 09 12:24:39 2012 -0400
@@ -20,8 +20,8 @@
+ (NSMutableString *)stringWithContentsOfASCIIFile:(NSString *)path
- return ([[[NSMutableString alloc] initWithData:[NSData dataWithContentsOfFile:path]
- encoding:NSASCIIStringEncoding] autorelease]);
+ return ([[NSMutableString alloc] initWithData:[NSData dataWithContentsOfFile:path] + encoding:NSASCIIStringEncoding]); - (NSMutableString*)mutableString
--- a/Frameworks/AIUtilities Framework/Source/AIOSCompatibility.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIOSCompatibility.h Sun Sep 09 12:24:39 2012 -0400
@@ -14,30 +14,3 @@
* write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-// XXX - Remove this on 10.7+ transition
-#ifndef AILeopardCompatibility
-#define AILeopardCompatibility
-#import <AvailabilityMacros.h>
-#ifndef MAC_OS_X_VERSION_10_7
-#define MAC_OS_X_VERSION_10_7 1070
-#endif //ndef MAC_OS_X_VERSION_10_7
-#if MAC_OS_X_VERSION_10_7 > MAC_OS_X_VERSION_MAX_ALLOWED
-@protocol NSDraggingDestination <NSObject>
-@protocol NSURLDownloadDelegate <NSObject>
-#else //Not compiling for 10.7
-#endif //MAC_OS_X_VERSION_10_7
--- a/Frameworks/AIUtilities Framework/Source/AIObjectAdditions.h Thu Sep 06 21:09:42 2012 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
- * Adium is the legal property of its developers, whose names are listed in the copyright file included
- * with this source distribution.
- * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
- * General Public License as published by the Free Software Foundation; either version 2 of the License,
- * or (at your option) any later version.
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
- * Public License for more details.
- * You should have received a copy of the GNU General Public License along with this program; if not,
- * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-@interface NSObject (RunLoopMessenger)
-- (void)mainPerformSelector:(SEL)aSelector;
-- (id)mainPerformSelector:(SEL)aSelector returnValue:(BOOL)flag;
-- (void)mainPerformSelector:(SEL)aSelector waitUntilDone:(BOOL)flag;
-- (void)mainPerformSelector:(SEL)aSelector withObject:(id)argument1;
-- (void)mainPerformSelector:(SEL)aSelector withObject:(id)argument1 waitUntilDone:(BOOL)flag;
-- (id)mainPerformSelector:(SEL)aSelector withObject:(id)argument1 returnValue:(BOOL)flag;
-- (void)mainPerformSelector:(SEL)aSelector withObject:(id)argument1 withObject:(id)argument2;
-- (void)mainPerformSelector:(SEL)aSelector withObject:(id)argument1 withObject:(id)argument2 waitUntilDone:(BOOL)flag;
-- (id)mainPerformSelector:(SEL)aSelector withObject:(id)argument1 withObject:(id)argument2 returnValue:(BOOL)flag;
-- (void)mainPerformSelector:(SEL)aSelector withObject:(id)argument1 withObject:(id)argument2 withObject:(id)argument3;
-- (void)mainPerformSelector:(SEL)aSelector withObject:(id)argument1 withObject:(id)argument2 withObject:(id)argument3 waitUntilDone:(BOOL)flag;
-- (id)mainPerformSelector:(SEL)aSelector withObject:(id)argument1 withObject:(id)argument2 withObject:(id)argument3 returnValue:(BOOL)flag;
-- (void)mainPerformSelector:(SEL)aSelector withObject:(id)argument1 withObject:(id)argument2 withObject:(id)argument3 withObject:(id)argument4;
-- (void)mainPerformSelector:(SEL)aSelector withObject:(id)argument1 withObject:(id)argument2 withObject:(id)argument3 withObject:(id)argument4 waitUntilDone:(BOOL)flag;
-- (void)mainPerformSelector:(SEL)aSelector withObjects:(id)argument1, ... NS_REQUIRES_NIL_TERMINATION;
-- (void)mainPerformSelector:(SEL)aSelector withObject:(id)argument1 withObject:(id)argument2 withObject:(id)argument3 withObject:(id)argument4 waitUntilDone:(BOOL)flag;
-- (void)performSelector:(SEL)aSelector withObject:(id)argument1 withObject:(id)argument2 afterDelay:(NSTimeInterval)delay;
-- (void)performSelector:(SEL)aSelector withObject:(id)argument1 withObject:(id)argument2 withObject:(id)argument3 afterDelay:(NSTimeInterval)delay;
-- (void)performSelector:(SEL)aSelector withObject:(id)argument1 withObject:(id)argument2 withObject:(id)argument3;
-- (void)performSelector:(SEL)aSelector withObject:(id)argument1 withObject:(id)argument2 withObject:(id)argument3 withObject:(id)argument4 afterDelay:(NSTimeInterval)delay;
-- (void)handleInvocation:(NSInvocation *)anInvocation;
--- a/Frameworks/AIUtilities Framework/Source/AIObjectAdditions.m Thu Sep 06 21:09:42 2012 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,293 +0,0 @@
- * Adium is the legal property of its developers, whose names are listed in the copyright file included
- * with this source distribution.
- * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
- * General Public License as published by the Free Software Foundation; either version 2 of the License,
- * or (at your option) any later version.
- * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
- * Public License for more details.
- * You should have received a copy of the GNU General Public License along with this program; if not,
- * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#import "AIObjectAdditions.h"
-// Clever addition by Jonathan Jansson found on cocoadev.com (http://www.cocoadev.com/index.pl?ThreadCommunication)
-@implementation NSObject (RunLoopMessenger)
-//Included to allow uniform coding
-- (void)mainPerformSelector:(SEL)aSelector
- [self mainPerformSelector:aSelector waitUntilDone:NO];
-//Included to allow uniform coding - wrapped for performSelectorOnMainThread:withObject:waitUntilDone:
-- (void)mainPerformSelector:(SEL)aSelector waitUntilDone:(BOOL)flag
- [self performSelectorOnMainThread:aSelector withObject:nil waitUntilDone:flag];
-- (id)mainPerformSelector:(SEL)aSelector returnValue:(BOOL)flag
- NSInvocation *invocation;
- invocation = [NSInvocation invocationWithMethodSignature:[self methodSignatureForSelector:aSelector]];
- [invocation setSelector:aSelector];
- [self performSelectorOnMainThread:@selector(handleInvocation:)
- [invocation getReturnValue:&returnValue];
- [self performSelectorOnMainThread:aSelector
-//Included to allow uniform coding
-- (void)mainPerformSelector:(SEL)aSelector withObject:(id)argument1
- [self mainPerformSelector:aSelector withObject:argument1 waitUntilDone:NO];
-//Included to allow uniform coding - wrapped for performSelectorOnMainThread:withObject:waitUntilDone:
-- (void)mainPerformSelector:(SEL)aSelector withObject:(id)argument1 waitUntilDone:(BOOL)flag
- [self performSelectorOnMainThread:aSelector withObject:argument1 waitUntilDone:flag];
-//Perform a selector on the main thread, optionally taking an argument, and return its return value
-- (id)mainPerformSelector:(SEL)aSelector withObject:(id)argument1 returnValue:(BOOL)flag
- NSInvocation *invocation;
- invocation = [NSInvocation invocationWithMethodSignature:[self methodSignatureForSelector:aSelector]];
- [invocation setSelector:aSelector];
- [invocation setArgument:&argument1 atIndex:2];
- [self performSelectorOnMainThread:@selector(handleInvocation:)
- [invocation getReturnValue:&returnValue];
- [self performSelectorOnMainThread:aSelector withObject:argument1 waitUntilDone:NO];
-- (void)mainPerformSelector:(SEL)aSelector withObject:(id)argument1 withObject:(id)argument2
- [self mainPerformSelector:aSelector withObject:argument1 withObject:argument2 waitUntilDone:NO];
-//Perform a selector on the main thread, taking 0-2 arguments, and return its return value
-- (id)mainPerformSelector:(SEL)aSelector withObject:(id)argument1 withObject:(id)argument2 returnValue:(BOOL)flag
- NSInvocation *invocation;
- invocation = [NSInvocation invocationWithMethodSignature:[self methodSignatureForSelector:aSelector]];
- [invocation setSelector:aSelector];
- [invocation setArgument:&argument1 atIndex:2];
- [invocation setArgument:&argument2 atIndex:3];
- [self performSelectorOnMainThread:@selector(handleInvocation:)
- [invocation getReturnValue:&returnValue];
- [self mainPerformSelector:aSelector withObject:argument1 withObject:argument2 waitUntilDone:NO];
-- (void)mainPerformSelector:(SEL)aSelector withObject:(id)argument1 withObject:(id)argument2 waitUntilDone:(BOOL)flag
- NSInvocation *invocation;
- invocation = [NSInvocation invocationWithMethodSignature:[self methodSignatureForSelector:aSelector]];
- [invocation setSelector:aSelector];
- [invocation setArgument:&argument1 atIndex:2];
- [invocation setArgument:&argument2 atIndex:3];
- [invocation retainArguments];
- [self performSelectorOnMainThread:@selector(handleInvocation:) withObject:invocation waitUntilDone:flag];
-- (void)mainPerformSelector:(SEL)aSelector withObject:(id)argument1 withObject:(id)argument2 withObject:(id)argument3
- [self mainPerformSelector:aSelector withObject:argument1 withObject:argument2 withObject:argument3 waitUntilDone:NO];
-//Perform a selector on the main thread, taking 0-3 arguments, and return its return value
-- (id)mainPerformSelector:(SEL)aSelector withObject:(id)argument1 withObject:(id)argument2 withObject:(id)argument3 returnValue:(BOOL)flag
- NSInvocation *invocation;
- invocation = [NSInvocation invocationWithMethodSignature:[self methodSignatureForSelector:aSelector]];
- [invocation setSelector:aSelector];
- [invocation setArgument:&argument1 atIndex:2];
- [invocation setArgument:&argument2 atIndex:3];
- [invocation setArgument:&argument3 atIndex:4];
- [self performSelectorOnMainThread:@selector(handleInvocation:)
- [invocation getReturnValue:&returnValue];
- [self mainPerformSelector:aSelector withObject:argument1 withObject:argument2 withObject:argument3 waitUntilDone:NO];
-- (void)mainPerformSelector:(SEL)aSelector withObject:(id)argument1 withObject:(id)argument2 withObject:(id)argument3 waitUntilDone:(BOOL)flag
- NSInvocation *invocation;
- invocation = [NSInvocation invocationWithMethodSignature:[self methodSignatureForSelector:aSelector]];
- [invocation setSelector:aSelector];
- [invocation setArgument:&argument1 atIndex:2];
- [invocation setArgument:&argument2 atIndex:3];
- [invocation setArgument:&argument3 atIndex:4];
- [invocation retainArguments];
- [self performSelectorOnMainThread:@selector(handleInvocation:) withObject:invocation waitUntilDone:flag];
-- (void)mainPerformSelector:(SEL)aSelector withObject:(id)argument1 withObject:(id)argument2 withObject:(id)argument3 withObject:(id)argument4
- [self mainPerformSelector:aSelector withObject:argument1 withObject:argument2 withObject:argument3 withObject:argument4 waitUntilDone:NO];
-- (void)mainPerformSelector:(SEL)aSelector withObject:(id)argument1 withObject:(id)argument2 withObject:(id)argument3 withObject:(id)argument4 waitUntilDone:(BOOL)flag
- NSInvocation *invocation;
- invocation = [NSInvocation invocationWithMethodSignature:[self methodSignatureForSelector:aSelector]];
- [invocation setSelector:aSelector];
- [invocation setArgument:&argument1 atIndex:2];
- [invocation setArgument:&argument2 atIndex:3];
- [invocation setArgument:&argument3 atIndex:4];
- [invocation setArgument:&argument4 atIndex:5];
- [invocation retainArguments];
- [self performSelectorOnMainThread:@selector(handleInvocation:) withObject:invocation waitUntilDone:flag];
-- (void)mainPerformSelector:(SEL)aSelector withObjects:(id)argument1, ...
- NSInvocation *invocation;
- invocation = [NSInvocation invocationWithMethodSignature:[self methodSignatureForSelector:aSelector]];
- [invocation setSelector:aSelector];
- [invocation setArgument:&argument1 atIndex:idx++];
- va_start(args, argument1);
- while ((anArgument = va_arg(args, id))) {
- [invocation setArgument:&anArgument atIndex:idx++];
- [invocation retainArguments];
- [self performSelectorOnMainThread:@selector(handleInvocation:) withObject:invocation waitUntilDone:NO];
-- (void)performSelector:(SEL)aSelector withObject:(id)argument1 withObject:(id)argument2 afterDelay:(NSTimeInterval)delay
- NSInvocation *invocation;
- invocation = [NSInvocation invocationWithMethodSignature:[self methodSignatureForSelector:aSelector]];
- [invocation setSelector:aSelector];
- [invocation setArgument:&argument1 atIndex:2];
- [invocation setArgument:&argument2 atIndex:3];
- [invocation retainArguments];
- [self performSelector:@selector(handleInvocation:) withObject:invocation afterDelay:delay];
-- (void)performSelector:(SEL)aSelector withObject:(id)argument1 withObject:(id)argument2 withObject:(id)argument3 afterDelay:(NSTimeInterval)delay
- NSInvocation *invocation;
- invocation = [NSInvocation invocationWithMethodSignature:[self methodSignatureForSelector:aSelector]];
- [invocation setSelector:aSelector];
- [invocation setArgument:&argument1 atIndex:2];
- [invocation setArgument:&argument2 atIndex:3];
- [invocation setArgument:&argument3 atIndex:4];
- [invocation retainArguments];
- [self performSelector:@selector(handleInvocation:) withObject:invocation afterDelay:delay];
-- (void)performSelector:(SEL)aSelector withObject:(id)argument1 withObject:(id)argument2 withObject:(id)argument3
- NSInvocation *invocation;
- invocation = [NSInvocation invocationWithMethodSignature:[self methodSignatureForSelector:aSelector]];
- [invocation setSelector:aSelector];
- [invocation setArgument:&argument1 atIndex:2];
- [invocation setArgument:&argument2 atIndex:3];
- [invocation setArgument:&argument3 atIndex:4];
- [invocation retainArguments];
- [self performSelector:@selector(handleInvocation:) withObject:invocation];
-- (void)performSelector:(SEL)aSelector withObject:(id)argument1 withObject:(id)argument2 withObject:(id)argument3 withObject:(id)argument4 afterDelay:(NSTimeInterval)delay
- NSInvocation *invocation;
- invocation = [NSInvocation invocationWithMethodSignature:[self methodSignatureForSelector:aSelector]];
- [invocation setSelector:aSelector];
- [invocation setArgument:&argument1 atIndex:2];
- [invocation setArgument:&argument2 atIndex:3];
- [invocation setArgument:&argument3 atIndex:4];
- [invocation setArgument:&argument4 atIndex:5];
- [invocation retainArguments];
- [self performSelector:@selector(handleInvocation:) withObject:invocation afterDelay:delay];
-- (void)handleInvocation:(NSInvocation *)anInvocation
- [anInvocation invokeWithTarget:self];
--- a/Frameworks/AIUtilities Framework/Source/AIOutlineView.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIOutlineView.m Sun Sep 09 12:24:39 2012 -0400
@@ -296,7 +296,7 @@
[accessibilityActionNames addObject:NSAccessibilityPressAction];
[accessibilityActionNames addObject:NSAccessibilityShowMenuAction];
- return [accessibilityActionNames autorelease];
+ return accessibilityActionNames; --- a/Frameworks/AIUtilities Framework/Source/AIParagraphStyleAdditions.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIParagraphStyleAdditions.m Sun Sep 09 12:24:39 2012 -0400
@@ -23,7 +23,7 @@
NSMutableParagraphStyle *paragraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy];
[paragraphStyle setAlignment:alignment];
- return [paragraphStyle autorelease];
+ (NSMutableParagraphStyle *)styleWithAlignment:(NSTextAlignment)alignment lineBreakMode:(NSLineBreakMode)mode
@@ -32,7 +32,7 @@
[paragraphStyle setAlignment:alignment];
[paragraphStyle setLineBreakMode:mode];
- return [paragraphStyle autorelease];
--- a/Frameworks/AIUtilities Framework/Source/AIPreferenceCollectionView.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIPreferenceCollectionView.h Sun Sep 09 12:24:39 2012 -0400
@@ -30,7 +30,7 @@
@property (assign, nonatomic) NSUInteger highlightedIndex;
@property (retain, nonatomic) NSMutableIndexSet *matchedSearchIndexes;
-@property (assign, nonatomic) id <AIPreferenceCollectionViewDelegate> delegate;
+@property (nonatomic) id <AIPreferenceCollectionViewDelegate> delegate; --- a/Frameworks/AIUtilities Framework/Source/AIPreferenceCollectionView.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIPreferenceCollectionView.m Sun Sep 09 12:24:39 2012 -0400
@@ -42,7 +42,6 @@
[self removeObserver:self forKeyPath:@"matchedSearchIndexes"];
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
--- a/Frameworks/AIUtilities Framework/Source/AIProgressDataUploader.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIProgressDataUploader.m Sun Sep 09 12:24:39 2012 -0400
@@ -78,7 +78,7 @@
delegate:(id <AIProgressDataUploaderDelegate>)delegate
- return [[[self alloc] initWithData:uploadData URL:url headers:headers delegate:delegate context:context] autorelease];
+ return [[self alloc] initWithData:uploadData URL:url headers:headers delegate:delegate context:context]; - (id)initWithData:(NSData *)inUploadData
@@ -88,26 +88,16 @@
if ((self = [super init])) {
- uploadData = [inUploadData retain];
+ uploadData = inUploadData;
- headers = [inHeaders retain];
- [url release]; url = nil;
- [headers release]; headers = nil;
- [uploadData release]; uploadData = nil;
- [returnedData release]; returnedData = nil;
* @brief Begin the upload.
@@ -117,22 +107,22 @@
CFHTTPMessageRef httpRequest = CFHTTPMessageCreateRequest(kCFAllocatorDefault,
+ (__bridge CFURLRef)url, for (NSString *headerKey in headers) {
CFHTTPMessageSetHeaderFieldValue(httpRequest,
- (CFStringRef)headerKey,
- (CFStringRef)[headers objectForKey:headerKey]);
+ (__bridge CFStringRef)headerKey, + (__bridge CFStringRef)[headers objectForKey:headerKey]); - CFHTTPMessageSetBody(httpRequest, (CFDataRef)uploadData);
+ CFHTTPMessageSetBody(httpRequest, (__bridge CFDataRef)uploadData); stream = CFReadStreamCreateForHTTPRequest(kCFAllocatorDefault, httpRequest);
CFStreamClientContext streamClientContext = {
+ (__bridge void *)(self), @@ -196,11 +186,11 @@
totalSize = [uploadData length];
- periodicTimer = [[NSTimer scheduledTimerWithTimeInterval:UPDATE_INTERVAL
+ periodicTimer = [NSTimer scheduledTimerWithTimeInterval:UPDATE_INTERVAL selector:@selector(updateProgress)
timeoutTimer = [[NSTimer alloc] initWithFireDate:[NSDate dateWithTimeIntervalSinceNow:TIMEOUT_INTERVAL]
interval:TIMEOUT_INTERVAL
@@ -221,7 +211,7 @@
- NSNumber *bytesWrittenPropertyNum = [NSMakeCollectable(CFReadStreamCopyProperty(stream, kCFStreamPropertyHTTPRequestBytesWrittenCount)) autorelease];
+ NSNumber *bytesWrittenPropertyNum = CFBridgingRelease(CFReadStreamCopyProperty(stream, kCFStreamPropertyHTTPRequestBytesWrittenCount)); NSInteger bytesWritten = [bytesWrittenPropertyNum integerValue];
if (bytesWritten > bytesSent) {
@@ -256,7 +246,7 @@
- AIProgressDataUploader *uploader = (AIProgressDataUploader *)info;
+ AIProgressDataUploader *uploader = (__bridge AIProgressDataUploader *)info; case kCFStreamEventHasBytesAvailable:
--- a/Frameworks/AIUtilities Framework/Source/AIRichTextCoercer.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIRichTextCoercer.m Sun Sep 09 12:24:39 2012 -0400
@@ -51,19 +51,18 @@
if([input isKindOfClass:[NSMutableAttributedString class]]) {
//The input string is mutable, so make a copy of the string.
- result = [[result copy] autorelease];
+ result = [result copy]; - enum { RIGHTWARDS_ARROW = 0x2192 };
- NSLog(@"%s: Input '%@' %C Class %@ %C Result '%@'", __PRETTY_FUNCTION__, input, RIGHTWARDS_ARROW, class, RIGHTWARDS_ARROW, result);
+ NSLog(@"%s: Input '%@' → Class %@ → Result '%@'", __PRETTY_FUNCTION__, input, class, result); + (id)coercePlainText:(NSString *)input toClass:(Class)class
if([class isSubclassOfClass:[NSAttributedString class]]) {
- return [[[class alloc] initWithString:input] autorelease];
+ return [[class alloc] initWithString:input]; --- a/Frameworks/AIUtilities Framework/Source/AIRolloverButton.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIRolloverButton.m Sun Sep 09 12:24:39 2012 -0400
@@ -44,8 +44,6 @@
[self removeTrackingRect:trackingTag];
#pragma mark Configuration
--- a/Frameworks/AIUtilities Framework/Source/AISendingTextView.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AISendingTextView.m Sun Sep 09 12:24:39 2012 -0400
@@ -70,13 +70,6 @@
//If true we will invoke selector on target when a send key is pressed
@synthesize sendingEnabled;
--- a/Frameworks/AIUtilities Framework/Source/AISmoothTooltipTracker.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AISmoothTooltipTracker.m Sun Sep 09 12:24:39 2012 -0400
@@ -44,13 +44,13 @@
+ (AISmoothTooltipTracker *)smoothTooltipTrackerForView:(NSView *)inView withDelegate:(id <AISmoothTooltipTrackerDelegate>)inDelegate
- return [[[self alloc] initForView:inView withDelegate:inDelegate] autorelease];
+ return [[self alloc] initForView:inView withDelegate:inDelegate]; - (AISmoothTooltipTracker *)initForView:(NSView *)inView withDelegate:(id)inDelegate
if ((self = [super init])) {
- view = [inView retain];
tooltipLocation = NSZeroPoint;
@@ -91,9 +91,7 @@
[self _stopTrackingMouse];
- [view release]; view = nil;
- (void)setDelegate:(id <AISmoothTooltipTrackerDelegate>)inDelegate
@@ -228,11 +226,11 @@
if (!tooltipMouseLocationTimer) {
- tooltipMouseLocationTimer = [[NSTimer scheduledTimerWithTimeInterval:(1.0/TOOL_TIP_CHECK_INTERVAL)
+ tooltipMouseLocationTimer = [NSTimer scheduledTimerWithTimeInterval:(1.0/TOOL_TIP_CHECK_INTERVAL) selector:@selector(mouseMovementTimer:)
@@ -249,7 +247,7 @@
tooltipMouseLocationTimer = nil;
- [theTimer release]; theTimer = nil;
--- a/Frameworks/AIUtilities Framework/Source/AIStringAdditions.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIStringAdditions.m Sun Sep 09 12:24:39 2012 -0400
@@ -163,11 +163,11 @@
+ (id)stringWithData:(NSData *)data encoding:(NSStringEncoding)encoding
- return [[[self alloc] initWithData:data encoding:encoding] autorelease];
+ return [[self alloc] initWithData:data encoding:encoding]; + (id)stringWithBytes:(const void *)inBytes length:(unsigned)inLength encoding:(NSStringEncoding)inEncoding
- return [[[self alloc] initWithBytes:inBytes length:inLength encoding:inEncoding] autorelease];
+ return [[self alloc] initWithBytes:inBytes length:inLength encoding:inEncoding]; @@ -187,7 +187,7 @@
for (i = 0 ; i < length ; i++) {
/* Offset by the desired amount */
- [newString appendFormat:@"%C",([self characterAtIndex:i] + offset)];
+ [newString appendFormat:@"%C",(unichar)([self characterAtIndex:i] + offset)]; @@ -203,7 +203,7 @@
NSRange range = NSMakeRange(0, 0);
outName = [self mutableCopy];
- CFStringLowercase((CFMutableStringRef)outName, /*locale*/ NULL);
+ CFStringLowercase((__bridge CFMutableStringRef)outName, /*locale*/ NULL); @@ -224,7 +224,7 @@
- return [outName autorelease];
#define BUNDLE_STRING @"$$BundlePath$$"
@@ -233,7 +233,7 @@
if ([self hasPrefix:BUNDLE_STRING]) {
return [[[[NSBundle mainBundle] bundlePath] stringByExpandingTildeInPath] stringByAppendingString:[self substringFromIndex:[BUNDLE_STRING length]]];
- return [[self copy] autorelease];
@@ -244,7 +244,7 @@
if ([self hasPrefix:bundlePath]) {
return [BUNDLE_STRING stringByAppendingString:[self substringFromIndex:[bundlePath length]]];
- return [[self copy] autorelease];
@@ -258,7 +258,7 @@
returnString = [[self substringToIndex:length-1] stringByAppendingString:[NSString ellipsis]];
//We don't need to truncate, so don't append an ellipsis
- returnString = [[self copy] autorelease];
+ returnString = [self copy]; @@ -280,7 +280,7 @@
[string replaceOccurrencesOfString:@"/" withString:@"-" options:NSLiteralSearch range:NSMakeRange(0, length)];
- return [string autorelease];
//- (NSString *)stringByEncodingURLEscapes
@@ -426,7 +426,7 @@
- return [[[NSString alloc] initWithBytes:destPtr length:destIndex encoding:NSASCIIStringEncoding] autorelease];
+ return [[NSString alloc] initWithBytes:destPtr length:destIndex encoding:NSASCIIStringEncoding]; //stringByDecodingURLEscapes
@@ -502,7 +502,7 @@
- return [[[NSString alloc] initWithBytes:destPtr length:destIndex encoding:NSASCIIStringEncoding] autorelease];
+ return [[NSString alloc] initWithBytes:destPtr length:destIndex encoding:NSASCIIStringEncoding]; @@ -546,11 +546,11 @@
- return [(NSString *)CFXMLCreateStringByEscapingEntities(kCFAllocatorDefault, (CFStringRef)self, (CFDictionaryRef)realEntities) autorelease];
+ return (__bridge_transfer NSString *)CFXMLCreateStringByEscapingEntities(kCFAllocatorDefault, (__bridge CFStringRef)self, (__bridge CFDictionaryRef)realEntities); - (NSString *)stringByUnescapingFromXMLWithEntities:(NSDictionary *)entities
- return [(NSString *)CFXMLCreateStringByUnescapingEntities(kCFAllocatorDefault, (CFStringRef)self, (CFDictionaryRef)entities) autorelease];
+ return (__bridge_transfer NSString *)CFXMLCreateStringByUnescapingEntities(kCFAllocatorDefault, (__bridge CFStringRef)self, (__bridge CFDictionaryRef)entities); @@ -742,10 +742,10 @@
uuid = CFUUIDCreate(NULL);
- uuidStr = (NSString *)CFUUIDCreateString(NULL, uuid);
+ uuidStr = (__bridge_transfer NSString *)CFUUIDCreateString(NULL, uuid); - return [uuidStr autorelease];
+ (NSString *)stringWithCGFloat:(CGFloat)f maxDigits:(NSUInteger)numDigits
@@ -755,7 +755,7 @@
//^-----^ <-Returns this substring. (Trailing zeroes are deleted.)
//^^ <-Returns this substring (everything before the decimal point) for a whole number.
- NSString *format = numDigits ? [NSString stringWithFormat:@"%%.%uf", numDigits] : @"%f";
+ NSString *format = numDigits ? [NSString stringWithFormat:@"%%.%luf", numDigits] : @"%f"; NSString *str = [NSString stringWithFormat:format, (double)f];
NSUInteger i = [str length];
@@ -778,7 +778,7 @@
if (!lineBreakCharacterSet) {
static const unichar lineBreakCharacters[numberOfLineBreakCharacters] = { LINE_FEED, FORM_FEED, CARRIAGE_RETURN, NEXT_LINE, LINE_SEPARATOR, PARAGRAPH_SEPARATOR };
- lineBreakCharacterSet = [[NSCharacterSet characterSetWithCharactersInString:[NSString stringWithCharacters:lineBreakCharacters length:numberOfLineBreakCharacters]] retain];
+ lineBreakCharacterSet = [NSCharacterSet characterSetWithCharactersInString:[NSString stringWithCharacters:lineBreakCharacters length:numberOfLineBreakCharacters]]; return lineBreakCharacterSet;
@@ -840,7 +840,7 @@
substringRange.length = lineBreakRange.location - searchRange.location;
[lines addObject:[self substringWithRange:substringRange]];
- if (separatorObj) [lines addObject:[[separatorObj copy] autorelease]];
+ if (separatorObj) [lines addObject:[separatorObj copy]]; searchRange.location = (lineBreakRange.location + lineBreakRange.length);
searchRange.length = selfLength - searchRange.location;
@@ -889,13 +889,13 @@
// reserved = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" | "$" | ","
- NSString *string = (NSString *)CFURLCreateStringByAddingPercentEscapes(NULL,
+ NSString *string = (__bridge_transfer NSString *)CFURLCreateStringByAddingPercentEscapes(NULL, + (__bridge CFStringRef)self, (CFStringRef)@";/?:@&=+$",
- return [string autorelease];
--- a/Frameworks/AIUtilities Framework/Source/AIStringFormatter.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIStringFormatter.m Sun Sep 09 12:24:39 2012 -0400
@@ -27,14 +27,14 @@
+ (id)stringFormatterAllowingCharacters:(NSCharacterSet *)inCharacters length:(NSInteger)inLength caseSensitive:(BOOL)inCaseSensitive errorMessage:(NSString *)inErrorMessage
- return [[[self alloc] initAllowingCharacters:inCharacters length:inLength caseSensitive:inCaseSensitive errorMessage:inErrorMessage] autorelease];
+ return [[self alloc] initAllowingCharacters:inCharacters length:inLength caseSensitive:inCaseSensitive errorMessage:inErrorMessage]; - (id)initAllowingCharacters:(NSCharacterSet *)inCharacters length:(NSInteger)inLength caseSensitive:(BOOL)inCaseSensitive errorMessage:(NSString *)inErrorMessage
if ((self = [super init])) {
- errorMessage = [inErrorMessage retain];
- characters = [inCharacters retain];
+ errorMessage = inErrorMessage; + characters = inCharacters; caseSensitive = inCaseSensitive;
@@ -124,15 +124,4 @@
- [errorMessage release];
--- a/Frameworks/AIUtilities Framework/Source/AISystemNetworkDefaults.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AISystemNetworkDefaults.m Sun Sep 09 12:24:39 2012 -0400
@@ -84,19 +84,18 @@
- if ((proxyDict = (NSDictionary *)SCDynamicStoreCopyProxies(NULL))) {
- [proxyDict autorelease];
+ if ((proxyDict = (__bridge_transfer NSDictionary *)SCDynamicStoreCopyProxies(NULL))) { - enable = [[proxyDict objectForKey:(NSString *)enableKey] intValue];
+ enable = [[proxyDict objectForKey:(__bridge NSString *)enableKey] intValue]; - hostString = [proxyDict objectForKey:(NSString *)proxyKey];
+ hostString = [proxyDict objectForKey:(__bridge NSString *)proxyKey]; - portNum = [proxyDict objectForKey:(NSString *)portKey];
+ portNum = [proxyDict objectForKey:(__bridge NSString *)portKey]; @@ -131,7 +130,7 @@
NSString *pacFile = [proxyDict objectForKey:(NSString *)kSCPropNetProxiesProxyAutoConfigURLString];
- CFURLRef url = (CFURLRef)[NSURL URLWithString:[NSString stringWithFormat:@"http://%@", hostName ?: @"google.com"]];
+ CFURLRef url = (__bridge CFURLRef)[NSURL URLWithString:[NSString stringWithFormat:@"http://%@", hostName ?: @"google.com"]]; NSString *scriptStr = [NSString stringWithContentsOfURL:[NSURL URLWithString:pacFile] encoding:NSUTF8StringEncoding error:NULL];
@@ -143,7 +142,7 @@
CFRelease(CFNetworkCopyProxiesForURL(url, NULL));
- proxies = [(NSArray *)CFNetworkCopyProxiesForAutoConfigurationScript((CFStringRef)scriptStr, url, &error) autorelease];
+ proxies = (__bridge_transfer NSArray *)CFNetworkCopyProxiesForAutoConfigurationScript((__bridge CFStringRef)scriptStr, url, &error); CFStringRef description = CFErrorCopyDescription(error);
--- a/Frameworks/AIUtilities Framework/Source/AITextAttachmentAdditions.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AITextAttachmentAdditions.m Sun Sep 09 12:24:39 2012 -0400
@@ -21,7 +21,7 @@
- (BOOL)consideredImageForHFSType:(OSType)HFSTypeCode
pathExtension:(NSString *)pathExtension
- NSMutableArray *imageFileTypes = [[[NSImage imageFileTypes] mutableCopy] autorelease];
+ NSMutableArray *imageFileTypes = [[NSImage imageFileTypes] mutableCopy]; NSArray *removeFileTypes = [NSArray arrayWithObjects:@"pdf", @"PDF", @"psd", @"PSD", @"'PDF '", nil];
[imageFileTypes removeObjectsInArray:removeFileTypes];
--- a/Frameworks/AIUtilities Framework/Source/AITextAttributes.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AITextAttributes.m Sun Sep 09 12:24:39 2012 -0400
@@ -35,19 +35,19 @@
//Creates a new instance of AITextAttributes
+ (id)textAttributesWithFontFamily:(NSString *)inFamilyName traits:(NSFontTraitMask)inTraits size:(NSInteger)inSize
- return [[[self alloc] initWithFontFamily:inFamilyName traits:inTraits size:inSize] autorelease];
+ return [[self alloc] initWithFontFamily:inFamilyName traits:inTraits size:inSize]; + (id)textAttributesWithDictionary:(NSDictionary *)inAttributes
- return [[[self alloc] initWithDictionary:inAttributes] autorelease];
+ return [[self alloc] initWithDictionary:inAttributes]; - (id)initWithFontFamily:(NSString *)inFamilyName traits:(NSFontTraitMask)inTraits size:(NSInteger)inSize
if ((self = [self init])) {
- fontFamilyName = [inFamilyName retain];
+ fontFamilyName = inFamilyName; fontTraitsMask = inTraits;
@@ -58,17 +58,16 @@
- (id)initWithDictionary:(NSDictionary *)inAttributes
if ((self = [self init])) {
dictionary = [inAttributes mutableCopy];
NSFont *font = [dictionary objectForKey:NSFontAttributeName];
- fontFamilyName = [[font familyName] retain];
+ fontFamilyName = [font familyName]; fontTraitsMask = [[NSFontManager sharedFontManager] traitsOfFont:font];
fontSize = [font pointSize];
- fontFamilyName = [@"Helvetica" retain];
+ fontFamilyName = @"Helvetica"; @@ -90,21 +89,12 @@
- [fontFamilyName release];
- (id)copyWithZone:(NSZone *)zone
AITextAttributes *newTextAttributes = [[AITextAttributes alloc] init];
newTextAttributes->dictionary = [dictionary mutableCopy];
- newTextAttributes->fontFamilyName = [fontFamilyName retain];
+ newTextAttributes->fontFamilyName = fontFamilyName; newTextAttributes->fontTraitsMask = fontTraitsMask;
newTextAttributes->fontSize = fontSize;
@@ -120,8 +110,7 @@
- (void)setFontFamily:(NSString *)inName
if (fontFamilyName != inName) {
- [fontFamilyName release];
- fontFamilyName = [inName retain];
+ fontFamilyName = inName; [dictionary removeObjectForKey:NSFontAttributeName];
@@ -317,7 +306,7 @@
- (void)resetFontAttributes
- [fontFamilyName release]; fontFamilyName = nil;
[dictionary removeObjectForKey:NSForegroundColorAttributeName];
[dictionary removeObjectForKey:NSBackgroundColorAttributeName];
@@ -364,7 +353,7 @@
paragraphStyle = [NSParagraphStyle defaultParagraphStyle];
- newParagraphStyle = [[paragraphStyle mutableCopy] autorelease];
+ newParagraphStyle = [paragraphStyle mutableCopy]; [newParagraphStyle setBaseWritingDirection:inDirection];
[dictionary setObject:newParagraphStyle forKey:NSParagraphStyleAttributeName];
--- a/Frameworks/AIUtilities Framework/Source/AITextViewWithPlaceholder.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AITextViewWithPlaceholder.m Sun Sep 09 12:24:39 2012 -0400
@@ -27,14 +27,13 @@
// NSDictionary *attributes;
// attributes = [NSDictionary dictionaryWithObjectsAndKeys:[NSColor grayColor], NSForegroundColorAttributeName, nil];
- [self setPlaceholder:[[[NSAttributedString alloc] initWithString:inPlaceholderString
- attributes:nil] autorelease]];
+ [self setPlaceholder:[[NSAttributedString alloc] initWithString:inPlaceholderString - (void)setPlaceholder:(NSAttributedString *)inPlaceholder
if (inPlaceholder != placeholder) {
NSMutableAttributedString *tempPlaceholder = [inPlaceholder mutableCopy];
[tempPlaceholder addAttribute:NSForegroundColorAttributeName value:[NSColor grayColor] range:NSMakeRange(0, [tempPlaceholder length])];
@@ -50,13 +49,6 @@
- (void)drawRect:(NSRect)rect
--- a/Frameworks/AIUtilities Framework/Source/AIToolbarUtilities.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIToolbarUtilities.m Sun Sep 09 12:24:39 2012 -0400
@@ -27,7 +27,7 @@
+ (NSToolbarItem *)toolbarItemWithIdentifier:(NSString *)identifier label:(NSString *)label paletteLabel:(NSString *)paletteLabel toolTip:(NSString *)toolTip target:(id)target settingSelector:(SEL)settingSelector itemContent:(id)itemContent action:(SEL)action menu:(NSMenu *)menu
- NSToolbarItem *item = [[[NSToolbarItem alloc] initWithItemIdentifier:identifier] autorelease];
+ NSToolbarItem *item = [[NSToolbarItem alloc] initWithItemIdentifier:identifier]; @@ -55,7 +55,7 @@
//We actually need an NSMenuItem here, so we construct one
- mItem = [[[NSMenuItem alloc] init] autorelease];
+ mItem = [[NSMenuItem alloc] init]; [mItem setSubmenu: menu];
[mItem setTitle: [menu title]];
[item setMenuFormRepresentation:mItem];
@@ -70,11 +70,11 @@
item = [theDict objectForKey:itemIdentifier];
- newItem = [[item copy] autorelease];
if ([item view] != NULL) {
if ([[item view] respondsToSelector:@selector(copyWithZone:)]) {
- [newItem setView:[[[item view] copy] autorelease]];
+ [newItem setView:[[item view] copy]]; /* For a toolbar only used in one window at a time, it's alright for a view to not allow copying.
--- a/Frameworks/AIUtilities Framework/Source/AITooltipUtilities.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AITooltipUtilities.m Sun Sep 09 12:24:39 2012 -0400
@@ -54,7 +54,7 @@
+ (void)showTooltipWithString:(NSString *)inString onWindow:(NSWindow *)inWindow atPoint:(NSPoint)inPoint orientation:(AITooltipOrientation)inOrientation
- [self showTooltipWithAttributedString:[[[NSAttributedString alloc] initWithString:inString] autorelease]
+ [self showTooltipWithAttributedString:[[NSAttributedString alloc] initWithString:inString] orientation:inOrientation];
@@ -109,7 +109,7 @@
!(inTitle == tooltipTitle) ||
!(inImage == tooltipImage)) { //we don't exist or something changed
- [tooltipTitle release]; tooltipTitle = [inTitle retain];
+ tooltipTitle = inTitle; [[textView_tooltipTitle textStorage] replaceCharactersInRange:NSMakeRange(0,[[textView_tooltipTitle textStorage] length])
@@ -118,7 +118,7 @@
[[textView_tooltipTitle textStorage] deleteCharactersInRange:NSMakeRange(0,[[textView_tooltipTitle textStorage] length])];
- [tooltipBody release]; tooltipBody = [inBody retain];
[[textView_tooltipBody textStorage] replaceCharactersInRange:NSMakeRange(0,[[textView_tooltipBody textStorage] length])
withAttributedString:tooltipBody];
@@ -126,7 +126,7 @@
[[textView_tooltipBody textStorage] deleteCharactersInRange:NSMakeRange(0,[[textView_tooltipBody textStorage] length])];
- [tooltipImage release]; tooltipImage = [inImage retain];
+ tooltipImage = inImage; imageOnRight = inImageOnRight;
[view_tooltipImage setImage:tooltipImage];
@@ -198,12 +198,10 @@
layoutManager = [[NSLayoutManager alloc] init];
[textStorage_tooltipTitle addLayoutManager:layoutManager];
- [layoutManager release];
container = [[NSTextContainer alloc] initWithContainerSize:NSMakeSize(TOOLTIP_MAX_WIDTH,10000000.0f)];
[container setLineFragmentPadding:1.0f]; //so widths will caclulate properly
[layoutManager addTextContainer:container];
textView_tooltipTitle = [[NSTextView alloc] initWithFrame:NSZeroRect textContainer:container];
[textView_tooltipTitle setSelectable:NO];
@@ -218,12 +216,10 @@
layoutManager = [[NSLayoutManager alloc] init];
[textStorage_tooltipBody addLayoutManager:layoutManager];
- [layoutManager release];
container = [[NSTextContainer alloc] initWithContainerSize:NSMakeSize(TOOLTIP_MAX_WIDTH,10000000.0f)];
[container setLineFragmentPadding:0.0f]; //so widths will caclulate properly
[layoutManager addTextContainer:container];
textView_tooltipBody = [[NSTextView alloc] initWithFrame:NSZeroRect textContainer:container];
[textView_tooltipBody setSelectable:NO];
@@ -267,18 +263,18 @@
+ (void)_reallyCloseTooltip
- [textView_tooltipBody release]; textView_tooltipBody = nil;
- [textView_tooltipTitle release]; textView_tooltipTitle = nil;
- [textStorage_tooltipBody release]; textStorage_tooltipBody = nil;
- [textStorage_tooltipTitle release]; textStorage_tooltipTitle = nil;
- [view_tooltipImage release]; view_tooltipImage = nil;
- [tooltipWindow release]; tooltipWindow = nil;
- [tooltipBody release]; tooltipBody = nil;
- [tooltipTitle release]; tooltipTitle = nil;
- [tooltipImage release]; tooltipImage = nil;
+ textView_tooltipBody = nil; + textView_tooltipTitle = nil; + textStorage_tooltipBody = nil; + textStorage_tooltipTitle = nil; + view_tooltipImage = nil; tooltipPoint = NSZeroPoint;
- [fadeOutAnimation release]; fadeOutAnimation = nil;
+ fadeOutAnimation = nil; @@ -293,7 +289,7 @@
static dispatch_once_t setTitleAndBodyMarginLineColor;
dispatch_once(&setTitleAndBodyMarginLineColor, ^{
- titleAndBodyMarginLineColor = [[[NSColor grayColor] colorWithAlphaComponent:.7f] retain];
+ titleAndBodyMarginLineColor = [[NSColor grayColor] colorWithAlphaComponent:.7f]; --- a/Frameworks/AIUtilities Framework/Source/AIVariableHeightOutlineView.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIVariableHeightOutlineView.m Sun Sep 09 12:24:39 2012 -0400
@@ -77,8 +77,6 @@
[[NSNotificationCenter defaultCenter] removeObserver:self];
@@ -338,8 +336,8 @@
//and then draw the cell into it at the regular size. This way the cell can overflow its bounds as normal and not
//spill outside the drag image.
rowRect = [self rectOfRow:firstRow];
- image = [[[NSImage alloc] initWithSize:NSMakeSize(rowRect.size.width,
- rowRect.size.height*count + [self intercellSpacing].height*(count-1))] autorelease];
+ image = [[NSImage alloc] initWithSize:NSMakeSize(rowRect.size.width, + rowRect.size.height*count + [self intercellSpacing].height*(count-1))]; //Draw (Since the OLV is normally flipped, we have to be flipped when drawing)
--- a/Frameworks/AIUtilities Framework/Source/AIVerticallyCenteredTextCell.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIVerticallyCenteredTextCell.m Sun Sep 09 12:24:39 2012 -0400
@@ -68,7 +68,7 @@
//Paragraph style for alignment and clipping
- NSMutableParagraphStyle *style = [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] autorelease];
+ NSMutableParagraphStyle *style = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; [style setAlignment:[self alignment]];
[style setLineBreakMode:[self lineBreakMode]];
@@ -105,8 +105,6 @@
[attributedTitle drawInRect:cellFrame];
- [attributedTitle release];
--- a/Frameworks/AIUtilities Framework/Source/AIViewAdditions.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/AIViewAdditions.m Sun Sep 09 12:24:39 2012 -0400
@@ -27,26 +27,21 @@
//Remove all the subviews from a view
- (void)removeAllSubviews
- subviews = [[self subviews] copy];
- for (loop = 0;loop < [subviews count]; loop++) {
- [[subviews objectAtIndex:loop] removeFromSuperview];
+ for (NSView *subview in [self.subviews copy]) { + [subview removeFromSuperview];
- (void)bringSubviewToFront:(NSView *)subview
- [self sortSubviewsUsingFunction:bringToFront context:subview];
+ [self sortSubviewsUsingFunction:bringToFront context:(__bridge void *)subview]; NSComparisonResult bringToFront(id itemA, id itemB, void *target)
+ if (itemA == (__bridge id)target) { return NSOrderedDescending;
- } else if (itemB == target) {
+ } else if (itemB == (__bridge id)target) { return NSOrderedAscending;
--- a/Frameworks/AIUtilities Framework/Source/JVMarkedScroller.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/JVMarkedScroller.m Sun Sep 09 12:24:39 2012 -0400
@@ -20,8 +20,8 @@
+__unsafe_unretained NSString *identifier; +__unsafe_unretained NSColor *color; @interface JVMarkedScroller (PRIVATE)
@@ -32,8 +32,8 @@
@implementation JVMarkedScroller
- (id) initWithFrame:(NSRect) frame {
if( ( self = [super initWithFrame:frame] ) ) {
- _marks = [[NSMutableSet set] retain];
- _shades = [[NSMutableArray array] retain];
+ _marks = [NSMutableSet set]; + _shades = [NSMutableArray array]; _nearestPreviousMark = NSNotFound;
_nearestNextMark = NSNotFound;
_currentMark = NSNotFound;
@@ -41,16 +41,6 @@
+ (BOOL)isCompatibleWithOverlayScrollers {
@@ -195,60 +185,59 @@
- (NSMenu *) menuForEvent:(NSEvent *) event {
- NSMenu *menu = [[[NSMenu alloc] initWithTitle:@""] autorelease];
+ NSMenu *menu = [[NSMenu alloc] initWithTitle:@""]; - item = [[[NSMenuItem alloc] initWithTitle:AILocalizedStringFromTableInBundle( @"Clear All Marks", nil, [NSBundle bundleWithIdentifier:AIUTILITIES_BUNDLE_ID], "clear all marks contextual menu item title" )
+ item = [[NSMenuItem alloc] initWithTitle:AILocalizedStringFromTableInBundle( @"Clear All Marks", nil, [NSBundle bundleWithIdentifier:AIUTILITIES_BUNDLE_ID], "clear all marks contextual menu item title" ) action:@selector( removeAllMarks )
- keyEquivalent:@""] autorelease];
- item = [[[NSMenuItem alloc] initWithTitle:AILocalizedStringFromTableInBundle( @"Clear Marks from Here Left", nil, [NSBundle bundleWithIdentifier:AIUTILITIES_BUNDLE_ID], "clear marks from here left contextual menu")
+ item = [[NSMenuItem alloc] initWithTitle:AILocalizedStringFromTableInBundle( @"Clear Marks from Here Left", nil, [NSBundle bundleWithIdentifier:AIUTILITIES_BUNDLE_ID], "clear marks from here left contextual menu") action:@selector( clearMarksHereLess: )
- keyEquivalent:@""] autorelease];
- item = [[[NSMenuItem alloc] initWithTitle:AILocalizedStringFromTableInBundle( @"Clear Marks from Here Right", nil, [NSBundle bundleWithIdentifier:AIUTILITIES_BUNDLE_ID], "clear marks from here right contextual menu")
- action:@selector( clearMarksHereGreater: ) keyEquivalent:@""]
+ item = [[NSMenuItem alloc] initWithTitle:AILocalizedStringFromTableInBundle( @"Clear Marks from Here Right", nil, [NSBundle bundleWithIdentifier:AIUTILITIES_BUNDLE_ID], "clear marks from here right contextual menu") + action:@selector( clearMarksHereGreater: ) keyEquivalent:@""]; - item = [[[NSMenuItem alloc] initWithTitle:AILocalizedStringFromTableInBundle( @"Clear Marks from Here Up", nil, [NSBundle bundleWithIdentifier:AIUTILITIES_BUNDLE_ID], "clear marks from here up contextual menu")
+ item = [[NSMenuItem alloc] initWithTitle:AILocalizedStringFromTableInBundle( @"Clear Marks from Here Up", nil, [NSBundle bundleWithIdentifier:AIUTILITIES_BUNDLE_ID], "clear marks from here up contextual menu") action:@selector( clearMarksHereLess: )
- keyEquivalent:@""] autorelease];
- item = [[[NSMenuItem alloc] initWithTitle:AILocalizedStringFromTableInBundle( @"Clear Marks from Here Down", nil, [NSBundle bundleWithIdentifier:AIUTILITIES_BUNDLE_ID], "clear marks from here up contextual menu")
+ item = [[NSMenuItem alloc] initWithTitle:AILocalizedStringFromTableInBundle( @"Clear Marks from Here Down", nil, [NSBundle bundleWithIdentifier:AIUTILITIES_BUNDLE_ID], "clear marks from here up contextual menu") action:@selector( clearMarksHereGreater: )
- keyEquivalent:@""] autorelease];
[menu addItem:[NSMenuItem separatorItem]];
- item = [[[NSMenuItem alloc] initWithTitle:AILocalizedStringFromTableInBundle( @"Jump to Previous Mark", nil, [NSBundle bundleWithIdentifier:AIUTILITIES_BUNDLE_ID], "jump to previous mark contextual menu")
+ item = [[NSMenuItem alloc] initWithTitle:AILocalizedStringFromTableInBundle( @"Jump to Previous Mark", nil, [NSBundle bundleWithIdentifier:AIUTILITIES_BUNDLE_ID], "jump to previous mark contextual menu") action:@selector( jumpToPreviousMark: )
- keyEquivalent:@"["] autorelease];
[item setKeyEquivalentModifierMask:NSAlternateKeyMask | NSCommandKeyMask];
- item = [[[NSMenuItem alloc] initWithTitle:AILocalizedStringFromTableInBundle( @"Jump to Next Mark", nil, [NSBundle bundleWithIdentifier:AIUTILITIES_BUNDLE_ID], "jump to next mark contextual menu")
+ item = [[NSMenuItem alloc] initWithTitle:AILocalizedStringFromTableInBundle( @"Jump to Next Mark", nil, [NSBundle bundleWithIdentifier:AIUTILITIES_BUNDLE_ID], "jump to next mark contextual menu") action:@selector( jumpToNextMark: )
- keyEquivalent:@"]"] autorelease];
[item setKeyEquivalentModifierMask:NSAlternateKeyMask | NSCommandKeyMask];
- item = [[[NSMenuItem alloc] initWithTitle:AILocalizedStringFromTableInBundle( @"Jump to Focus Mark", nil, [NSBundle bundleWithIdentifier:AIUTILITIES_BUNDLE_ID], "jump to the mark where the last content the user saw ends")
+ item = [[NSMenuItem alloc] initWithTitle:AILocalizedStringFromTableInBundle( @"Jump to Focus Mark", nil, [NSBundle bundleWithIdentifier:AIUTILITIES_BUNDLE_ID], "jump to the mark where the last content the user saw ends") action:@selector( jumpToFocusMark: )
- keyEquivalent:@""] autorelease];
@@ -492,7 +481,7 @@
- (void) removeMarkWithIdentifier:(NSString *) identifier {
- NSEnumerator *e = [[[_marks copy] autorelease] objectEnumerator];
+ NSEnumerator *e = [[_marks copy] objectEnumerator]; while( ( obj = [e nextObject] ) ) {
@@ -506,7 +495,7 @@
- (void) removeMarksGreaterThan:(NSUInteger) location {
- NSEnumerator *enumerator = [[[_marks copy] autorelease] objectEnumerator];
+ NSEnumerator *enumerator = [[_marks copy] objectEnumerator]; while( ( obj = [enumerator nextObject] ) ) {
@@ -520,7 +509,7 @@
- (void) removeMarksLessThan:(NSUInteger) location {
- NSEnumerator *enumerator = [[[_marks copy] autorelease] objectEnumerator];
+ NSEnumerator *enumerator = [[_marks copy] objectEnumerator]; while( ( obj = [enumerator nextObject] ) ) {
@@ -534,7 +523,7 @@
- (void) removeMarksInRange:(NSRange) range {
- NSEnumerator *enumerator = [[[_marks copy] autorelease] objectEnumerator];
+ NSEnumerator *enumerator = [[_marks copy] objectEnumerator]; while( ( obj = [enumerator nextObject] ) ) {
--- a/Frameworks/AIUtilities Framework/Source/MVMenuButton.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/MVMenuButton.m Sun Sep 09 12:24:39 2012 -0400
@@ -42,7 +42,7 @@
- (id)copyWithZone:(NSZone *)zone
- MVMenuButton *newButton = [[[self class] allocWithZone:zone] initWithFrame:[self frame]];
+ MVMenuButton *newButton = [[[self class] alloc] initWithFrame:[self frame]]; [newButton setControlSize:controlSize];
@@ -50,20 +50,11 @@
[newButton setDrawsArrow:drawsArrow];
- [newButton setMenu:[[[self menu] copy] autorelease]];
+ [newButton setMenu:[[self menu] copy]];
//Configure ------------------------------------------------------------------------------------------------------------
//Control Size (Allows us to dynamically size for a small or big toolbar)
@@ -100,7 +91,7 @@
//Reset the popup arrow path cache, we'll need to re-calculate it for the new size
- [arrowPath release]; arrowPath = nil;
- (NSControlSize)controlSize
@@ -111,8 +102,7 @@
- (void)setImage:(NSImage *)inImage
if (bigImage != inImage) {
- bigImage = [inImage retain];
//Update our control size and the displayed image
@@ -164,7 +154,7 @@
NSRect frame = [self frame];
- arrowPath = [[NSBezierPath bezierPath] retain];
+ arrowPath = [NSBezierPath bezierPath]; if (controlSize == NSRegularControlSize) {
[arrowPath moveToPoint:NSMakePoint(NSWidth(frame)-9, NSHeight(frame)-5)];
--- a/Frameworks/AIUtilities Framework/Source/NSCalendarDate+ISO8601Parsing.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/NSCalendarDate+ISO8601Parsing.m Sun Sep 09 12:24:39 2012 -0400
@@ -579,12 +579,11 @@
static NSInteger lastUsedSecondsFromGMT = NSNotFound;
static NSTimeZone *lastUsedTimeZone;
if (secondsFromGMT == lastUsedSecondsFromGMT)
- timeZone = [[lastUsedTimeZone retain] autorelease];
+ timeZone = lastUsedTimeZone; timeZone = [NSTimeZone timeZoneForSecondsFromGMT:secondsFromGMT];
lastUsedSecondsFromGMT = secondsFromGMT;
- [lastUsedTimeZone autorelease];
- lastUsedTimeZone = [timeZone retain];
+ lastUsedTimeZone = timeZone; --- a/Frameworks/AIUtilities Framework/Source/NSCalendarDate+ISO8601Unparsing.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/NSCalendarDate+ISO8601Unparsing.m Sun Sep 09 12:24:39 2012 -0400
@@ -43,16 +43,15 @@
NSString *dateFormat = [(includeTime ? @"%Y-%m-%dT%H:%M:%S" : @"%Y-%m-%d") prepareDateFormatWithTimeSeparator:timeSep];
NSDateFormatter *formatter = [[NSDateFormatter alloc] initWithDateFormat:dateFormat allowNaturalLanguage:NO];
NSString *str = [formatter stringForObjectValue:self];
NSInteger offset = [[self timeZone] secondsFromGMT];
offset /= 60; //bring down to minutes
str = [str stringByAppendingString:@"Z"];
- str = [str stringByAppendingFormat:@"-%02d:%02d", -offset / 60, -offset % 60];
+ str = [str stringByAppendingFormat:@"-%02ld:%02ld", -offset / 60, -offset % 60]; - str = [str stringByAppendingFormat:@"+%02d:%02d", offset / 60, offset % 60];
+ str = [str stringByAppendingFormat:@"+%02ld:%02ld", offset / 60, offset % 60]; @@ -107,22 +106,20 @@
NSDateFormatter *formatter = [[NSDateFormatter alloc] initWithDateFormat:[@"T%H:%M:%S%z" prepareDateFormatWithTimeSeparator:timeSep] allowNaturalLanguage:NO];
timeString = [formatter stringForObjectValue:self];
- return [NSString stringWithFormat:@"%u-W%02u-%02u%@", year, week, dayOfWeek + 1U, timeString];
+ return [NSString stringWithFormat:@"%lu-W%02lu-%02lu%@", year, week, dayOfWeek + 1U, timeString]; - (NSString *)ISO8601OrdinalDateStringWithTime:(BOOL)includeTime timeSeparator:(unichar)timeSep {
NSDateFormatter *formatter = [[NSDateFormatter alloc] initWithDateFormat:[@"T%H:%M:%S%z" prepareDateFormatWithTimeSeparator:timeSep] allowNaturalLanguage:NO];
timeString = [formatter stringForObjectValue:self];
- return [NSString stringWithFormat:@"%u-%03u%@", [self yearOfCommonEra], [self dayOfYear], timeString];
+ return [NSString stringWithFormat:@"%lu-%03lu%@", [self yearOfCommonEra], [self dayOfYear], timeString]; @@ -169,7 +166,7 @@
- (NSString *)prepareDateFormatWithTimeSeparator:(unichar)timeSep {
NSString *dateFormat = self;
- NSMutableString *dateFormatMutable = [[dateFormat mutableCopy] autorelease];
+ NSMutableString *dateFormatMutable = [dateFormat mutableCopy]; [dateFormatMutable replaceOccurrencesOfString:@":"
withString:[NSString stringWithCharacters:&timeSep length:1U]
options:NSBackwardsSearch | NSLiteralSearch
--- a/Frameworks/AIUtilities Framework/Source/OWAddressBookAdditions.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AIUtilities Framework/Source/OWAddressBookAdditions.m Sun Sep 09 12:24:39 2012 -0400
@@ -30,7 +30,7 @@
[result addObject:record];
- return [result autorelease];
--- a/Frameworks/Adium Framework/Source/AIAbstractAccount.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIAbstractAccount.h Sun Sep 09 12:24:39 2012 -0400
@@ -95,7 +95,7 @@
- (void)getProxyConfigurationNotifyingTarget:(id)target selector:(SEL)selector context:(id)context;
- (NSString *)lastDisconnectionError;
- (void)setLastDisconnectionError:(NSString *)inError;
-- (AIReconnectDelayType)shouldAttemptReconnectAfterDisconnectionError:(NSString **)disconnectionError;
+- (AIReconnectDelayType)shouldAttemptReconnectAfterDisconnectionError:(NSString * __strong *)disconnectionError; @property (readonly, nonatomic) BOOL encrypted;
--- a/Frameworks/Adium Framework/Source/AIAbstractAccount.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIAbstractAccount.m Sun Sep 09 12:24:39 2012 -0400
@@ -73,7 +73,7 @@
- (id)initWithUID:(NSString *)inUID internalObjectID:(NSString *)inInternalObjectID service:(AIService *)inService
- internalObjectID = [inInternalObjectID retain];
+ internalObjectID = inInternalObjectID; if ((self = [super initWithUID:inUID service:inService])) {
@@ -84,8 +84,8 @@
static NSDictionary *defaults = nil;
- defaults = [[NSDictionary dictionaryNamed:ACCOUNT_DEFAULTS
- forClass:[AIAccount class]] retain];
+ defaults = [NSDictionary dictionaryNamed:ACCOUNT_DEFAULTS + forClass:[AIAccount class]]; [adium.preferenceController registerDefaults:defaults
@@ -285,8 +285,7 @@
//Set our UID first (since self.formattedUID uses the UID as necessary)
if (![newProposedUID isEqualToString:self.UID]) {
- UID = [newProposedUID retain];
//Inform the account controller of the changed UID
[adium.accountController accountDidChangeUID:self];
@@ -350,17 +349,17 @@
if (silenceAllContactUpdatesTimer) {
[silenceAllContactUpdatesTimer invalidate];
- [silenceAllContactUpdatesTimer release]; silenceAllContactUpdatesTimer = nil;
+ silenceAllContactUpdatesTimer = nil; - silenceAllContactUpdatesTimer = [[NSTimer scheduledTimerWithTimeInterval:interval
+ silenceAllContactUpdatesTimer = [NSTimer scheduledTimerWithTimeInterval:interval selector:@selector(_endSilenceAllUpdates)
- (void)_endSilenceAllUpdates
- [silenceAllContactUpdatesTimer release]; silenceAllContactUpdatesTimer = nil;
+ silenceAllContactUpdatesTimer = nil; @@ -379,11 +378,11 @@
[self delayedUpdateContactStatus:inContact];
//Guard against subsequent updates
- delayedUpdateStatusTimer = [[NSTimer scheduledTimerWithTimeInterval:[self delayedUpdateStatusInterval]
+ delayedUpdateStatusTimer = [NSTimer scheduledTimerWithTimeInterval:[self delayedUpdateStatusInterval] selector:@selector(_delayedUpdateStatusTimer:)
//If there is an outstanding delay, set this contact as the target
if (!delayedUpdateStatusTargets) delayedUpdateStatusTargets = [[NSMutableArray alloc] init];
@@ -400,10 +399,10 @@
/* If we're done, release the array and stop the repeating timer */
if (![delayedUpdateStatusTargets count]) {
- [delayedUpdateStatusTargets release]; delayedUpdateStatusTargets = nil;
+ delayedUpdateStatusTargets = nil; [delayedUpdateStatusTimer invalidate];
- [delayedUpdateStatusTimer release]; delayedUpdateStatusTimer = nil;
+ delayedUpdateStatusTimer = nil; @@ -535,7 +534,7 @@
} else if ([key isEqualToString:KEY_USER_ICON]) {
NSData *originalData = [self userIconData];
- [self setAccountUserImage:(originalData ? [[[NSImage alloc] initWithData:originalData] autorelease] : nil)
+ [self setAccountUserImage:(originalData ? [[NSImage alloc] initWithData:originalData] : nil) @@ -729,7 +728,7 @@
- (void)setPasswordTemporarily:(NSString *)inPassword
if (password != inPassword) {
- [password release]; password = [inPassword retain];
@@ -984,11 +983,11 @@
- (void)_startAttributedRefreshTimer
if (!attributedRefreshTimer) {
- attributedRefreshTimer = [[NSTimer scheduledTimerWithTimeInterval:FILTERED_STRING_REFRESH
+ attributedRefreshTimer = [NSTimer scheduledTimerWithTimeInterval:FILTERED_STRING_REFRESH selector:@selector(_refreshAttributedStrings:)
@@ -999,7 +998,6 @@
if (attributedRefreshTimer) {
[attributedRefreshTimer invalidate];
- [attributedRefreshTimer release];
attributedRefreshTimer = nil;
@@ -1025,7 +1023,7 @@
if ([dynamicKeys count]) {
- for (key in [[dynamicKeys copy] autorelease]) {
+ for (key in [dynamicKeys copy]) { [self updateStatusForKey:key];
@@ -1177,7 +1175,7 @@
- message:[[[NSAttributedString alloc] initWithString:AILocalizedStringFromTableInBundle(@"You have connected", nil, [NSBundle bundleForClass:[AIAccount class]], "Displayed in an open chat when its account has been connected")] autorelease]
+ message:[[NSAttributedString alloc] initWithString:AILocalizedStringFromTableInBundle(@"You have connected", nil, [NSBundle bundleForClass:[AIAccount class]], "Displayed in an open chat when its account has been connected")] [eventMessage setCoalescingKey:ACCOUNT_STATUS_UPDATE_COALESCING_KEY];
@@ -1348,7 +1346,7 @@
- message:[[[NSAttributedString alloc] initWithString:AILocalizedStringFromTableInBundle(@"You have disconnected", nil, [NSBundle bundleForClass:[AIAccount class]], "Displayed in an open chat when its account has been connected")] autorelease]
+ message:[[NSAttributedString alloc] initWithString:AILocalizedStringFromTableInBundle(@"You have disconnected", nil, [NSBundle bundleForClass:[AIAccount class]], "Displayed in an open chat when its account has been connected")] withType:@"disconnected"];
[newStatusMessage setCoalescingKey:ACCOUNT_STATUS_UPDATE_COALESCING_KEY];
@@ -1459,8 +1457,7 @@
if (lastDisconnectionError != inError) {
- [lastDisconnectionError release];
- lastDisconnectionError = [inError retain];
+ lastDisconnectionError = inError; @@ -1470,7 +1467,7 @@
* Subclasses should return AIReconnectImmediately for invalid passwords or situations where immediate reconnect is possible,
* AIReconnectNormally to use the builtin exponential reconnect delay, and AIReconnectNever on unrecoverable errors.
-- (AIReconnectDelayType)shouldAttemptReconnectAfterDisconnectionError:(NSString **)disconnectionError
+- (AIReconnectDelayType)shouldAttemptReconnectAfterDisconnectionError:(NSString * __strong *)disconnectionError return AIReconnectNormally;
--- a/Frameworks/Adium Framework/Source/AIAbstractListController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIAbstractListController.m Sun Sep 09 12:24:39 2012 -0400
@@ -82,8 +82,8 @@
if ((self = [super init]))
- contactListView = [inContactListView retain];
- scrollView_contactList = [inScrollView_contactList retain];
+ contactListView = inContactListView; + scrollView_contactList = inScrollView_contactList; @@ -140,24 +140,17 @@
[contactListView setDelegate:nil];
[contactListView setDataSource:nil];
- [contactListView release]; contactListView = nil;
- [scrollView_contactList release]; scrollView_contactList = nil;
+ scrollView_contactList = nil; [tooltipTracker setDelegate:nil];
- [tooltipTracker release]; tooltipTracker = nil;
[[NSNotificationCenter defaultCenter] removeObserver:self];
@@ -207,14 +200,14 @@
- (void)configureViewsAndTooltips
//Configure the contact list view
- tooltipTracker = [[AISmoothTooltipTracker smoothTooltipTrackerForView:scrollView_contactList
- withDelegate:self] retain];
+ tooltipTracker = [AISmoothTooltipTracker smoothTooltipTrackerForView:scrollView_contactList /* The table column will want to interact with a cell. We use an AIMultiCellOutlineView subclass, though,
* so the contentCell and groupCell set in updateLayoutFromPrefDict:andThemeFromPrefDict: will actually be
- [[[contactListView tableColumns] objectAtIndex:0] setDataCell:[[[AIListCell alloc] init] autorelease]];
+ [[[contactListView tableColumns] objectAtIndex:0] setDataCell:[[AIListCell alloc] init]]; [contactListView setTarget:self];
@@ -245,7 +238,7 @@
- (void)setContactListRoot:(ESObjectWithProperties<AIContainingObject> *)newContactListRoot
if (contactList != newContactListRoot) {
- [contactList release]; contactList = [newContactListRoot retain];
+ contactList = newContactListRoot; [contactListView reloadData];
@@ -328,10 +321,6 @@
NSTextAlignment contentCellAlignment, groupCellAlignment;
BOOL pillowsOrPillowsFittedWindowStyle;
contentCellAlignment = [[prefDict objectForKey:KEY_LIST_LAYOUT_ALIGNMENT] intValue];
groupCellAlignment = [[prefDict objectForKey:KEY_LIST_LAYOUT_GROUP_ALIGNMENT] intValue];
@@ -581,7 +570,7 @@
//Redraw the modified object (or the whole list, if object is nil)
- for (AIProxyListObject *proxyObject in [[object.proxyObjects copy] autorelease]) {
+ for (AIProxyListObject *proxyObject in [object.proxyObjects copy]) { [contactListView redisplayItem:proxyObject];
@@ -592,7 +581,7 @@
* For example, when a contact changes, redraw the metacontact which represents it if appropriate.
if (object && [object isKindOfClass:[AIListContact class]] && ([(AIListContact *)object parentContact] != object)) {
- for (AIProxyListObject *proxyObject in [[[(AIListContact *)object parentContact].proxyObjects copy] autorelease]) {
+ for (AIProxyListObject *proxyObject in [[(AIListContact *)object parentContact].proxyObjects copy]) { [contactListView redisplayItem:proxyObject];
@@ -776,8 +765,7 @@
NSArray *items = [notification object];
if (dragItems != items) {
- dragItems = [items retain];
// Remove this contact list if from drag & drop operation took the last group away
--- a/Frameworks/Adium Framework/Source/AIAbstractListObjectMenu.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIAbstractListObjectMenu.m Sun Sep 09 12:24:39 2012 -0400
@@ -53,8 +53,6 @@
[[NSNotificationCenter defaultCenter] removeObserver:self name:AIStatusIconSetDidChangeNotification object:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self name:AIServiceIconSetDidChangeNotification object:nil];
[self _destroyMenuItems];
@@ -63,7 +61,7 @@
- menuItems = [[self buildMenuItems] retain];
+ menuItems = [self buildMenuItems]; @@ -78,7 +76,7 @@
- menu = [[NSMenu allocWithZone:[NSMenu zone]] init];
+ menu = [[NSMenu alloc] init]; [menu setMenuChangedMessagesEnabled:NO];
for (NSMenuItem *menuItem in self.menuItems)
@@ -99,11 +97,11 @@
for (NSMenuItem *menuItem in self.menuItems) {
if ([menuItem representedObject] == object) {
- return [[menuItem retain] autorelease];
} else if ([menuItem submenu]) {
for (NSMenuItem *submenuItem in menuItem.submenu.itemArray) {
if ([submenuItem representedObject] == object)
- return [[submenuItem retain] autorelease];
@@ -124,8 +122,8 @@
- (void)_destroyMenuItems
- [menu release]; menu = nil;
- [menuItems release]; menuItems = nil;
@@ -176,7 +174,7 @@
[secondaryIcon drawInRect:compositeRect atSize:[secondaryIcon size] position:IMAGE_POSITION_RIGHT fraction:1.0f];
- return [composite autorelease];
--- a/Frameworks/Adium Framework/Source/AIAccount.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIAccount.h Sun Sep 09 12:24:39 2012 -0400
@@ -209,10 +209,10 @@
- (id<AIAccountControllerRemoveConfirmationDialog>)confirmationDialogForAccountDeletion __attribute__((objc_method_family(new)));
-@property (readonly, nonatomic) id<AIAccountControllerRemoveConfirmationDialog> confirmationDialogForAccountDeletion;
-@property (readonly, nonatomic) NSAlert *alertForAccountDeletion;
+@property (unsafe_unretained, readonly, nonatomic) id<AIAccountControllerRemoveConfirmationDialog> confirmationDialogForAccountDeletion; +@property (weak, readonly, nonatomic) NSAlert *alertForAccountDeletion; - (void)alertForAccountDeletion:(id<AIAccountControllerRemoveConfirmationDialog>)dialog didReturn:(NSInteger)returnCode;
-@property (readonly, nonatomic) NSString *explicitFormattedUID;
+@property (weak, readonly, nonatomic) NSString *explicitFormattedUID; @property (readonly, nonatomic) BOOL useHostForPasswordServerName;
@property (readonly, nonatomic) BOOL useInternalObjectIDForPasswordName;
@@ -230,7 +230,7 @@
@property (readwrite, nonatomic) BOOL isTemporary;
-@property (readonly, nonatomic) NSSet *supportedPropertyKeys;
+@property (weak, readonly, nonatomic) NSSet *supportedPropertyKeys; - (id)statusForKey:(NSString *)key;
- (void)updateStatusForKey:(NSString *)key;
- (void)delayedUpdateContactStatus:(AIListContact *)inContact;
@@ -278,12 +278,12 @@
- (NSArray *)menuItemsForChat:(AIChat *)inChat;
//Account-specific menu items
-@property (readonly, nonatomic) NSArray *accountActionMenuItems;
+@property (weak, readonly, nonatomic) NSArray *accountActionMenuItems; - (void)accountMenuDidUpdate:(NSMenuItem*)menuItem;
- (BOOL)allowSecureMessagingTogglingForChat:(AIChat *)inChat;
-@property (readonly, nonatomic) NSString *aboutEncryption;
+@property (weak, readonly, nonatomic) NSString *aboutEncryption; - (void)requestSecureMessaging:(BOOL)inSecureMessaging
- (void)promptToVerifyEncryptionIdentityInChat:(AIChat *)inChat;
--- a/Frameworks/Adium Framework/Source/AIAccount.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIAccount.m Sun Sep 09 12:24:39 2012 -0400
@@ -49,7 +49,7 @@
- (id)initWithAccount:(AIAccount*)ac alert:(NSAlert*)al;
-@property (readwrite, retain, nonatomic) id userData;
+@property (readwrite, nonatomic) id userData; - (void)alertDidEnd:(NSAlert *)alert returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo;
@@ -60,17 +60,11 @@
- (id)initWithAccount:(AIAccount*)ac alert:(NSAlert*)al {
if((self = [super init])) {
@@ -123,28 +117,24 @@
- [formattedUID release]; formattedUID = nil;
- [accountStatus release]; accountStatus = nil;
- [waitingToReconnect release]; waitingToReconnect = nil;
- [connectionProgressString release]; connectionProgressString = nil;
- [currentDisplayName release]; currentDisplayName = nil;
+ waitingToReconnect = nil; + connectionProgressString = nil; + currentDisplayName = nil; - [lastDisconnectionError release];
- [delayedUpdateStatusTargets release];
- [delayedUpdateStatusTimer invalidate]; [delayedUpdateStatusTimer release];
+ [delayedUpdateStatusTimer invalidate]; /* Our superclass releases internalObjectID in its dealloc, so we should set it to nil when do.
* We could just depend upon its implementation, but this is more robust.
- [internalObjectID release]; internalObjectID = nil;
+ internalObjectID = nil; [self _stopAttributedRefreshTimer];
- [autoRefreshingKeys release]; autoRefreshingKeys = nil;
+ autoRefreshingKeys = nil; [[NSNotificationCenter defaultCenter] removeObserver:self];
[adium.preferenceController unregisterPreferenceObserver:self];
@@ -303,8 +293,6 @@
if(returnCode == NSAlertDefaultReturn) {
- [(AIAccountDeletionDialog*)dialog release];
@@ -459,7 +447,7 @@
NSData *iconData = [self userIconData];
- return (iconData ? [[[NSImage alloc] initWithData:iconData] autorelease] : nil);
+ return (iconData ? [[NSImage alloc] initWithData:iconData] : nil); @@ -1061,10 +1049,10 @@
AIService *theService = self.service;
NSScriptObjectSpecifier *containerRef = [theService objectSpecifier];
- return [[[NSUniqueIDSpecifier alloc]
+ return [[NSUniqueIDSpecifier alloc] initWithContainerClassDescription:[containerRef keyClassDescription]
containerSpecifier:containerRef key:@"accounts"
- uniqueID:[self scriptingInternalObjectID]] autorelease];
+ uniqueID:[self scriptingInternalObjectID]]; @@ -1206,7 +1194,7 @@
//this can take a while...
- NSMutableArray *newParticipants = [[[NSMutableArray alloc] init] autorelease];
+ NSMutableArray *newParticipants = [[NSMutableArray alloc] init]; for (int i=0;i<[participants count];i++) {
[newParticipants addObject:[[participants objectAtIndex:i] objectsByEvaluatingSpecifier]];
@@ -1269,7 +1257,7 @@
if ([currentStatus mutabilityType] != AITemporaryEditableStatusState) {
- currentStatus = [[currentStatus mutableCopy] autorelease];
+ currentStatus = [currentStatus mutableCopy]; [currentStatus setMutabilityType:AITemporaryEditableStatusState];
[currentStatus setStatusType:type];
@@ -1290,7 +1278,7 @@
AIStatus *currentStatus = self.statusState;
if ([currentStatus mutabilityType] != AITemporaryEditableStatusState) {
- currentStatus = [[currentStatus mutableCopy] autorelease];
+ currentStatus = [currentStatus mutableCopy]; [currentStatus setMutabilityType:AITemporaryEditableStatusState];
--- a/Frameworks/Adium Framework/Source/AIAccountMenu.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIAccountMenu.h Sun Sep 09 12:24:39 2012 -0400
@@ -54,7 +54,7 @@
@property (readwrite, nonatomic) BOOL useSystemFont;
-@property (readwrite, nonatomic, assign) id<AIAccountMenuDelegate> delegate;
+@property (readwrite, nonatomic, unsafe_unretained) id<AIAccountMenuDelegate> delegate; - (NSMenuItem *)menuItemForAccount:(AIAccount *)account;
--- a/Frameworks/Adium Framework/Source/AIAccountMenu.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIAccountMenu.m Sun Sep 09 12:24:39 2012 -0400
@@ -70,9 +70,9 @@
submenuType:(AIAccountSubmenuType)inSubmenuType
showTitleVerbs:(BOOL)inShowTitleVerbs
- return [[[self alloc] initWithDelegate:inDelegate
+ return [[self alloc] initWithDelegate:inDelegate submenuType:inSubmenuType
- showTitleVerbs:inShowTitleVerbs] autorelease];
+ showTitleVerbs:inShowTitleVerbs]; @@ -110,7 +110,7 @@
[[AIContactObserverManager sharedManager] registerListObjectObserver:self];
if (submenuType == AIAccountStatusSubmenu) {
- statusMenu = [[AIStatusMenu statusMenuWithDelegate:self] retain];
+ statusMenu = [AIStatusMenu statusMenuWithDelegate:self]; @@ -124,15 +124,13 @@
if (submenuType == AIAccountStatusSubmenu) {
[NSObject cancelPreviousPerformRequestsWithTarget:statusMenu];
- [statusMenu release]; statusMenu = nil;
[[AIContactObserverManager sharedManager] unregisterListObjectObserver:self];
[[NSNotificationCenter defaultCenter] removeObserver:self];
@@ -232,7 +230,7 @@
for (AIAccount *account in accounts) {
if ((account.enabled && !delegateRespondsToShouldIncludeAccount) ||
(delegateRespondsToShouldIncludeAccount && [delegate accountMenu:self shouldIncludeAccount:account])) {
- NSMenuItem *menuItem = [[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:@""
+ NSMenuItem *menuItem = [[NSMenuItem alloc] initWithTitle:@"" action:@selector(selectAccountMenuItem:)
@@ -242,7 +240,6 @@
[menuItem setSubmenu:[self actionsMenuForAccount:account]];
[menuItemArray addObject:menuItem];
@@ -252,14 +249,13 @@
for (AIAccount *account in accounts) {
(!delegateRespondsToShouldIncludeAccount || [delegate accountMenu:self shouldIncludeAccount:account])) {
- NSMenuItem *menuItem = [[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:@""
+ NSMenuItem *menuItem = [[NSMenuItem alloc] initWithTitle:@"" action:@selector(toggleAccountEnabled:)
representedObject:account];
[self _updateMenuItem:menuItem];
[disabledAccountMenu addItem:menuItem];
@@ -275,28 +271,25 @@
format:AILocalizedString(@"%@",nil)];
- NSMenuItem *menuItem = [[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:AILocalizedString(@"Add Account", nil)
+ NSMenuItem *menuItem = [[NSMenuItem alloc] initWithTitle:AILocalizedString(@"Add Account", nil) action:@selector(dummyAction:)
[menuItemArray addObject:menuItem];
[menuItem setSubmenu:serviceMenu];
if ([disabledAccountMenu numberOfItems]) {
- NSMenuItem *menuItem = [[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:AILocalizedString(@"Disabled Accounts", nil)
+ NSMenuItem *menuItem = [[NSMenuItem alloc] initWithTitle:AILocalizedString(@"Disabled Accounts", nil) action:@selector(dummyAction:)
[menuItemArray addObject:menuItem];
[menuItem setSubmenu:disabledAccountMenu];
- [disabledAccountMenu release];
if (submenuType == AIAccountStatusSubmenu) {
@@ -370,19 +363,13 @@
[SSLIconText addAttribute:NSBaselineOffsetAttributeName value:[NSNumber numberWithFloat:-3.0f] range:NSMakeRange(0, [SSLIconText length])];
[title appendAttributedString:SSLIconText];
[menuItem setAttributedTitle:title];
- [textAttachment release];
[menuItem setAttributedTitle:plainTitle];
[account accountMenuDidUpdate:menuItem];
[[menuItem menu] setMenuChangedMessagesEnabled:YES];
@@ -518,7 +505,7 @@
- (NSMenu *)actionsMenuForAccount:(AIAccount *)inAccount
- NSMenu *actionsSubmenu = [[[NSMenu allocWithZone:[NSMenu zone]] init] autorelease];
+ NSMenu *actionsSubmenu = [[NSMenu alloc] init]; [actionsSubmenu setDelegate:self];
@@ -561,13 +548,12 @@
- (void)rebuildActionsSubmenu:(NSMenu*)actionsSubmenu withAccount:(AIAccount*)inAccount {
NSArray *accountActionMenuItems = (inAccount.online ? [inAccount accountActionMenuItems] : nil);
- menuItem = [[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:AILocalizedString(@"Edit Account", nil)
+ menuItem = [[NSMenuItem alloc] initWithTitle:AILocalizedString(@"Edit Account", nil) action:@selector(editAccount:)
representedObject:inAccount];
[actionsSubmenu addItem:menuItem];
[actionsSubmenu addItem:[NSMenuItem separatorItem]];
@@ -577,7 +563,6 @@
for (menuItem in accountActionMenuItems) {
NSMenuItem *newMenuItem = [menuItem copy];
[actionsSubmenu addItem:newMenuItem];
//Separate the actions from our final menu items which apply to all accounts
@@ -585,20 +570,19 @@
if ([inAccount enabled]) {
- menuItem = [[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:AILocalizedString(@"Disable", nil)
+ menuItem = [[NSMenuItem alloc] initWithTitle:AILocalizedString(@"Disable", nil) action:@selector(toggleAccountEnabled:)
representedObject:inAccount];
- menuItem = [[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:AILocalizedString(@"Enable", nil)
+ menuItem = [[NSMenuItem alloc] initWithTitle:AILocalizedString(@"Enable", nil) action:@selector(toggleAccountEnabled:)
representedObject:inAccount];
[actionsSubmenu addItem:menuItem];
@@ -647,7 +631,6 @@
[submenuItem setRepresentedObject:newRepresentedObject];
- [newRepresentedObject release];
//Recurse into any submenu on this menu item
updateRepresentedObjectForSubmenusOfMenuItem(submenuItem, account);
@@ -665,7 +648,7 @@
* By copying the accountMenuItem's target and action, it gains the action of toggling conncectivity,
* which is exactly what we want.
- onlineOfflineItem = [[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:(account.online ?
+ onlineOfflineItem = [[NSMenuItem alloc] initWithTitle:(account.online ? AILocalizedString(@"Disconnect", nil) :
AILocalizedString(@"Connect", nil))
@@ -675,7 +658,6 @@
[accountSubmenu insertItem:onlineOfflineItem atIndex:0];
[accountSubmenu insertItem:[NSMenuItem separatorItem] atIndex:1];
- [onlineOfflineItem release];
@@ -691,7 +673,7 @@
[accountSubmenu setMenuChangedMessagesEnabled:NO];
- accountSubmenu = [[[NSMenu allocWithZone:[NSMenu zone]] init] autorelease];
+ accountSubmenu = [[NSMenu alloc] init]; [accountSubmenu setMenuChangedMessagesEnabled:NO];
//Enumerate all the menu items we were originally passed
@@ -725,11 +707,9 @@
NSMenuItem *newItem = [statusMenuItem copy];
actualMenuItem = newItem;
[accountSubmenu addItem:newItem];
[actualMenuItem setRepresentedObject:newRepresentedObject];
- [newRepresentedObject release];
updateRepresentedObjectForSubmenusOfMenuItem(actualMenuItem, account);
@@ -738,13 +718,13 @@
NSMenuItem *enableDisableItem;
- enableDisableItem = [[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:AILocalizedString(@"Disable", nil)
+ enableDisableItem = [[NSMenuItem alloc] initWithTitle:AILocalizedString(@"Disable", nil) action:@selector(toggleAccountEnabled:)
representedObject:account];
- enableDisableItem = [[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:AILocalizedString(@"Enable", nil)
+ enableDisableItem = [[NSMenuItem alloc] initWithTitle:AILocalizedString(@"Enable", nil) action:@selector(toggleAccountEnabled:)
@@ -753,7 +733,6 @@
[accountSubmenu addItem:[NSMenuItem separatorItem]];
[accountSubmenu addItem:enableDisableItem];
- [enableDisableItem release];
[accountSubmenu setMenuChangedMessagesEnabled:YES];
--- a/Frameworks/Adium Framework/Source/AIAccountPlusFieldPromptController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIAccountPlusFieldPromptController.m Sun Sep 09 12:24:39 2012 -0400
@@ -164,11 +164,6 @@
// Setup the window before it is displayed
@@ -181,9 +176,9 @@
[textField_handle setMinStringLength:2];
- accountMenu = [[AIAccountMenu accountMenuWithDelegate:self
+ accountMenu = [AIAccountMenu accountMenuWithDelegate:self submenuType:AIAccountNoSubmenu
- showTitleVerbs:NO] retain];
[self _restoreLastAccountIfPossible];
[self AI_configureTextFieldForAccount:[[popUp_service selectedItem] representedObject]];
[self controlTextDidChange:nil];
@@ -196,8 +191,6 @@
[super windowWillClose:sender];
[[self class] destroySharedInstance];
@@ -239,13 +232,13 @@
if ([self accountMenu:inAccountMenu shouldIncludeAccount:account]) {
numberOfOnlineAccounts += 1;
if (numberOfOnlineAccounts > 1) {
- anyItem = [[[NSMenuItem alloc] initWithTitle:
+ anyItem = [[NSMenuItem alloc] initWithTitle: AILocalizedStringFromTableInBundle(@"Any",
[NSBundle bundleForClass:[AIAccountPlusFieldPromptController class]],
- keyEquivalent:@""] autorelease];
--- a/Frameworks/Adium Framework/Source/AIAccountViewController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIAccountViewController.m Sun Sep 09 12:24:39 2012 -0400
@@ -54,7 +54,7 @@
+ (id)accountViewController
- return [[[self alloc] init] autorelease];
+ return [[self alloc] init]; @@ -91,16 +91,8 @@
- [view_profile release];
- if (view_setup != view_options)
- [view_options release];
- [changedPrefDict release];
[[NSNotificationCenter defaultCenter] removeObserver:self];
--- a/Frameworks/Adium Framework/Source/AIActionDetailsPane.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIActionDetailsPane.m Sun Sep 09 12:24:39 2012 -0400
@@ -24,7 +24,7 @@
+ (AIActionDetailsPane *)actionDetailsPane
- return [[[self alloc] init] autorelease];
+ return [[self alloc] init]; @@ -33,7 +33,7 @@
+ (AIActionDetailsPane *)actionDetailsPaneForPlugin:(id)inPlugin
- return [[[self alloc] initForPlugin:inPlugin] autorelease];
+ return [[self alloc] initForPlugin:inPlugin]; --- a/Frameworks/Adium Framework/Source/AIAddressBookController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIAddressBookController.m Sun Sep 09 12:24:39 2012 -0400
@@ -109,8 +109,8 @@
//If Address Book integration is enabled, we need those preferences to determine contact's names
- displayFormat = [[adium.preferenceController preferenceForKey:KEY_AB_DISPLAYFORMAT
- group:PREF_GROUP_ADDRESSBOOK] retain];
+ displayFormat = [adium.preferenceController preferenceForKey:KEY_AB_DISPLAYFORMAT + group:PREF_GROUP_ADDRESSBOOK]; useFirstName = [[adium.preferenceController preferenceForKey:KEY_AB_USE_FIRSTNAME
group:PREF_GROUP_ADDRESSBOOK] boolValue];
useNickNameOnly = [[adium.preferenceController preferenceForKey:KEY_AB_USE_NICKNAME
@@ -120,8 +120,6 @@
//If old format-menu preference is set, perform migration
if ([adium.preferenceController preferenceForKey:@"AB Display Format" group:PREF_GROUP_ADDRESSBOOK]) {
- [displayFormat release];
NSInteger oldPreference = [[adium.preferenceController preferenceForKey:@"AB Display Format" group:PREF_GROUP_ADDRESSBOOK] integerValue];
@@ -129,7 +127,7 @@
displayFormat = [[NSString alloc] initWithFormat:@"%@ %@", FORMAT_FIRST_FULL, FORMAT_LAST_FULL];
- displayFormat = [FORMAT_FIRST_FULL retain];
+ displayFormat = FORMAT_FIRST_FULL; displayFormat = [[NSString alloc] initWithFormat:@"%@, %@", FORMAT_LAST_FULL, FORMAT_FIRST_FULL];
@@ -151,15 +149,15 @@
- serviceDict = [[NSDictionary dictionaryWithObjectsAndKeys:kABAIMInstantProperty,@"AIM",
- kABJabberInstantProperty,@"Jabber",
- kABMSNInstantProperty,@"MSN",
- kABYahooInstantProperty,@"Yahoo!",
- kABICQInstantProperty,@"ICQ",
- kABURLsProperty,@"Facebook", nil] retain];
+ serviceDict = [NSDictionary dictionaryWithObjectsAndKeys:kABInstantMessageServiceAIM,@"AIM", + kABInstantMessageServiceJabber,@"Jabber", + kABInstantMessageServiceMSN,@"MSN", + kABInstantMessageServiceYahoo,@"Yahoo!", + kABInstantMessageServiceICQ,@"ICQ", + kABInstantMessageServiceFacebook,@"Facebook", nil]; - [sharedAddressBook release]; sharedAddressBook = [[ABAddressBook sharedAddressBook] retain];
+ sharedAddressBook = [ABAddressBook sharedAddressBook]; [self installAddressBookActions];
@@ -212,7 +210,7 @@
[fileManager trashFileAtPath:[pluginDirectory stringByAppendingPathComponent:
[NSString stringWithFormat:@"%@-Adium.scpt",name]]];
- AILogWithSignature(@"Warning: Could not find %@",self, fullName);
+ AILogWithSignature(@"Warning: %@ Could not find %@",self, fullName); @@ -227,23 +225,21 @@
[adium.preferenceController unregisterPreferenceObserver:addressBookController];
[[NSNotificationCenter defaultCenter] removeObserver:addressBookController];
- [addressBookController release]; addressBookController = nil;
+ addressBookController = nil; - [serviceDict release]; serviceDict = nil;
- [sharedAddressBook release]; sharedAddressBook = nil;
- [personUniqueIdToMetaContactDict release]; personUniqueIdToMetaContactDict = nil;
+ sharedAddressBook = nil; + personUniqueIdToMetaContactDict = nil; [[AIContactObserverManager sharedManager] unregisterListObjectObserver:self];
[adium.preferenceController unregisterPreferenceObserver:self];
[[NSNotificationCenter defaultCenter] removeObserver:self];
- [displayFormat release]; displayFormat = nil;
@@ -255,23 +251,23 @@
- (void)adiumFinishedLaunching:(NSNotification *)notification
//Create our contextual menus
- showInABContextualMenuItem = [[[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:SHOW_IN_AB_CONTEXTUAL_MENU_TITLE
+ showInABContextualMenuItem = [[NSMenuItem alloc] initWithTitle:SHOW_IN_AB_CONTEXTUAL_MENU_TITLE action:@selector(showInAddressBook)
- keyEquivalent:@""] autorelease];
[showInABContextualMenuItem setTarget:self];
[showInABContextualMenuItem setTag:AIRequiresAddressBookEntry];
- editInABContextualMenuItem = [[[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:EDIT_IN_AB_CONTEXTUAL_MENU_TITLE
+ editInABContextualMenuItem = [[NSMenuItem alloc] initWithTitle:EDIT_IN_AB_CONTEXTUAL_MENU_TITLE action:@selector(editInAddressBook)
- keyEquivalent:@""] autorelease];
[editInABContextualMenuItem setTarget:self];
[editInABContextualMenuItem setKeyEquivalentModifierMask:NSAlternateKeyMask];
[editInABContextualMenuItem setAlternate:YES];
[editInABContextualMenuItem setTag:AIRequiresAddressBookEntry];
- addToABContexualMenuItem = [[[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:ADD_TO_AB_CONTEXTUAL_MENU_TITLE
+ addToABContexualMenuItem = [[NSMenuItem alloc] initWithTitle:ADD_TO_AB_CONTEXTUAL_MENU_TITLE action:@selector(addToAddressBook)
- keyEquivalent:@""] autorelease];
[addToABContexualMenuItem setTarget:self];
[addToABContexualMenuItem setTag:AIRequiresNoAddressBookEntry];
@@ -420,7 +416,7 @@
if (person && (person != [sharedAddressBook me])) {
NSData *existingABImageData = [person imageData];
- NSImage *existingABImage = (existingABImageData ? [[[NSImage alloc] initWithData:[person imageData]] autorelease] : nil);
+ NSImage *existingABImage = (existingABImageData ? [[NSImage alloc] initWithData:[person imageData]] : nil); NSImage *objectUserIcon = [listContact userIcon];
if (!existingABImage || objectUserIcon) {
@@ -553,7 +549,7 @@
automaticUserIconSync = [[prefDict objectForKey:KEY_AB_IMAGE_SYNC] boolValue];
useFirstName = [[prefDict objectForKey:KEY_AB_USE_FIRSTNAME] boolValue];
useNickNameOnly = [[prefDict objectForKey:KEY_AB_USE_NICKNAME] boolValue];
- displayFormat = [[prefDict objectForKey:KEY_AB_DISPLAYFORMAT] retain];
+ displayFormat = [prefDict objectForKey:KEY_AB_DISPLAYFORMAT]; createMetaContacts = [[prefDict objectForKey:KEY_AB_CREATE_METACONTACTS] boolValue];
@@ -603,22 +599,22 @@
NSString *serviceID = nil;
- if ([property isEqualToString:kABAIMInstantProperty])
+ if ([property isEqualToString:kABInstantMessageServiceAIM]) - else if ([property isEqualToString:kABICQInstantProperty])
+ else if ([property isEqualToString:kABInstantMessageServiceICQ]) - else if ([property isEqualToString:kABMSNInstantProperty])
+ else if ([property isEqualToString:kABInstantMessageServiceMSN]) - else if ([property isEqualToString:kABJabberInstantProperty])
+ else if ([property isEqualToString:kABInstantMessageServiceJabber]) - else if ([property isEqualToString:kABYahooInstantProperty])
+ else if ([property isEqualToString:kABInstantMessageServiceYahoo]) - else if ([property isEqualToString:kABURLsProperty])
+ else if ([property isEqualToString:kABInstantMessageServiceFacebook]) return (serviceID ? [adium.accountController firstServiceWithServiceID:serviceID] : nil);
@@ -637,13 +633,13 @@
//Check for some special cases
if ([serviceID isEqualToString:@"GTalk"]) {
- result = kABJabberInstantProperty;
+ result = kABInstantMessageServiceGoogleTalk; } else if ([serviceID isEqualToString:@"LiveJournal"]) {
- result = kABJabberInstantProperty;
+ result = kABInstantMessageServiceJabber; } else if ([serviceID isEqualToString:@"Mac"]) {
- result = kABAIMInstantProperty;
+ result = kABInstantMessageServiceAIM; } else if ([serviceID isEqualToString:@"MobileMe"]) {
- result = kABAIMInstantProperty;
+ result = kABInstantMessageServiceAIM; @@ -960,7 +956,6 @@
//Stop delaying list object notifications since we are done
[[AIContactObserverManager sharedManager] endListObjectNotificationsDelay];
- [allModifiedPeople release];
@@ -1039,7 +1034,7 @@
//Delay listObjectNotifications to speed up metaContact creation
[[AIContactObserverManager sharedManager] delayListObjectNotifications];
- [addressBookDict release]; addressBookDict = [[NSMutableDictionary alloc] init];
+ addressBookDict = [[NSMutableDictionary alloc] init]; [self addToAddressBookDict:[sharedAddressBook people]];
@@ -1137,7 +1132,7 @@
if ([email hasSuffix:@"@mac.com"]) {
//@mac.com UIDs go into the AIM dictionary
if (!(dict = [addressBookDict objectForKey:@"AIM"])) {
- dict = [[[NSMutableDictionary alloc] init] autorelease];
+ dict = [[NSMutableDictionary alloc] init]; [addressBookDict setObject:dict forKey:@"AIM"];
@@ -1150,7 +1145,7 @@
} else if ([email hasSuffix:@"me.com"]) {
//@me.com UIDs go into the AIM dictionary
if (!(dict = [addressBookDict objectForKey:@"AIM"])) {
- dict = [[[NSMutableDictionary alloc] init] autorelease];
+ dict = [[NSMutableDictionary alloc] init]; [addressBookDict setObject:dict forKey:@"AIM"];
@@ -1163,7 +1158,7 @@
} else if ([email hasSuffix:@"gmail.com"] || [email hasSuffix:@"googlemail.com"]) {
//GTalk UIDs go into the Jabber dictionary
if (!(dict = [addressBookDict objectForKey:@"Jabber"])) {
- dict = [[[NSMutableDictionary alloc] init] autorelease];
+ dict = [[NSMutableDictionary alloc] init]; [addressBookDict setObject:dict forKey:@"Jabber"];
@@ -1176,7 +1171,7 @@
} else if ([email hasSuffix:@"hotmail.com"]) {
//GTalk UIDs go into the Jabber dictionary
if (!(dict = [addressBookDict objectForKey:@"MSN"])) {
- dict = [[[NSMutableDictionary alloc] init] autorelease];
+ dict = [[NSMutableDictionary alloc] init]; [addressBookDict setObject:dict forKey:@"MSN"];
@@ -1201,7 +1196,7 @@
NSString *facebookNumber = (NSString*)[(NSString*)homepage lastPathComponent];
NSString *facebookUID = [NSString stringWithFormat:@"-%@@chat.facebook.com", facebookNumber];
if (!(dict = [addressBookDict objectForKey:@"Facebook"])) {
- dict = [[[NSMutableDictionary alloc] init] autorelease];
+ dict = [[NSMutableDictionary alloc] init]; [addressBookDict setObject:dict forKey:@"Facebook"];
@@ -1231,7 +1226,6 @@
if (!(dict = [addressBookDict objectForKey:serviceID])) {
dict = [[NSMutableDictionary alloc] init];
[addressBookDict setObject:dict forKey:serviceID];
BOOL isOSCAR = ([serviceID isEqualToString:@"AIM"] ||
@@ -1291,8 +1285,8 @@
if (metaContact != metaContactHint) {
//Keep track of the use of this metacontact for this address book card
- NSMutableDictionary *prefsDict = [[[adium.preferenceController preferenceForKey:KEY_AB_TO_METACONTACT_DICT
- group:PREF_GROUP_ADDRESSBOOK] mutableCopy] autorelease];
+ NSMutableDictionary *prefsDict = [[adium.preferenceController preferenceForKey:KEY_AB_TO_METACONTACT_DICT + group:PREF_GROUP_ADDRESSBOOK] mutableCopy]; if (!prefsDict) prefsDict = [NSMutableDictionary dictionary];
[prefsDict setObject:[metaContact objectID]
@@ -1424,7 +1418,7 @@
ABMutableMultiValue *multiValue = [person valueForKey:serviceProperty];
- multiValue = [[[ABMutableMultiValue alloc] init] autorelease];
+ multiValue = [[ABMutableMultiValue alloc] init]; [multiValue addValue:UID withLabel:serviceProperty];
[person setValue:multiValue forKey:serviceProperty];
@@ -1455,7 +1449,6 @@
if (result == NSOKButton) {
NSString *url = [[NSString alloc] initWithFormat:@"addressbook://%@?edit", [person uniqueId]];
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:url]];
@@ -1465,9 +1458,6 @@
NSRunAlertPanel(CONTACT_ADDED_ERROR_TITLE, CONTACT_ADDED_ERROR_Message, nil, nil, nil);
--- a/Frameworks/Adium Framework/Source/AIAddressBookUserIconSource.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIAddressBookUserIconSource.m Sun Sep 09 12:24:39 2012 -0400
@@ -45,14 +45,6 @@
- [trackingDictPersonToTagNumber release]; trackingDictPersonToTagNumber = nil;
- [trackingDictTagNumberToPerson release]; trackingDictTagNumberToPerson = nil;
* @brief AIUserIcons wants this source to update its user icon for an object
@@ -144,7 +136,7 @@
tagNumber = [NSNumber numberWithInteger:tag];
//Apply the image to the appropriate listObject
- image = (inData ? [[[NSImage alloc] initWithData:inData] autorelease] : nil);
+ image = (inData ? [[NSImage alloc] initWithData:inData] : nil); //Address book can feed us giant images, which we really don't want to keep around
@@ -166,7 +158,7 @@
} else /*if ([setOrObject isKindOfClass:[NSSet class]])*/{
//Apply the image to each listObject at the appropriate priority
- for (AIListObject *listObject in [[(NSSet *)setOrObject copy] autorelease]) {
+ for (AIListObject *listObject in [(NSSet *)setOrObject copy]) { [AIUserIcons userIconSource:self
didDetermineUserIcon:image
@@ -248,7 +240,7 @@
- (BOOL)updateFromLocalImageForPerson:(ABPerson *)person object:(AIListObject *)inObject
NSData *imageData = [person imageData];
- NSImage *image = (imageData ? [[[NSImage alloc] initWithData:imageData] autorelease] : nil);
+ NSImage *image = (imageData ? [[NSImage alloc] initWithData:imageData] : nil); //Address book can feed us giant images, which we really don't want to keep around
--- a/Frameworks/Adium Framework/Source/AIAuthorizationRequestsWindowController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIAuthorizationRequestsWindowController.m Sun Sep 09 12:24:39 2012 -0400
@@ -118,7 +118,7 @@
// Fade into oblivion only if we don't have any oustanding requests.
- [sharedController autorelease]; sharedController = nil;
+ sharedController = nil; [[NSNotificationCenter defaultCenter] removeObserver:self];
@@ -126,13 +126,6 @@
[super windowWillClose:sender];
- [toolbarItems release];
@@ -145,7 +138,7 @@
name:NSToolbarWillAddItemNotification
- NSToolbar *toolbar = [[[NSToolbar alloc] initWithIdentifier:@"AdiumAuthorizeWindow"] autorelease];
+ NSToolbar *toolbar = [[NSToolbar alloc] initWithIdentifier:@"AdiumAuthorizeWindow"]; [toolbar setDelegate:self];
[toolbar setDisplayMode:NSToolbarDisplayModeIconAndLabel];
@@ -160,10 +153,10 @@
- button = [[[MVMenuButton alloc] initWithFrame:NSMakeRect(0, 0, 32, 32)] autorelease];
+ button = [[MVMenuButton alloc] initWithFrame:NSMakeRect(0, 0, 32, 32)]; [button setImage:[NSImage imageNamed:@"Authorize" forClass:[self class]]];
- toolbarItem = [[[AIValidatingToolbarItem alloc] initWithItemIdentifier:AUTHORIZE] autorelease];
+ toolbarItem = [[AIValidatingToolbarItem alloc] initWithItemIdentifier:AUTHORIZE]; [toolbarItem setLabel:AUTHORIZE];
[toolbarItem setPaletteLabel:AUTHORIZE];
[toolbarItem setToolTip:AILocalizedString(@"Authorize Selected",nil)];
@@ -182,15 +175,15 @@
toolTip:AILocalizedString(@"Get Info",nil)
settingSelector:@selector(setImage:)
- itemContent:[[[NSImage alloc] initByReferencingFile:[[NSBundle mainBundle] pathForImageResource:@"get-info.tiff"]] autorelease]
+ itemContent:[[NSImage alloc] initByReferencingFile:[[NSBundle mainBundle] pathForImageResource:@"get-info.tiff"]] action:@selector(getInfo:)
- button = [[[MVMenuButton alloc] initWithFrame:NSMakeRect(0, 0, 32, 32)] autorelease];
+ button = [[MVMenuButton alloc] initWithFrame:NSMakeRect(0, 0, 32, 32)]; [button setImage:[NSImage imageNamed:@"Deny" forClass:[self class]]];
- toolbarItem = [[[AIValidatingToolbarItem alloc] initWithItemIdentifier:DENY] autorelease];
+ toolbarItem = [[AIValidatingToolbarItem alloc] initWithItemIdentifier:DENY]; [toolbarItem setLabel:DENY];
[toolbarItem setPaletteLabel:DENY];
[toolbarItem setToolTip:AILocalizedString(@"Deny Selected",nil)];
@@ -202,10 +195,10 @@
[toolbarItems setObject:toolbarItem forKey:DENY];
- button = [[[MVMenuButton alloc] initWithFrame:NSMakeRect(0, 0, 32, 32)] autorelease];
+ button = [[MVMenuButton alloc] initWithFrame:NSMakeRect(0, 0, 32, 32)]; [button setImage:[NSImage imageNamed:@"Ignore" forClass:[self class]]];
- toolbarItem = [[[AIValidatingToolbarItem alloc] initWithItemIdentifier:IGNORE] autorelease];
+ toolbarItem = [[AIValidatingToolbarItem alloc] initWithItemIdentifier:IGNORE]; [toolbarItem setLabel:IGNORE];
[toolbarItem setPaletteLabel:IGNORE];
[toolbarItem setToolTip:AILocalizedString(@"Ignore Selected",nil)];
@@ -238,7 +231,6 @@
[[item view] setMenu:menu];
} else if ([[item itemIdentifier] isEqualToString:DENY]) {
NSMenu *menu = [[NSMenu alloc] init];
@@ -253,7 +245,6 @@
[[item view] setMenu:menu];
} else if ([[item itemIdentifier] isEqualToString:IGNORE]) {
NSMenu *menu = [[NSMenu alloc] init];
@@ -268,7 +259,6 @@
[[item view] setMenu:menu];
@@ -426,7 +416,7 @@
- (void)applyResponse:(AIAuthorizationResponse)response
- for (NSDictionary *dict in [[[requests objectsAtIndexes:[tableView selectedRowIndexes]] mutableCopy] autorelease]) {
+ for (NSDictionary *dict in [[requests objectsAtIndexes:[tableView selectedRowIndexes]] mutableCopy]) { AIAccount *account = [dict objectForKey:@"Account"];
[account authorizationWithDict:dict response:response];
@@ -481,8 +471,6 @@
CGFloat combinedHeight = [mainTitle heightWithWidth:[tableColumn width]];
// Substring (the status message)
NSString *reason = [[requests objectAtIndex:row] objectForKey:@"Reason"];
@@ -492,8 +480,6 @@
attributes:subStringAttributes];
combinedHeight += [subStringTitle heightWithWidth:[tableColumn width]] + MINIMUM_CELL_SPACING;
- [subStringTitle release];
[tableView setNeedsDisplayInRect:[tableView rectOfRow:row]];
@@ -591,7 +577,7 @@
- NSMenu *menu = [[[NSMenu alloc] init] autorelease];
+ NSMenu *menu = [[NSMenu alloc] init]; if (inTableView.selectedRowIndexes.count == 1) {
[menu addItemWithTitle:GET_INFO
--- a/Frameworks/Adium Framework/Source/AICachedUserIconSource.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AICachedUserIconSource.m Sun Sep 09 12:24:39 2012 -0400
@@ -76,11 +76,10 @@
if (sharedCachedUserIconSourceInstance) {
- return [sharedCachedUserIconSourceInstance retain];
+ return sharedCachedUserIconSourceInstance; if ((self = [super init])) {
- sharedCachedUserIconSourceInstance = [self retain];
+ sharedCachedUserIconSourceInstance = self; @@ -106,7 +105,7 @@
[AIUserIcons userIconSource:self
- didDetermineUserIcon:[[[NSImage alloc] initWithData:iconData] autorelease]
+ didDetermineUserIcon:[[NSImage alloc] initWithData:iconData] @@ -128,7 +127,7 @@
if ((cachedImage = [[NSData alloc] initWithContentsOfFile:cachedImagePath])) {
- return [cachedImage autorelease];
--- a/Frameworks/Adium Framework/Source/AIChat.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIChat.h Sun Sep 09 12:24:39 2012 -0400
@@ -113,7 +113,7 @@
NSMutableDictionary *participatingContactsAliases;
NSMutableArray *participatingContacts;
- AIListContact *preferredContact;
+ AIListContact *__weak preferredContact; @@ -152,10 +152,10 @@
+ (id)chatForAccount:(AIAccount *)inAccount;
-@property (readwrite, nonatomic, retain) AIAccount *account;
+@property (readwrite, nonatomic, strong) AIAccount *account; @property (readonly, nonatomic) NSDate *dateOpened;
-@property (readwrite, nonatomic, retain) NSDictionary *chatCreationDictionary;
+@property (readwrite, nonatomic, strong) NSDictionary *chatCreationDictionary; @property (readwrite, nonatomic) BOOL isOpen;
@@ -187,22 +187,22 @@
- (void)removeObject:(AIListObject *)inObject;
-@property (readwrite, nonatomic, retain) AIListContact *listObject;
-@property (readwrite, nonatomic, assign) AIListContact *preferredListObject;
+@property (readwrite, nonatomic, strong) AIListContact *listObject; +@property (readwrite, nonatomic, weak) AIListContact *preferredListObject; - (BOOL)inviteListContact:(AIListContact *)inObject withMessage:(NSString *)inviteMessage;
- (BOOL)shouldBeginSendingContentObject:(AIContentObject *)inObject;
- (void)finishedSendingContentObject:(AIContentObject *)inObject;
-@property (readwrite, nonatomic, retain) NSString *name;
-@property (readwrite, nonatomic, retain) id identifier;
+@property (readwrite, nonatomic, strong) NSString *name; +@property (readwrite, nonatomic, strong) id identifier; -@property (readonly, nonatomic) NSString *uniqueChatID;
+@property (weak, readonly, nonatomic) NSString *uniqueChatID; -@property (readonly, nonatomic) NSImage *chatImage;
-@property (readonly, nonatomic) NSImage *chatMenuImage;
+@property (unsafe_unretained, readonly, nonatomic) NSImage *chatImage; +@property (unsafe_unretained, readonly, nonatomic) NSImage *chatMenuImage; -@property (readwrite, nonatomic, retain) NSDictionary *securityDetails;
+@property (readwrite, nonatomic, strong) NSDictionary *securityDetails; @property (readonly, nonatomic) BOOL isSecure;
@property (readonly, nonatomic) AIEncryptionStatus encryptionStatus;
@property (readonly, nonatomic) BOOL supportsSecureMessagingToggling;
@@ -227,9 +227,9 @@
- (void)receivedError:(NSNumber *)type;
-@property (readonly, nonatomic) id <AIChatContainer> chatContainer;
+@property (unsafe_unretained, readonly, nonatomic) id <AIChatContainer> chatContainer; -@property (readonly, nonatomic) NSMenu *actionMenu;
+@property (weak, readonly, nonatomic) NSMenu *actionMenu; @property (readonly, nonatomic) BOOL shouldLog;
--- a/Frameworks/Adium Framework/Source/AIChat.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIChat.m Sun Sep 09 12:24:39 2012 -0400
@@ -57,18 +57,18 @@
+ (id)chatForAccount:(AIAccount *)inAccount
- return [[[self alloc] initForAccount:inAccount] autorelease];
+ return [[self alloc] initForAccount:inAccount]; - (id)initForAccount:(AIAccount *)inAccount
if ((self = [super init])) {
- account = [inAccount retain];
participatingContacts = [[NSMutableArray alloc] init];
participatingContactsFlags = [[NSMutableDictionary alloc] init];
participatingContactsAliases = [[NSMutableDictionary alloc] init];
- dateOpened = [[NSDate date] retain];
+ dateOpened = [NSDate date]; ignoredListContacts = nil;
@@ -79,7 +79,7 @@
pendingOutgoingContentObjects = [[NSMutableArray alloc] init];
- AILog(@"[AIChat: %x initForAccount]",self);
+ AILog(@"[AIChat: %p initForAccount]",self); [[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(contentObjectAdded:)
@@ -104,25 +104,7 @@
AILog(@"[%@ dealloc]",self);
[self removeAllParticipatingContactsSilently];
- [participatingContacts release];
- [participatingContactsFlags release];
- [participatingContactsAliases release];
- [ignoredListContacts release];
- [pendingOutgoingContentObjects release];
- [uniqueChatID release]; uniqueChatID = nil;
- [customEmoticons release]; customEmoticons = nil;
- [topic release]; [topicSetter release];
- [tabStateIcon release]; tabStateIcon = nil;
- [chatCreationInfo release]; chatCreationInfo = nil;
- [enteredTextTimer release]; enteredTextTimer = nil;
- [securityDetails release]; securityDetails = nil;
- [lastMessageDate release]; lastMessageDate = nil;
@@ -181,8 +163,7 @@
- (void)setAccount:(AIAccount *)inAccount
if (inAccount != account) {
- account = [inAccount retain];
//The uniqueChatID may depend upon the account, so clear it
[self clearUniqueChatID];
@@ -446,7 +427,6 @@
[participatingContacts addObjectsFromArray:contacts];
[adium.chatController chat:self addedListContacts:contacts notify:notify];
- (BOOL)addObject:(AIListObject *)inObject
@@ -498,7 +478,7 @@
uniqueChatID = [[NSString alloc] initWithFormat:@"%@.%i", self.name, nextChatNumber++];
- uniqueChatID = [self.listObject.internalObjectID retain];
+ uniqueChatID = self.listObject.internalObjectID; @@ -512,7 +492,7 @@
- (void)clearUniqueChatID
- [uniqueChatID release]; uniqueChatID = nil;
- (NSString *)internalObjectID
@@ -703,9 +683,6 @@
if ([self containsObject:inObject]) {
AIListContact *contact = (AIListContact *)inObject; //if we contain it, it has to be an AIListContact
- //make sure removing it from the array doesn't deallocate it immediately, since we need it for -chat:removedListContact:
[participatingContacts removeObject:inObject];
[self removeSavedValuesForContactUID:inObject.UID];
@@ -720,8 +697,6 @@
[adium.contactController accountDidStopTrackingContact:contact];
[[AIContactObserverManager sharedManager] endListObjectNotificationsDelaysImmediately];
@@ -879,7 +854,7 @@
[account setTopic:inTopic forChat:self];
- AILogWithSignature(@"Attempt to set %@ topic when account doesn't support it.");
+ AILogWithSignature(@"Attempt to set %@ topic when account doesn't support it.", self); @@ -930,9 +905,9 @@
containerClassDesc = (NSScriptClassDescription *)[NSScriptClassDescription classDescriptionForClass:[NSApp class]];
- return [[[NSUniqueIDSpecifier allocWithZone:[self zone]]
+ return [[NSUniqueIDSpecifier alloc] initWithContainerClassDescription:containerClassDesc
- containerSpecifier:containerRef key:@"chats" uniqueID:[self uniqueChatID]] autorelease];
+ containerSpecifier:containerRef key:@"chats" uniqueID:[self uniqueChatID]]; @@ -1062,7 +1037,7 @@
-- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id *)stackbuf count:(NSUInteger)len
+- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(__unsafe_unretained id [])stackbuf count:(NSUInteger)len return [self.containedObjects countByEnumeratingWithState:state objects:stackbuf count:len];
--- a/Frameworks/Adium Framework/Source/AIColorStringTransformer.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIColorStringTransformer.m Sun Sep 09 12:24:39 2012 -0400
@@ -23,7 +23,7 @@
if (self == [AIColorStringTransformer class]) {
- [self setValueTransformer:[[[AIColorStringTransformer alloc] init] autorelease]
+ [self setValueTransformer:[[AIColorStringTransformer alloc] init] forName:@"AIColorStringTransformer"];
--- a/Frameworks/Adium Framework/Source/AIContactHidingController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIContactHidingController.m Sun Sep 09 12:24:39 2012 -0400
@@ -51,21 +51,11 @@
matchedContacts = [[NSMutableDictionary alloc] init];
// contains[cd] - c = case insensitive, d = diacritic insensitive
- filterPredicateTemplate = [[NSPredicate predicateWithFormat:@"displayName contains[cd] $KEYWORD OR formattedUID contains[cd] $KEYWORD OR uid contains[cd] $KEYWORD"] retain];
+ filterPredicateTemplate = [NSPredicate predicateWithFormat:@"displayName contains[cd] $KEYWORD OR formattedUID contains[cd] $KEYWORD OR uid contains[cd] $KEYWORD"];
- [matchedContacts release]; matchedContacts = nil;
- [searchString release]; searchString = nil;
- [filterPredicate release]; filterPredicate = nil;
- [filterPredicateTemplate release]; filterPredicateTemplate = nil;
- [hideAccounts release]; hideAccounts = nil;
- (void)preferencesChangedForGroup:(NSString *)group
object:(AIListObject *)object
@@ -83,8 +73,7 @@
showBlockedContacts = [[prefDict objectForKey:KEY_SHOW_BLOCKED_CONTACTS] boolValue];
showAwayContacts = [[prefDict objectForKey:KEY_SHOW_AWAY_CONTACTS] boolValue];
- [hideAccounts release];
- hideAccounts = [[prefDict objectForKey:KEY_HIDE_ACCOUNT_CONTACTS] retain];
+ hideAccounts = [prefDict objectForKey:KEY_HIDE_ACCOUNT_CONTACTS]; useContactListGroups = ![[prefDict objectForKey:KEY_HIDE_CONTACT_LIST_GROUPS] boolValue];
useOfflineGroup = (useContactListGroups && [[prefDict objectForKey:KEY_USE_OFFLINE_GROUP] boolValue]);
@@ -104,9 +93,7 @@
- (BOOL)filterContacts:(NSString *)inSearchString
- [searchString release];
- searchString = [inSearchString retain];
- [filterPredicate release];
+ searchString = inSearchString; [matchedContacts removeAllObjects];
@@ -200,7 +187,7 @@
- filterPredicate = [[self createPredicateWithSearchString:inSearchString] retain];
+ filterPredicate = [self createPredicateWithSearchString:inSearchString]; // If the given contact is a meta contact, check all of its contained objects.
if ([listObject conformsToProtocol:@protocol(AIContainingObject)]) {
@@ -231,7 +218,7 @@
// Tokenize the string looking for words and iterate over tokens, storing an NSPredicate for each keyword
// Use CFStringTokenizer for multi-language support and to handle empty tokens
- CFStringTokenizerRef tokenizer = CFStringTokenizerCreate(nil, (CFStringRef)inSearchString, CFRangeMake(0, inSearchString.length), kCFStringTokenizerUnitWord, NULL);
+ CFStringTokenizerRef tokenizer = CFStringTokenizerCreate(nil, (__bridge CFStringRef)inSearchString, CFRangeMake(0, inSearchString.length), kCFStringTokenizerUnitWord, NULL); CFStringTokenizerTokenType tokenType;
while ((tokenType = CFStringTokenizerAdvanceToNextToken(tokenizer)) != kCFStringTokenizerTokenNone) {
CFRange range = CFStringTokenizerGetCurrentTokenRange(tokenizer);
@@ -245,7 +232,6 @@
NSPredicate* retval = [NSCompoundPredicate andPredicateWithSubpredicates:subpredicates];
- [subpredicates release];
--- a/Frameworks/Adium Framework/Source/AIContactInfoPane.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIContactInfoPane.m Sun Sep 09 12:24:39 2012 -0400
@@ -21,7 +21,7 @@
//Return a new contact info pane
+ (AIContactInfoPane *)contactInfoPane
- return [[[self alloc] init] autorelease];
+ return [[self alloc] init]; --- a/Frameworks/Adium Framework/Source/AIContactMenu.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIContactMenu.h Sun Sep 09 12:24:39 2012 -0400
@@ -39,7 +39,7 @@
+ (id)contactMenuWithDelegate:(id<AIContactMenuDelegate>)inDelegate forContactsInObject:(AIListObject *)inContainingObject;
- (void)setContainingObject:(AIListObject *)inContainingObject;
-@property (readwrite, nonatomic, assign) id<AIContactMenuDelegate> delegate;
+@property (readwrite, nonatomic, unsafe_unretained) id<AIContactMenuDelegate> delegate; --- a/Frameworks/Adium Framework/Source/AIContactMenu.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIContactMenu.m Sun Sep 09 12:24:39 2012 -0400
@@ -42,7 +42,7 @@
+ (id)contactMenuWithDelegate:(id<AIContactMenuDelegate>)inDelegate forContactsInObject:(AIListObject *)inContainingObject
- return [[[self alloc] initWithDelegate:inDelegate forContactsInObject:inContainingObject] autorelease];
+ return [[self alloc] initWithDelegate:inDelegate forContactsInObject:inContainingObject]; @@ -54,7 +54,7 @@
if ((self = [super init])) {
[self setDelegate:inDelegate];
- containingObject = [inContainingObject retain];
+ containingObject = inContainingObject; // Register as a list observer
[[AIContactObserverManager sharedManager] registerListObjectObserver:self];
@@ -75,11 +75,6 @@
[[AIContactObserverManager sharedManager] unregisterListObjectObserver:self];
[[NSNotificationCenter defaultCenter] removeObserver:self];
- [containingObject release]; containingObject = nil;
@@ -89,9 +84,7 @@
- (void)setContainingObject:(AIListObject *)inContainingObject
- [containingObject release];
- containingObject = [inContainingObject retain];
+ containingObject = inContainingObject; @@ -226,9 +219,9 @@
if (shouldIncludeContactListMenuItem) {
BOOL needsSeparator = (contactMenus.count > 0);
- NSMenuItem *aMenuItem = [[[NSMenuItem alloc] initWithTitle:[AILocalizedString(@"Contact List", nil) stringByAppendingEllipsis]
+ NSMenuItem *aMenuItem = [[NSMenuItem alloc] initWithTitle:[AILocalizedString(@"Contact List", nil) stringByAppendingEllipsis] action:@selector(toggleContactList:)
- keyEquivalent:@""] autorelease];
[aMenuItem setTarget:adium.interfaceController];
[contactMenus insertObject:aMenuItem atIndex:0];
@@ -247,7 +240,7 @@
NSMutableArray *listObjectArray = [NSMutableArray array];
- for (AIListObject *listObject in [[listObjects copy] autorelease]) {
+ for (__strong AIListObject *listObject in [listObjects copy]) { if ([listObject isKindOfClass:[AIListContact class]]) {
/* Include if the delegate doesn't specify, or if the delegate approves the contact.
* Note that this includes a metacontact itself, not its contained objects.
@@ -282,7 +275,7 @@
// If there's any contained list objects, add ourself as a group and add the contained objects.
if ([containedListObjects count] > 0) {
- NSMenuItem *menuItem = [[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:@""
+ NSMenuItem *menuItem = [[NSMenuItem alloc] initWithTitle:@"" @@ -301,19 +294,15 @@
// Add the group and contained objects to the array.
[menuItemArray addObject:menuItem];
[menuItemArray addObjectsFromArray:[self contactMenusForListObjects:containedListObjects]];
// Just add the menu item.
- NSMenuItem *menuItem = [[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:@""
+ NSMenuItem *menuItem = [[NSMenuItem alloc] initWithTitle:@"" action:@selector(selectContactMenuItem:)
representedObject:listObject];
[menuItemArray addObject:menuItem];
if (populateMenuLazily) {
/* Note that we'll call _updateMenuItem before the item is actually displayed, to set
--- a/Frameworks/Adium Framework/Source/AIContactObserverManager.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIContactObserverManager.m Sun Sep 09 12:24:39 2012 -0400
@@ -38,7 +38,7 @@
@interface AIContactObserverManager ()
- (NSSet *)_informObserversOfObjectStatusChange:(AIListObject *)inObject withKeys:(NSSet *)modifiedKeys silent:(BOOL)silent;
- (void)_performDelayedUpdates:(NSTimer *)timer;
-@property (nonatomic, retain) NSTimer *delayedUpdateTimer;
+@property (nonatomic) NSTimer *delayedUpdateTimer; #define UPDATE_CLUMP_INTERVAL 1.0
@@ -69,15 +69,6 @@
- [contactObservers release]; contactObservers = nil;
- [delayedModifiedStatusKeys release];
- [delayedModifiedAttributeKeys release];
- self.delayedUpdateTimer = nil;
//Status and Display updates -------------------------------------------------------------------------------------------
#pragma mark Status and Display updates
@@ -326,7 +317,7 @@
- [changedObjects autorelease]; changedObjects = nil;
//List object observers ------------------------------------------------------------------------------------------------
@@ -384,12 +375,13 @@
//If this contact is within a meta contact, update the meta contact too
if (contact.metaContact) {
attributes = [inObserver updateListObject:contact.metaContact
if (attributes) [self listObjectAttributesChanged:contact.metaContact
modifiedKeys:attributes];
@@ -431,7 +423,7 @@
NSMutableSet *attrChange = nil;
- for (NSValue *observerValue in [[contactObservers copy] autorelease]) {
+ for (NSValue *observerValue in [contactObservers copy]) { /* Skip any observer which has been removed while we were iterating over observers,
* as we don't retain observers and therefore risk messaging a released object.
@@ -466,16 +458,16 @@
//If we removed any observers while informing them, we don't need that information any more
if (removedContactObservers) {
- [removedContactObservers release]; removedContactObservers = nil;
+ removedContactObservers = nil; - return [attrChange autorelease];
//Command all observers to apply their attributes to an object
- (void)_updateAllAttributesOfObject:(AIListObject *)inObject
- for (NSValue *observerValue in [[contactObservers copy] autorelease]) {
+ for (NSValue *observerValue in [contactObservers copy]) { /* Skip any observer which has been removed while we were iterating over observers,
* as we don't retain observers and therefore risk messaging a released object.
@@ -489,7 +481,7 @@
//If we removed any observers while informing them, we don't need that information any more
if (removedContactObservers) {
- [removedContactObservers release]; removedContactObservers = nil;
+ removedContactObservers = nil; --- a/Frameworks/Adium Framework/Source/AIContentEvent.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIContentEvent.h Sun Sep 09 12:24:39 2012 -0400
@@ -22,7 +22,7 @@
-@property (readonly, nonatomic) NSString *eventType;
+@property (weak, readonly, nonatomic) NSString *eventType; + (id)eventInChat:(AIChat *)inChat
--- a/Frameworks/Adium Framework/Source/AIContentMessage.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIContentMessage.h Sun Sep 09 12:24:39 2012 -0400
@@ -74,7 +74,7 @@
* @return A string containing the message encoded to some sort of marked-up (or plain) source code, such as HTML source code.
-@property (readwrite, nonatomic, retain) NSString *encodedMessage;
+@property (readwrite, nonatomic) NSString *encodedMessage; /*! @brief The object associated with this method for an account's benefit.
@@ -82,7 +82,7 @@
* @return The object associated with this message.
-@property (readwrite, nonatomic, retain) id encodedMessageAccountData;
+@property (readwrite, nonatomic) id encodedMessageAccountData; * @brief The prefix string for the sender of this message.
@@ -91,6 +91,6 @@
* This is returned based on the user's flags in a group chat. For a normal chat, this is an empty string.
-@property (readonly, nonatomic) NSString *senderPrefix;
+@property (weak, readonly, nonatomic) NSString *senderPrefix; --- a/Frameworks/Adium Framework/Source/AIContentMessage.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIContentMessage.m Sun Sep 09 12:24:39 2012 -0400
@@ -30,12 +30,12 @@
message:(NSAttributedString *)inMessage
autoreply:(BOOL)inAutoReply
- return [[[self alloc] initWithChat:inChat
+ return [[self alloc] initWithChat:inChat - autoreply:inAutoReply] autorelease];
+ autoreply:inAutoReply]; @@ -61,16 +61,6 @@
- [encodedMessage release];
- if (encodedMessageAccountData)
- [encodedMessageAccountData release];
- (NSMutableArray *)displayClasses
NSMutableArray *classes = [super displayClasses];
--- a/Frameworks/Adium Framework/Source/AIContentNotification.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIContentNotification.h Sun Sep 09 12:24:39 2012 -0400
@@ -36,6 +36,6 @@
notificationType:(AINotificationType)inNotificationType;
@property (readonly, nonatomic) AINotificationType notificationType;
-@property (readonly, nonatomic) NSString *eventType;
+@property (weak, readonly, nonatomic) NSString *eventType; --- a/Frameworks/Adium Framework/Source/AIContentNotification.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIContentNotification.m Sun Sep 09 12:24:39 2012 -0400
@@ -35,11 +35,11 @@
notificationType:(AINotificationType)inNotificationType
- return [[[self alloc] initWithChat:inChat
+ return [[self alloc] initWithChat:inChat - notificationType:inNotificationType] autorelease];
+ notificationType:inNotificationType]; - (id)initWithChat:(AIChat *)inChat
--- a/Frameworks/Adium Framework/Source/AIContentObject.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIContentObject.h Sun Sep 09 12:24:39 2012 -0400
@@ -35,7 +35,7 @@
@interface AIContentObject : NSObject {
AIListObject *destination;
@@ -94,7 +94,7 @@
* @return A string representing the type of content that this object bears.
-@property (nonatomic, readonly) NSString *type;
+@property (weak, nonatomic, readonly) NSString *type; @@ -160,14 +160,14 @@
* @return The chat with which this content is associated.
-@property (nonatomic, readwrite, assign) AIChat *chat;
+@property (nonatomic, readwrite, weak) AIChat *chat; /*! @brief Obtain the current message in the content.
* @return The current message.
-@property (nonatomic, retain) NSAttributedString *message;
-@property (readonly, nonatomic) NSString *messageString;
+@property (nonatomic, strong) NSAttributedString *message; +@property (weak, readonly, nonatomic) NSString *messageString; /*! @brief Get an array of CSS class names with which this content should be displayed.
* @par You should use these classes whenever inserting the content into an HTML or XHTML document, or anywhere else where CSS would be used with the content.
@@ -192,7 +192,7 @@
* @param inUserInfo The new user-info object.
-@property (nonatomic, retain) id userInfo;
+@property (nonatomic, strong) id userInfo; --- a/Frameworks/Adium Framework/Source/AIContentObject.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIContentObject.m Sun Sep 09 12:24:39 2012 -0400
@@ -50,12 +50,12 @@
postProcessContent = YES;
//Store source, dest, chat, ...
- source = [inSource retain];
- destination = [inDest retain];
- message = [inMessage retain];
- date = [(inDate ? inDate : [NSDate date]) retain];
+ date = (inDate ? inDate : [NSDate date]); - chat = [inChat retain];
outgoing = ([source isKindOfClass:[AIAccount class]]);
@@ -63,21 +63,6 @@
- [source release]; source = nil;
- [destination release]; destination = nil;
- [date release]; date = nil;
- [message release]; message = nil;
- [chat release]; chat = nil;
- [userInfo release]; userInfo = nil;
- if(customDisplayClasses)
- [customDisplayClasses release];
- customDisplayClasses = nil;
@@ -138,8 +123,7 @@
- (void)setMessageHTML:(NSString *)inMessageString
- message = [[AIHTMLDecoder decodeHTML:inMessageString] retain];
+ message = [AIHTMLDecoder decodeHTML:inMessageString]; - (NSString *)messageHTML
@@ -151,7 +135,6 @@
- (void)setMessageString:(NSString *)inMessageString
message = [[NSAttributedString alloc] initWithString:inMessageString
attributes:[adium.contentController defaultFormattingAttributes]];
--- a/Frameworks/Adium Framework/Source/AIContentStatus.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIContentStatus.h Sun Sep 09 12:24:39 2012 -0400
@@ -46,6 +46,6 @@
@property (readwrite, nonatomic, copy) NSString *coalescingKey;
@property (readonly, nonatomic) NSString *status;
-@property (readwrite, nonatomic, retain) NSAttributedString *loggedMessage;
+@property (readwrite, nonatomic) NSAttributedString *loggedMessage; --- a/Frameworks/Adium Framework/Source/AIContentStatus.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIContentStatus.m Sun Sep 09 12:24:39 2012 -0400
@@ -27,12 +27,12 @@
message:(NSAttributedString *)inMessage
withType:(NSString *)inStatus
- return [[[self alloc] initWithChat:inChat
+ return [[self alloc] initWithChat:inChat - withType:inStatus] autorelease];
@@ -49,22 +49,12 @@
- statusType = [inStatus retain];
- [statusType release]; statusType = nil;
- [loggedMessage release]; loggedMessage = nil;
- [coalescingKey release]; coalescingKey = nil;
- (NSMutableArray *)displayClasses
NSMutableArray *classes = [super displayClasses];
--- a/Frameworks/Adium Framework/Source/AIContentTyping.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIContentTyping.m Sun Sep 09 12:24:39 2012 -0400
@@ -25,7 +25,7 @@
+ (id)typingContentInChat:(AIChat *)inChat withSource:(id)inSource destination:(id)inDest typingState:(AITypingState)inTypingState
- return [[[self alloc] initWithChat:inChat source:inSource destination:inDest typingState:inTypingState] autorelease];
+ return [[self alloc] initWithChat:inChat source:inSource destination:inDest typingState:inTypingState]; - (id)initWithChat:(AIChat *)inChat source:(id)inSource destination:(id)inDest typingState:(AITypingState)inTypingState
@@ -44,11 +44,6 @@
--- a/Frameworks/Adium Framework/Source/AIContextMenuTextView.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIContextMenuTextView.m Sun Sep 09 12:24:39 2012 -0400
@@ -75,11 +75,11 @@
[[submenu delegate] menuNeedsUpdate:submenu];
- [contextualMenu insertItem:[[menuItem copy] autorelease] atIndex:i++];
+ [contextualMenu insertItem:[menuItem copy] atIndex:i++]; - return [contextualMenu autorelease];
//Set our string, preserving the selected range
@@ -119,8 +119,6 @@
NSForegroundColorAttributeName, //the blue
[self setTypingAttributes:textAttribs];
@@ -135,8 +133,6 @@
[self setTypingAttributes:attributes];
- (void)deleteBackward:(id)sender
@@ -153,8 +149,6 @@
[newTypingAttributes removeObjectForKey:NSLinkAttributeName];
[self setTypingAttributes:newTypingAttributes];
- [newTypingAttributes release];
@@ -172,7 +166,7 @@
static NSColor *cachedWhiteColor = nil;
//Create cachedWhiteColor first time we're called; we'll need it later, repeatedly
- if (!cachedWhiteColor) cachedWhiteColor = [[NSColor whiteColor] retain];
+ if (!cachedWhiteColor) cachedWhiteColor = [NSColor whiteColor]; [self setBackgroundColor:cachedWhiteColor];
--- a/Frameworks/Adium Framework/Source/AICorePluginLoader.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AICorePluginLoader.m Sun Sep 09 12:24:39 2012 -0400
@@ -106,7 +106,7 @@
for (NSString *path in deferredPluginPaths) {
[[self class] loadPluginAtPath:path confirmLoading:YES pluginArray:pluginArray];
- [deferredPluginPaths release]; deferredPluginPaths = nil;
+ deferredPluginPaths = nil; #ifdef PLUGIN_LOAD_TIMING
AILog(@"Total time spent loading plugins: %f", aggregatePluginLoadingTime);
@@ -127,14 +127,6 @@
+ (BOOL)pluginIsBlacklisted:(NSBundle *)plugin
// Only one right now: the Skype plugin that works with 1.4 crashes in 1.5 (see #15590).
@@ -221,7 +213,6 @@
[pluginDict setObject:plugin forKey:NSStringFromClass(principalClass)];
[pluginBundleIdentifiers addObject:[pluginBundle bundleIdentifier]];
NSLog(@"Failed to initialize Plugin \"%@\" (\"%@\")!",[pluginPath lastPathComponent],pluginPath);
--- a/Frameworks/Adium Framework/Source/AICustomSocialNetworkingStatusWindowController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AICustomSocialNetworkingStatusWindowController.m Sun Sep 09 12:24:39 2012 -0400
@@ -46,38 +46,29 @@
- (void)setAccount:(AIAccount *)inAccount
if (inAccount != account) {
- account = [inAccount retain];
- (void)setTarget:(id)inTarget
if (inTarget != target) {
- target = [inTarget retain];
- (void)setMessage:(NSAttributedString *)inMessage
- [[textview_message textStorage] setAttributedString:(inMessage ? inMessage : [[[NSAttributedString alloc] initWithString:@""] autorelease])];
+ [[textview_message textStorage] setAttributedString:(inMessage ? inMessage : [[NSAttributedString alloc] initWithString:@""])]; - (IBAction)okay:(id)sender
- [target setSocialNetworkingStatus:[[[textview_message textStorage] copy] autorelease]
+ [target setSocialNetworkingStatus:[[textview_message textStorage] copy] @@ -131,7 +122,7 @@
[super windowWillClose:sender];
- [sharedController autorelease]; sharedController = nil;
+ sharedController = nil; --- a/Frameworks/Adium Framework/Source/AIEditStateWindowController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIEditStateWindowController.m Sun Sep 09 12:24:39 2012 -0400
@@ -134,14 +134,12 @@
- (void)setOriginalStatusState:(AIStatus *)inStatusState forType:(AIStatusType)inStatusType
if (originalStatusState != inStatusState) {
- [originalStatusState release];
- originalStatusState = [inStatusState retain];
+ originalStatusState = inStatusState; - [workingStatusState release];
workingStatusState = (originalStatusState ?
[originalStatusState mutableCopy] :
- [[AIStatus statusOfType:inStatusType] retain]);
+ [AIStatus statusOfType:inStatusType]); /* Reset to the default for this status type if we're not on it already */
if (workingStatusState.statusType != inStatusType) {
@@ -158,24 +156,11 @@
- (void)setAccount:(AIAccount *)inAccount
if (inAccount != account) {
- account = [inAccount retain];
- [originalStatusState release];
- [workingStatusState release];
* @brief Configure the window after it loads
@@ -233,7 +218,6 @@
length:0 /* No length limit */
- [noNewlinesCharacterSet release];
[checkBox_save setHidden:YES];
@@ -281,8 +265,6 @@
//Stop tracking with the controllerDict
NSNumber *targetHash = [NSNumber numberWithUnsignedInteger:[target hash]];
[controllerDict removeObjectForKey:targetHash];
@@ -399,10 +381,10 @@
id sender = [notification object];
if (sender == textView_statusMessage) {
- [workingStatusState setStatusMessage:[[[textView_statusMessage textStorage] copy] autorelease]];
+ [workingStatusState setStatusMessage:[[textView_statusMessage textStorage] copy]]; } else if (sender == textView_autoReply) {
- [workingStatusState setAutoReply:[[[textView_autoReply textStorage] copy] autorelease]];
+ [workingStatusState setAutoReply:[[textView_autoReply textStorage] copy]]; --- a/Frameworks/Adium Framework/Source/AIEmoticon.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIEmoticon.m Sun Sep 09 12:24:39 2012 -0400
@@ -37,17 +37,17 @@
+ (id)emoticonWithIconPath:(NSString *)inPath equivalents:(NSArray *)inTextEquivalents name:(NSString *)inName pack:(AIEmoticonPack *)inPack
- return [[[self alloc] initWithIconPath:inPath equivalents:inTextEquivalents name:inName pack:inPack] autorelease];
+ return [[self alloc] initWithIconPath:inPath equivalents:inTextEquivalents name:inName pack:inPack]; - (AIEmoticon *)initWithIconPath:(NSString *)inPath equivalents:(NSArray *)inTextEquivalents name:(NSString *)inName pack:(AIEmoticonPack *)inPack
if ((self = [super init])) {
- path = [inPath retain];
- name = [inName retain];
- textEquivalents = [inTextEquivalents retain];
- pack = [inPack retain];
+ textEquivalents = inTextEquivalents; _cachedAttributedString = nil;
@@ -55,18 +55,6 @@
- [textEquivalents release];
- [_cachedAttributedString release];
* @brief Returns an array of the text equivalents for this emoticon
@@ -87,7 +75,7 @@
- (void)flushEmoticonImageCache
- [_cachedAttributedString release]; _cachedAttributedString = nil;
+ _cachedAttributedString = nil; @@ -128,7 +116,7 @@
- return [[[NSImage alloc] initWithContentsOfFile:path] autorelease];
+ return [[NSImage alloc] initWithContentsOfFile:path]; @@ -137,10 +125,9 @@
- (void)setPath:(NSString *)inPath
- path = [inPath retain];
- [_cachedAttributedString release]; _cachedAttributedString = nil;
+ _cachedAttributedString = nil; @@ -176,14 +163,12 @@
//Cache this attachment for ourself if we don't already have a cache, or if our cache needs to have an image attached
if (!_cachedAttributedString || (!imageLoaded && attach)) {
- [_cachedAttributedString release]; //for the second half of the conditional
- AITextAttachmentExtension *emoticonAttachment = [[[AITextAttachmentExtension alloc] init] autorelease];
+ AITextAttachmentExtension *emoticonAttachment = [[AITextAttachmentExtension alloc] init]; NSTextAttachmentCell *cell = [[NSTextAttachmentCell alloc] initImageCell:[self image]];
[emoticonAttachment setAttachmentCell:cell];
[emoticonAttachment setPath:path];
[emoticonAttachment setHasAlternate:YES];
@@ -192,19 +177,17 @@
//Emoticons should not ever be sent out as images
[emoticonAttachment setShouldAlwaysSendAsText:YES];
- _cachedAttributedString = [[NSAttributedString attributedStringWithAttachment:emoticonAttachment] retain];
+ _cachedAttributedString = [NSAttributedString attributedStringWithAttachment:emoticonAttachment]; //Create a copy of our cached string, and update it for the new text equivalent
attributedString = [_cachedAttributedString mutableCopy];
attachment = [[attributedString attribute:NSAttachmentAttributeName atIndex:0 effectiveRange:NULL] copy];
[attributedString addAttribute:NSAttachmentAttributeName value:attachment range:NSMakeRange(0, [attributedString length])];
[attachment setString:textEquivalent];
- return [attributedString autorelease];
+ return attributedString; @@ -224,7 +207,7 @@
- (NSString *)description
- return [NSString stringWithFormat:@"%@<%x> (Equivalents: %@) [in %@]",name,self,[self textEquivalents],pack];
+ return [NSString stringWithFormat:@"%@<%p> (Equivalents: %@) [in %@]",name,self,[self textEquivalents],pack]; --- a/Frameworks/Adium Framework/Source/AIEmoticonPack.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIEmoticonPack.m Sun Sep 09 12:24:39 2012 -0400
@@ -63,16 +63,16 @@
+ (id)emoticonPackFromPath:(NSString *)inPath
- return [[[self alloc] initFromPath:inPath] autorelease];
+ return [[self alloc] initFromPath:inPath]; - (AIEmoticonPack *)initFromPath:(NSString *)inPath
if ((self = [super init])) {
- path = [inPath retain];
- bundle = [[NSBundle bundleWithPath:path] retain];
+ bundle = [NSBundle bundleWithPath:path]; if (xtraBundle && ([[xtraBundle objectForInfoDictionaryKey:@"XtraBundleVersion"] intValue] == 1)) {
@@ -87,7 +87,6 @@
if ((localizedName = [[bundle localizedInfoDictionary] objectForKey:name])) {
enabledEmoticonArray = nil;
@@ -98,19 +97,6 @@
- [emoticonArray release];
- [enabledEmoticonArray release];
- [serviceClass release];
* @brief Name, for display to the user
@@ -152,7 +138,7 @@
- (NSArray *)enabledEmoticons
if (!enabledEmoticonArray)
- enabledEmoticonArray = [[self.emoticons filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"isEnabled == TRUE"]] retain];
+ enabledEmoticonArray = [self.emoticons filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"isEnabled == TRUE"]]; return enabledEmoticonArray;
@@ -195,7 +181,6 @@
//reset the emabled emoticon list
if (enabledEmoticonArray) {
- [enabledEmoticonArray release];
enabledEmoticonArray = nil;
@@ -224,10 +209,10 @@
AIEmoticonPack *newPack = [[AIEmoticonPack alloc] initFromPath:path];
newPack->emoticonArray = [emoticonArray mutableCopy];
- newPack->serviceClass = [serviceClass retain];
- newPack->path = [path retain];
- newPack->bundle = [bundle retain];
- newPack->name = [name retain];
+ newPack->serviceClass = serviceClass; + newPack->bundle = bundle; @@ -241,8 +226,8 @@
- [emoticonArray release]; emoticonArray = [[NSMutableArray alloc] init];
- [serviceClass release]; serviceClass = nil;
+ emoticonArray = [[NSMutableArray alloc] init]; NSString *infoDictPath = [bundle pathForResource:EMOTICON_PLIST_FILENAME ofType:nil];
@@ -254,7 +239,7 @@
AILog(@"Upgrading Emoticon Pack %@ at %@...", self, bundle);
[self _upgradeEmoticonPack:path];
infoDict = [NSDictionary dictionaryWithContentsOfFile:infoDictPath];
- [bundle release]; bundle = [[NSBundle bundleWithPath:path] retain];
+ bundle = [NSBundle bundleWithPath:path]; @@ -299,8 +284,7 @@
if ([[NSFileManager defaultManager] fileExistsAtPath:possiblePath isDirectory:&isDir] && isDir) {
- bundle = [[NSBundle bundleWithPath:possiblePath] retain];
+ bundle = [NSBundle bundleWithPath:possiblePath]; @@ -314,14 +298,14 @@
- serviceClass = [[infoDict objectForKey:EMOTICON_SERVICE_CLASS] retain];
+ serviceClass = [infoDict objectForKey:EMOTICON_SERVICE_CLASS]; if ([name rangeOfString:@"AIM"].location != NSNotFound) {
- serviceClass = [@"AIM-compatible" retain];
+ serviceClass = @"AIM-compatible"; } else if ([name rangeOfString:@"MSN"].location != NSNotFound) {
- serviceClass = [@"MSN" retain];
} else if ([name rangeOfString:@"Yahoo"].location != NSNotFound) {
- serviceClass = [@"Yahoo!" retain];
+ serviceClass = @"Yahoo!"; @@ -521,7 +505,7 @@
//Step through all the invalid endlines
charRange = [inString rangeOfCharacterFromSet:newlineSet];
while (charRange.length != 0) {
- if (!newString) newString = [[inString mutableCopy] autorelease];
+ if (!newString) newString = [inString mutableCopy]; //Replace endline and continue
[newString replaceCharactersInRange:charRange withString:@"\r"];
--- a/Frameworks/Adium Framework/Source/AIGroupChatStatusIcons.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIGroupChatStatusIcons.m Sun Sep 09 12:24:39 2012 -0400
@@ -68,11 +68,8 @@
sharedIconsInstance = nil;
- [icons release]; [colors release];
- [iconInfo release]; [colorInfo release];
[adium.preferenceController unregisterPreferenceObserver:self];
#pragma mark Image Retrieval
@@ -234,15 +231,9 @@
if ([group isEqualToString:PREF_GROUP_APPEARANCE]) {
if ([key isEqualToString:KEY_GROUP_CHAT_STATUS_ICONS]) {
- // We're going to be killing ourself off, so retain until the end.
// Create a new shared controller.
- [sharedIconsInstance release]; sharedIconsInstance = nil;
+ sharedIconsInstance = nil; [AIGroupChatStatusIcons sharedIcons];
--- a/Frameworks/Adium Framework/Source/AIHTMLDecoder.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIHTMLDecoder.m Sun Sep 09 12:24:39 2012 -0400
@@ -81,15 +81,9 @@
- [XMLNamespace release]; XMLNamespace = nil;
- [baseURL release]; baseURL = nil;
+ (AIHTMLDecoder *)decoder
- return [[[self alloc] init] autorelease];
+ return [[self alloc] init]; - (id)initWithHeaders:(BOOL)includeHeaders
@@ -138,7 +132,7 @@
bodyBackground:(BOOL)bodyBackground
allowJavascriptURLs:(BOOL)allowJS
- return [[[self alloc] initWithHeaders:includeHeaders
+ return [[self alloc] initWithHeaders:includeHeaders closeFontTags:closeFontTags
colorTags:includeColorTags
@@ -149,7 +143,7 @@
onlyIncludeOutgoingImages:onlyIncludeOutgoingImages
simpleTagsOnly:simpleOnly
bodyBackground:bodyBackground
- allowJavascriptURLs:allowJS] autorelease];
+ allowJavascriptURLs:allowJS]; #pragma mark Work methods
@@ -170,10 +164,10 @@
NSString *key = nil, *value = nil;
- if (!equalsSet) equalsSet = [[NSCharacterSet characterSetWithCharactersInString:@"="] retain];
- if (!dquoteSet) dquoteSet = [[NSCharacterSet characterSetWithCharactersInString:@"\""] retain];
- if (!squoteSet) squoteSet = [[NSCharacterSet characterSetWithCharactersInString:@"'"] retain];
- if (!spaceSet) spaceSet = [[NSCharacterSet characterSetWithCharactersInString:@" "] retain];
+ if (!equalsSet) equalsSet = [NSCharacterSet characterSetWithCharactersInString:@"="]; + if (!dquoteSet) dquoteSet = [NSCharacterSet characterSetWithCharactersInString:@"\""]; + if (!squoteSet) squoteSet = [NSCharacterSet characterSetWithCharactersInString:@"'"]; + if (!spaceSet) spaceSet = [NSCharacterSet characterSetWithCharactersInString:@" "]; scanner = [NSScanner scannerWithString:arguments];
argDict = [NSMutableDictionary dictionary];
@@ -249,7 +243,7 @@
//Setup the default attributes
- NSString *currentFamily = [@"Helvetica" retain];
+ NSString *currentFamily = @"Helvetica"; NSString *currentColor = nil;
NSString *currentBackColor = nil;
CGFloat currentSize = 12;
@@ -336,7 +330,7 @@
- [currentFamily release]; currentFamily = [familyName retain];
+ currentFamily = familyName; @@ -429,7 +423,7 @@
if (thingsToInclude.allowAIMsubprofileLinks &&
([linkString rangeOfString:@"%25n"].location != NSNotFound)) {
- NSMutableString *fixedLinkString = [[linkString mutableCopy] autorelease];
+ NSMutableString *fixedLinkString = [linkString mutableCopy]; [fixedLinkString replaceOccurrencesOfString:@"%25n"
@@ -525,7 +519,7 @@
uniqueifyHTML:shouldSaveImage];
//We were succesful appending the image tag, so release this chunk
- [chunk release]; chunk = nil;
@@ -536,7 +530,7 @@
[string appendString:attachmentString];
- [chunk release]; chunk = nil;
@@ -634,7 +628,7 @@
if (!UCIsSurrogateLowCharacter(lowSurrogate)) {
//In case you're wondering: 0xFFFF is not a low surrogate. (Nor anything else, for that matter.)
- AILog(@"AIHTMLDecoder: Got high surrogate of surrogate pair, but there's no low surrogate after it. This is at index %u of chunk with length %u. The chunk is: %@", i, length, chunk);
+ AILog(@"AIHTMLDecoder: Got high surrogate of surrogate pair, but there's no low surrogate after it. This is at index %lu of chunk with length %lu. The chunk is: %@", i, length, chunk); UnicodeScalarValue codePoint = UCGetUnicodeScalarValueForSurrogatePair(/*highSurrogate*/ currentChar, lowSurrogate);
@@ -653,16 +647,11 @@
[string appendString:chunk];
searchRange.location += searchRange.length;
- [currentFamily release];
if (thingsToInclude.styleTags) {
if (currentItalic) [string appendString:@"</I>"];
@@ -813,9 +802,9 @@
- (NSDictionary *)attributesByReplacingNSFontAttributeNameWithAIFontAttributeNames:(NSDictionary *)attributes
- NSFont *font = [[attributes objectForKey:NSFontAttributeName] retain];
+ NSFont *font = [attributes objectForKey:NSFontAttributeName]; - return [[attributes retain] autorelease];
NSMutableDictionary *mutableAttributes = [attributes mutableCopy];
@@ -834,10 +823,7 @@
[mutableAttributes setObject:@"italic" forKey:AIFontStyleAttributeName];
NSDictionary *result = [NSDictionary dictionaryWithDictionary:mutableAttributes];
- [mutableAttributes release];
@@ -890,7 +876,7 @@
[elementStack addObject:divElement];
[attributeNamesStack addObject:emptySet];
- NSMutableSet *CSSCapableAttributes = [[[NSAttributedString CSSCapableAttributesSet] mutableCopy] autorelease];
+ NSMutableSet *CSSCapableAttributes = [[NSAttributedString CSSCapableAttributesSet] mutableCopy]; [CSSCapableAttributes addObject:NSLinkAttributeName];
NSSet *CSSCapableAttributesWithNoAttachment = [NSSet setWithSet:CSSCapableAttributes];
[CSSCapableAttributes addObject:NSAttachmentAttributeName];
@@ -924,7 +910,7 @@
--popRange.location; ++popRange.length;
NSMutableSet *attributeNames = [attributeNamesStack objectAtIndex:popRange.location];
- NSMutableSet *intersection = [[attributeNames mutableCopy] autorelease];
+ NSMutableSet *intersection = [attributeNames mutableCopy]; [intersection intersectSet:mutableEndedKeys];
[attributeNames minusSet:intersection];
@@ -953,11 +939,10 @@
- [mutableEndedKeys release];
//Now handle attributes that have started or changed.
- NSMutableString *elementContent = [[[inMessageString substringWithRange:runRange] mutableCopy] autorelease];
+ NSMutableString *elementContent = [[inMessageString substringWithRange:runRange] mutableCopy]; BOOL addElementContentToTopElement;
if ([startedKeys count]) {
@@ -976,7 +961,6 @@
[item addObject:[NSNumber numberWithUnsignedInteger:attributeRange.length]];
[item addObject:attributeName];
[startedKeysArray replaceObjectAtIndex:i withObject:item];
//Sort. Items will be sorted first by length, then by attribute name.
[startedKeysArray sortUsingSelector:@selector(compare:)];
@@ -1020,7 +1004,6 @@
[[elementStack lastObject] addObject:elementContent];
- [startedKeysArray release];
addElementContentToTopElement = YES;
@@ -1066,7 +1049,7 @@
- (NSAttributedString *)decodeHTML:(NSString *)inMessage withDefaultAttributes:(NSDictionary *)inDefaultAttributes
- if (!inMessage) return [[[NSAttributedString alloc] init] autorelease];
+ if (!inMessage) return [[NSAttributedString alloc] init]; static NSCharacterSet *tagCharStart = nil, *tagEnd = nil, *charEnd = nil, *absoluteTagEnd = nil;
@@ -1086,15 +1069,15 @@
if (inDefaultAttributes) {
textAttributes = [AITextAttributes textAttributesWithDictionary:inDefaultAttributes];
- textAttributes = [[[AITextAttributes alloc] init] autorelease];
+ textAttributes = [[AITextAttributes alloc] init]; attrString = [[NSMutableAttributedString alloc] init];
- if (!tagCharStart) tagCharStart = [[NSCharacterSet characterSetWithCharactersInString:@"<&"] retain];
- if (!tagEnd) tagEnd = [[NSCharacterSet characterSetWithCharactersInString:@" >"] retain];
- if (!charEnd) charEnd = [[NSCharacterSet characterSetWithCharactersInString:@";"] retain];
- if (!absoluteTagEnd) absoluteTagEnd = [[NSCharacterSet characterSetWithCharactersInString:@">"] retain];
+ if (!tagCharStart) tagCharStart = [NSCharacterSet characterSetWithCharactersInString:@"<&"]; + if (!tagEnd) tagEnd = [NSCharacterSet characterSetWithCharactersInString:@" >"]; + if (!charEnd) charEnd = [NSCharacterSet characterSetWithCharactersInString:@";"]; + if (!absoluteTagEnd) absoluteTagEnd = [NSCharacterSet characterSetWithCharactersInString:@">"]; scanner = [NSScanner scannerWithString:inMessage];
[scanner setCharactersToBeSkipped:[NSCharacterSet characterSetWithCharactersInString:@""]];
@@ -1124,24 +1107,24 @@
if (languageValue && ([languageValue intValue] == 143)) {
NSString *fontFamily = [textAttributes fontFamily];
if ([fontFamily caseInsensitiveCompare:@"Symbol"] == NSOrderedSame) {
chunkString = [chunkString stringByConvertingSymbolToSymbolUnicode];
} else if ([fontFamily rangeOfString:@"Wingdings" options:NSCaseInsensitiveSearch].location != NSNotFound) {
if ([NSFont fontWithName:fontFamily size:0]) {
//Use the font (in is Private Use space) if it is installed
chunkString = [chunkString stringByTranslatingByOffset:0xF000];
chunkString = [chunkString stringByConvertingWingdingsToUnicode];
} else if ([fontFamily rangeOfString:@"Webdings" options:NSCaseInsensitiveSearch].location != NSNotFound) {
if ([NSFont fontWithName:fontFamily size:0]) {
//Use the Webdings font if it is installed
chunkString = [chunkString stringByTranslatingByOffset:0xF000];
@@ -1151,163 +1134,163 @@
if ([scanner scanCharactersFromSet:tagCharStart intoString:&tagOpen]) { //If a tag wasn't found, we don't process.
NSUInteger scanLocation = [scanner scanLocation]; //Remember our location (if this is an invalid tag we'll need to move back)
if ([tagOpen isEqualToString:@"<"]) { // HTML <tag>
BOOL validTag = [scanner scanUpToCharactersFromSet:tagEnd intoString:&chunkString]; //Get the tag
NSString *charactersToSkipAfterThisTag = nil;
if ([chunkString caseInsensitiveCompare:@"HTML"] == NSOrderedSame) {
//We ignore most stuff inside the HTML tag, but don't want to see the end of it.
[scanner scanUpToCharactersFromSet:absoluteTagEnd intoString:&chunkString];
} else if ([chunkString caseInsensitiveCompare:@"/HTML"] == NSOrderedSame) {
- //PRE -- ignore attributes for logViewer
+ //PRE -- ignore attributes for logViewer } else if ([chunkString caseInsensitiveCompare:@"PRE"] == NSOrderedSame ||
- [chunkString caseInsensitiveCompare:@"/PRE"] == NSOrderedSame) {
+ [chunkString caseInsensitiveCompare:@"/PRE"] == NSOrderedSame) { [scanner scanUpToCharactersFromSet:absoluteTagEnd intoString:&chunkString];
//XXX what's going on here?
[textAttributes setTextColor:[NSColor blackColor]];
} else if ([chunkString caseInsensitiveCompare:@"DIV"] == NSOrderedSame) {
if ([scanner scanUpToCharactersFromSet:absoluteTagEnd
intoString:&chunkString]) {
[self processDivTagArgs:[self parseArguments:chunkString] attributes:textAttributes];
} else if ([chunkString caseInsensitiveCompare:@"/DIV"] == NSOrderedSame) {
} else if ([chunkString caseInsensitiveCompare:@"A"] == NSOrderedSame) {
if ([scanner scanUpToCharactersFromSet:absoluteTagEnd intoString:&chunkString]) {
- [self processLinkTagArgs:[self parseArguments:chunkString]
+ [self processLinkTagArgs:[self parseArguments:chunkString] attributes:textAttributes]; //Process the linktag's contents
} else if ([chunkString caseInsensitiveCompare:@"/A"] == NSOrderedSame) {
[textAttributes setLinkURL:nil];
} else if ([chunkString caseInsensitiveCompare:@"BODY"] == NSOrderedSame) {
if ([scanner scanUpToCharactersFromSet:absoluteTagEnd intoString:&chunkString]) {
[self processBodyTagArgs:[self parseArguments:chunkString] attributes:textAttributes]; //Process the font tag's contents
} else if (([chunkString caseInsensitiveCompare:@"/BODY"] == NSOrderedSame) ||
([chunkString caseInsensitiveCompare:@"BODY/"] == NSOrderedSame)) {
} else if ([chunkString caseInsensitiveCompare:@"FONT"] == NSOrderedSame) {
if ([scanner scanUpToCharactersFromSet:absoluteTagEnd intoString:&chunkString]) {
NSDictionary *changedAttributes;
//Process the font tag's contents
changedAttributes = [self processFontTagArgs:[self parseArguments:chunkString] attributes:textAttributes];
[fontTagChangedAttributesQueue addObject:(changedAttributes ? changedAttributes : [NSDictionary dictionary])];
} else if ([chunkString caseInsensitiveCompare:@"/FONT"] == NSOrderedSame) {
NSInteger changedAttributesCount = [fontTagChangedAttributesQueue count];
if (changedAttributesCount) {
[self restoreAttributesFromDict:[fontTagChangedAttributesQueue lastObject] intoAttributes:textAttributes];
- [fontTagChangedAttributesQueue removeObjectAtIndex:([fontTagChangedAttributesQueue count] - 1)];
+ [fontTagChangedAttributesQueue removeObjectAtIndex:([fontTagChangedAttributesQueue count] - 1)];
} else if ([chunkString caseInsensitiveCompare:@"SPAN"] == NSOrderedSame) {
if ([scanner scanUpToCharactersFromSet:absoluteTagEnd intoString:&chunkString]) {
NSDictionary *changedAttributes;
changedAttributes = [self processSpanTagArgs:[self parseArguments:chunkString] attributes:textAttributes];
[spanTagChangedAttributesQueue addObject:(changedAttributes ? changedAttributes : [NSDictionary dictionary])];
} else if ([chunkString caseInsensitiveCompare:@"/SPAN"] == NSOrderedSame) {
NSInteger changedAttributesCount = [spanTagChangedAttributesQueue count];
if (changedAttributesCount) {
[self restoreAttributesFromDict:[spanTagChangedAttributesQueue lastObject] intoAttributes:textAttributes];
- [spanTagChangedAttributesQueue removeObjectAtIndex:([spanTagChangedAttributesQueue count] - 1)];
+ [spanTagChangedAttributesQueue removeObjectAtIndex:([spanTagChangedAttributesQueue count] - 1)];
- } else if ([chunkString caseInsensitiveCompare:@"BR"] == NSOrderedSame ||
- [chunkString caseInsensitiveCompare:@"BR/"] == NSOrderedSame ||
- [chunkString caseInsensitiveCompare:@"/BR"] == NSOrderedSame) {
+ } else if ([chunkString caseInsensitiveCompare:@"BR"] == NSOrderedSame || + [chunkString caseInsensitiveCompare:@"BR/"] == NSOrderedSame || + [chunkString caseInsensitiveCompare:@"/BR"] == NSOrderedSame) { [attrString appendString:@"\n" withAttributes:nil];
/* Make sure the tag closes; it may have a <BR /> which stopped the scanner at
* at the space rather than the '>'
[scanner scanUpToCharactersFromSet:absoluteTagEnd intoString:&chunkString];
/* Skip any newlines following an HTML line break; if we have one we want to ignore the other.
- * This is generally unnecessary; it is a hack around a winAIM bug where
+ * This is generally unnecessary; it is a hack around a winAIM bug where * newlines are sent as "<BR>\n\r"
charactersToSkipAfterThisTag = @"\n\r";
} else if ([chunkString caseInsensitiveCompare:@"B"] == NSOrderedSame) {
[textAttributes enableTrait:NSBoldFontMask];
} else if ([chunkString caseInsensitiveCompare:@"/B"] == NSOrderedSame) {
[textAttributes disableTrait:NSBoldFontMask];
- //Strong (interpreted as bold)
+ //Strong (interpreted as bold) } else if ([chunkString caseInsensitiveCompare:@"STRONG"] == NSOrderedSame) {
[textAttributes enableTrait:NSBoldFontMask];
} else if ([chunkString caseInsensitiveCompare:@"/STRONG"] == NSOrderedSame) {
[textAttributes disableTrait:NSBoldFontMask];
} else if ([chunkString caseInsensitiveCompare:@"I"] == NSOrderedSame) {
[textAttributes enableTrait:NSItalicFontMask];
} else if ([chunkString caseInsensitiveCompare:@"/I"] == NSOrderedSame) {
[textAttributes disableTrait:NSItalicFontMask];
- //Emphasised (interpreted as italic)
+ //Emphasised (interpreted as italic) } else if ([chunkString caseInsensitiveCompare:@"EM"] == NSOrderedSame) {
[textAttributes enableTrait:NSItalicFontMask];
} else if ([chunkString caseInsensitiveCompare:@"/EM"] == NSOrderedSame) {
[textAttributes disableTrait:NSItalicFontMask];
} else if ([chunkString caseInsensitiveCompare:@"U"] == NSOrderedSame) {
[textAttributes setUnderline:YES];
} else if ([chunkString caseInsensitiveCompare:@"/U"] == NSOrderedSame) {
[textAttributes setUnderline:NO];
- //Strikethrough: <s> is deprecated, but people use it
+ //Strikethrough: <s> is deprecated, but people use it } else if ([chunkString caseInsensitiveCompare:@"S"] == NSOrderedSame) {
[textAttributes setStrikethrough:YES];
} else if ([chunkString caseInsensitiveCompare:@"/S"] == NSOrderedSame) {
[textAttributes setStrikethrough:NO];
} else if ([chunkString caseInsensitiveCompare:@"SUB"] == NSOrderedSame) {
[textAttributes setSubscript:YES];
} else if ([chunkString caseInsensitiveCompare:@"/SUB"] == NSOrderedSame) {
[textAttributes setSubscript:NO];
} else if ([chunkString caseInsensitiveCompare:@"SUP"] == NSOrderedSame) {
[textAttributes setSuperscript:YES];
} else if ([chunkString caseInsensitiveCompare:@"/SUP"] == NSOrderedSame) {
[textAttributes setSuperscript:NO];
} else if ([chunkString caseInsensitiveCompare:@"IMG"] == NSOrderedSame) {
if ([scanner scanUpToCharactersFromSet:absoluteTagEnd intoString:&chunkString]) {
- NSAttributedString *attachString = [self processImgTagArgs:[self parseArguments:chunkString]
+ NSAttributedString *attachString = [self processImgTagArgs:[self parseArguments:chunkString] attributes:textAttributes
@@ -1316,51 +1299,50 @@
} else if ([chunkString caseInsensitiveCompare:@"/IMG"] == NSOrderedSame) {
//just ignore </img> if we find it
} else if ([chunkString caseInsensitiveCompare:@"HR"] == NSOrderedSame) {
[attrString appendString:horizontalRule withAttributes:nil];
- // Ignore <p> for those wacky AIM express users
+ // Ignore <p> for those wacky AIM express users } else if ([chunkString caseInsensitiveCompare:@"P"] == NSOrderedSame ||
([chunkString caseInsensitiveCompare:@"/P"] == NSOrderedSame)) {
} else if ([chunkString caseInsensitiveCompare:@"HEAD"] == NSOrderedSame ||
([chunkString caseInsensitiveCompare:@"/HEAD"] == NSOrderedSame)) {
[scanner scanUpToCharactersFromSet:absoluteTagEnd intoString:&chunkString];
} else if ([chunkString caseInsensitiveCompare:@"BASE"] == NSOrderedSame) {
if ([scanner scanUpToCharactersFromSet:absoluteTagEnd intoString:&chunkString]) {
- myBaseURL = [[[self parseArguments:chunkString] objectForKey:@"href"] retain];
+ myBaseURL = [[self parseArguments:chunkString] objectForKey:@"href"];
} else if ([chunkString caseInsensitiveCompare:@"META"] == NSOrderedSame ||
([chunkString caseInsensitiveCompare:@"/META"] == NSOrderedSame)) {
[scanner scanUpToCharactersFromSet:absoluteTagEnd intoString:&chunkString];
- //Ignore <ul>, </ul>, and </li>
+ //Ignore <ul>, </ul>, and </li> } else if (([chunkString caseInsensitiveCompare:@"UL"] == NSOrderedSame) ||
([chunkString caseInsensitiveCompare:@"/UL"] == NSOrderedSame) ||
([chunkString caseInsensitiveCompare:@"/LI"] == NSOrderedSame)) {
- //Convert <li> into a bullet point
+ //Convert <li> into a bullet point } else if ([chunkString caseInsensitiveCompare:@"LI"] == NSOrderedSame) {
[attrString appendString:@"• " withAttributes:[textAttributes dictionary]];
//Skip over the end tag character '>' and any other characters we want to skip
//Get to the > if we're not there already, as will happen with XML namespacing...
[scanner scanUpToCharactersFromSet:absoluteTagEnd intoString:NULL];
if (![scanner isAtEnd]) {
[scanner setScanLocation:[scanner scanLocation]+1];
@@ -1380,51 +1362,51 @@
[attrString appendString:@"<" withAttributes:[textAttributes dictionary]];
[scanner setScanLocation:scanLocation];
} else if ([tagOpen compare:@"&"] == NSOrderedSame) { // escape character, eg >
BOOL validTag = [scanner scanUpToCharactersFromSet:charEnd intoString:&chunkString];
// We could upgrade this to use an NSDictionary with lots of chars
// but for now, if-blocks will do
if ([chunkString caseInsensitiveCompare:@"GT"] == NSOrderedSame) {
[attrString appendString:@">" withAttributes:[textAttributes dictionary]];
} else if ([chunkString caseInsensitiveCompare:@"LT"] == NSOrderedSame) {
[attrString appendString:@"<" withAttributes:[textAttributes dictionary]];
} else if ([chunkString caseInsensitiveCompare:@"AMP"] == NSOrderedSame) {
[attrString appendString:@"&" withAttributes:[textAttributes dictionary]];
} else if ([chunkString caseInsensitiveCompare:@"QUOT"] == NSOrderedSame) {
[attrString appendString:@"\"" withAttributes:[textAttributes dictionary]];
} else if ([chunkString caseInsensitiveCompare:@"APOS"] == NSOrderedSame) {
[attrString appendString:@"'" withAttributes:[textAttributes dictionary]];
} else if ([chunkString caseInsensitiveCompare:@"NBSP"] == NSOrderedSame) {
[attrString appendString:@" " withAttributes:[textAttributes dictionary]];
} else if ([chunkString hasPrefix:@"#x"]) {
NSString *hexString = [chunkString substringFromIndex:2];
NSScanner *hexScanner = [NSScanner scannerWithString:hexString];
unsigned int character = 0;
if([hexScanner scanHexInt:&character])
- [attrString appendString:[NSString stringWithFormat:@"%C", character]
+ [attrString appendString:[NSString stringWithFormat:@"%C", (unichar)character] withAttributes:[textAttributes dictionary]];
} else if ([chunkString hasPrefix:@"#"]) {
NSString *decString = [chunkString substringFromIndex:1];
NSScanner *decScanner = [NSScanner scannerWithString:decString];
if([decScanner scanInt:&character])
- [attrString appendString:[NSString stringWithFormat:@"%C", character]
+ [attrString appendString:[NSString stringWithFormat:@"%C", (unichar)character] withAttributes:[textAttributes dictionary]];
if (validTag) { //Skip over the end tag character ';'. Don't scan all of that character, however, as we'll skip ;; and so on.
[scanner setScanLocation:[scanner scanLocation] + 1];
@@ -1464,9 +1446,7 @@
- return [attrString autorelease];
@@ -1721,7 +1701,7 @@
defaultColor:[NSColor blackColor]]];
//Take out the background-color attribute, so that the following search for color: does not match it.
- NSMutableString *mStyle = [[style mutableCopy] autorelease];
+ NSMutableString *mStyle = [style mutableCopy]; [mStyle replaceCharactersInRange:attributeRange
withString:@"onpxtebhaq-pbybe:"]; //ROT13('background-color: ')
@@ -1780,7 +1760,7 @@
* returns NULL if any percent escapes are invalid... and %n is decidedly invalid.
if ([linkString rangeOfString:@"%n"].location != NSNotFound) {
- NSMutableString *newLinkString = [[linkString mutableCopy] autorelease];
+ NSMutableString *newLinkString = [linkString mutableCopy]; [newLinkString replaceOccurrencesOfString:@"%n"
@@ -1831,7 +1811,7 @@
- (NSAttributedString *)processImgTagArgs:(NSDictionary *)inArgs attributes:(AITextAttributes *)textAttributes baseURL:(NSString *)inBaseURL
NSAttributedString *attachString;
- AITextAttachmentExtension *attachment = [[[AITextAttachmentExtension alloc] init] autorelease];
+ AITextAttachmentExtension *attachment = [[AITextAttachmentExtension alloc] init]; for (NSString *arg in inArgs) {
if ([arg caseInsensitiveCompare:@"src"] == NSOrderedSame) {
@@ -1879,7 +1859,6 @@
NSTextAttachmentCell *cell = [[NSTextAttachmentCell alloc] initImageCell:image];
[attachment setAttachmentCell:cell];
attachString = [NSAttributedString attributedStringWithAttachment:attachment];
@@ -1963,14 +1942,14 @@
NSSize imageSize = [attachmentImage size];
[string appendFormat:@"<img %@src=\"%@%@\" alt=\"%@\" width=\"%i\" height=\"%i\">",
- srcPath, (uniqueifyHTML ? [NSString stringWithFormat:@"?%i", [[NSDate date] timeIntervalSince1970]] : @""),
+ srcPath, (uniqueifyHTML ? [NSString stringWithFormat:@"?%f", [[NSDate date] timeIntervalSince1970]] : @""), (int)imageSize.width, (int)imageSize.height];
[string appendFormat:@"<img %@src=\"%@%@\" alt=\"%@\">",
- srcPath, (uniqueifyHTML ? [NSString stringWithFormat:@"?%i", [[NSDate date] timeIntervalSince1970]] : @""),
+ srcPath, (uniqueifyHTML ? [NSString stringWithFormat:@"?%f", [[NSDate date] timeIntervalSince1970]] : @""), --- a/Frameworks/Adium Framework/Source/AIIconState.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIIconState.m Sun Sep 09 12:24:39 2012 -0400
@@ -49,7 +49,7 @@
- image = [inImage retain];
@@ -94,10 +94,10 @@
- image = [[self _compositeStates:inIconStates
+ image = [self _compositeStates:inIconStates withBaseState:baseIconState
animatingState:animatingState
} else { //Animating icon
@@ -107,15 +107,15 @@
imageArray = [[NSMutableArray alloc] init];
//Hold onto some of this info so we can render the additional images later
- iconRendering_states = [inIconStates retain];
- iconRendering_baseState = [baseIconState retain];
- iconRendering_animationState = [animatingState retain];
+ iconRendering_states = inIconStates; + iconRendering_baseState = baseIconState; + iconRendering_animationState = animatingState; - image = [[self _compositeStates:inIconStates
+ image = [self _compositeStates:inIconStates withBaseState:baseIconState
animatingState:animatingState
[imageArray addObject:image];
@@ -141,17 +141,6 @@
- [iconRendering_states release];
- [iconRendering_baseState release];
- [iconRendering_animationState release];
- (NSInteger)currentFrame
@@ -180,15 +169,14 @@
//After rendering the last frame, we can release our icon rendering information (it's no longer needed)
if (currentFrame >= (numberOfFrames - 1)) {
- [iconRendering_states release]; iconRendering_states = nil;
- [iconRendering_baseState release]; iconRendering_baseState = nil;
- [iconRendering_animationState release]; iconRendering_animationState = nil;
+ iconRendering_states = nil; + iconRendering_baseState = nil; + iconRendering_animationState = nil; if (currentFrame < imageArrayCount) {
- image = [[imageArray objectAtIndex:currentFrame] retain];
+ image = [imageArray objectAtIndex:currentFrame]; @@ -270,7 +258,7 @@
[workingImage unlockFocus];
- return [workingImage autorelease];
--- a/Frameworks/Adium Framework/Source/AIImageTextCellView.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIImageTextCellView.m Sun Sep 09 12:24:39 2012 -0400
@@ -47,12 +47,6 @@
[cell setFont:[NSFont systemFontOfSize:12]];
- [cell release]; cell = nil;
//NSCell expects to draw into a flipped view
--- a/Frameworks/Adium Framework/Source/AIInterfaceControllerProtocol.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIInterfaceControllerProtocol.h Sun Sep 09 12:24:39 2012 -0400
@@ -74,6 +74,19 @@
DCWebkitMessageView //Preferred message view
+ AITextAndButtonsDefaultReturn = 1, + AITextAndButtonsAlternateReturn = 0, + AITextAndButtonsOtherReturn = -1, + AITextAndButtonsClosedWithoutResponse = -2 +} AITextAndButtonsReturnCode; + AITextAndButtonsWindowButtonDefault = 0, + AITextAndButtonsWindowButtonAlternate, + AITextAndButtonsWindowButtonOther +} AITextAndButtonsWindowButton; @protocol AIInterfaceComponent, AIContactListComponent, AIMessageDisplayController, AIMessageDisplayPlugin;
@protocol AIContactListTooltipEntry, AIFlashObserver, AIPlugin;
@@ -369,10 +382,10 @@
#pragma mark Question Display
- (void)displayQuestion:(NSString *)inTitle withAttributedDescription:(NSAttributedString *)inDesc withWindowTitle:(NSString *)inWindowTitle
defaultButton:(NSString *)inDefaultButton alternateButton:(NSString *)inAlternateButton otherButton:(NSString *)inOtherButton suppression:(NSString *)inSuppression
- target:(id)inTarget selector:(SEL)inSelector userInfo:(id)inUserInfo;
+responseHandler:(void (^)(AITextAndButtonsReturnCode ret, BOOL suppressed, id userInfo))handler; - (void)displayQuestion:(NSString *)inTitle withDescription:(NSString *)inDesc withWindowTitle:(NSString *)inWindowTitle
defaultButton:(NSString *)inDefaultButton alternateButton:(NSString *)inAlternateButton otherButton:(NSString *)inOtherButton suppression:(NSString *)inSuppression
- target:(id)inTarget selector:(SEL)inSelector userInfo:(id)inUserInfo;
+responseHandler:(void (^)(AITextAndButtonsReturnCode ret, BOOL suppressed, id userInfo))handler; #pragma mark Synchronized Flashing
- (void)registerFlashObserver:(id <AIFlashObserver>)inObserver;
--- a/Frameworks/Adium Framework/Source/AIListBookmark.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIListBookmark.h Sun Sep 09 12:24:39 2012 -0400
@@ -36,7 +36,7 @@
- (id)initWithChat:(AIChat *)inChat;
-@property (retain, nonatomic) NSString *password;
+@property (nonatomic) NSString *password; @property (readonly, nonatomic) NSString *name;
@property (readonly, nonatomic) NSDictionary *chatCreationDictionary;
--- a/Frameworks/Adium Framework/Source/AIListBookmark.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIListBookmark.m Sun Sep 09 12:24:39 2012 -0400
@@ -105,7 +105,6 @@
AIAccount *myAccount = [adium.accountController accountWithInternalObjectID:[decoder decodeObjectForKey:KEY_ACCOUNT_INTERNAL_ID]];
@@ -131,15 +130,9 @@
- [name release]; name = nil;
- [chatCreationDictionary release]; chatCreationDictionary = nil;
- [password release]; password = nil;
[[NSNotificationCenter defaultCenter] removeObserver:self];
[adium.chatController unregisterChatObserver:self];
[self.account removeObserver:self forKeyPath:@"isOnline"];
@@ -187,7 +180,7 @@
NSAssert(self.account != nil, @"Null list bookmark account - make sure you didn't try to touch the internalObjectID before it was loaded.");
// We're not like any other bookmarks by the same name.
- internalObjectID = [[NSString stringWithFormat:@"%@.%@.%@", self.service.serviceID, self.UID, self.account.UID] retain];
+ internalObjectID = [NSString stringWithFormat:@"%@.%@.%@", self.service.serviceID, self.UID, self.account.UID]; @@ -438,7 +431,7 @@
- (NSString *)description
- return [NSString stringWithFormat:@"<%@:%x %@ - %@ on %@ in %@>",NSStringFromClass([self class]), self, self.formattedUID, [self chatCreationDictionary], self.account, self.remoteGroups];
+ return [NSString stringWithFormat:@"<%@:%p %@ - %@ on %@ in %@>",NSStringFromClass([self class]), self, self.formattedUID, [self chatCreationDictionary], self.account, self.remoteGroups]; --- a/Frameworks/Adium Framework/Source/AIListCell.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIListCell.h Sun Sep 09 12:24:39 2012 -0400
@@ -22,7 +22,7 @@
#define DROP_HIGHLIGHT_HEIGHT_MARGIN 1.0f
@interface AIListCell : NSCell {
- AIListOutlineView *controlView;
+ AIListOutlineView *__weak controlView; AIProxyListObject *proxyObject;
@@ -52,13 +52,13 @@
- (void)setProxyListObject:(AIProxyListObject *)inObject;
@property (readonly, nonatomic) BOOL isGroup;
-@property (readwrite, assign, nonatomic) AIListOutlineView *controlView;
+@property (readwrite, weak, nonatomic) AIListOutlineView *controlView; -@property (readwrite, retain, nonatomic) NSFont *font;
+@property (readwrite, nonatomic) NSFont *font; @property (readwrite, nonatomic) NSTextAlignment textAlignment;
-@property (readwrite, retain, nonatomic) NSColor *textColor;
-@property (readwrite, retain, nonatomic) NSColor *invertedTextColor;
+@property (readwrite, nonatomic) NSColor *textColor; +@property (readwrite, nonatomic) NSColor *invertedTextColor; //Cell sizing and padding
- (void) setSplitVerticalSpacing:(int) inSpacing;
@@ -83,15 +83,15 @@
- (void)drawBackgroundWithFrame:(NSRect)rect;
- (void)drawContentWithFrame:(NSRect)rect;
- (void)drawDropHighlightWithFrame:(NSRect)rect;
-@property (readonly, nonatomic) NSAttributedString *displayName;
+@property (weak, readonly, nonatomic) NSAttributedString *displayName; @property (readonly, nonatomic) NSSize displayNameSize;
- (NSRect)drawDisplayNameWithFrame:(NSRect)inRect;
-@property (readonly, nonatomic) NSString *labelString;
-@property (readonly, nonatomic) NSMutableDictionary *labelAttributes;
-@property (readonly, nonatomic) NSDictionary *additionalLabelAttributes;
+@property (weak, readonly, nonatomic) NSString *labelString; +@property (weak, readonly, nonatomic) NSMutableDictionary *labelAttributes; +@property (weak, readonly, nonatomic) NSDictionary *additionalLabelAttributes; @property (readonly, nonatomic) BOOL cellIsSelected;
@property (readonly, nonatomic) BOOL drawGridBehindCell;
-@property (readonly, nonatomic) NSColor *backgroundColor;
+@property (weak, readonly, nonatomic) NSColor *backgroundColor; @property (readwrite, nonatomic) BOOL shouldShowAlias;
--- a/Frameworks/Adium Framework/Source/AIListCell.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIListCell.m Sun Sep 09 12:24:39 2012 -0400
@@ -50,15 +50,15 @@
- font = [[NSFont systemFontOfSize:12] retain];
- textColor = [[NSColor blackColor] retain];
- invertedTextColor = [[NSColor whiteColor] retain];
+ font = [NSFont systemFontOfSize:12]; + textColor = [NSColor blackColor]; + invertedTextColor = [NSColor whiteColor]; useAliasesAsRequested = YES;
if (!leftParagraphStyleWithTruncatingTail) {
- leftParagraphStyleWithTruncatingTail = [[NSMutableParagraphStyle styleWithAlignment:NSLeftTextAlignment
- lineBreakMode:NSLineBreakByTruncatingTail] retain];
+ leftParagraphStyleWithTruncatingTail = [NSMutableParagraphStyle styleWithAlignment:NSLeftTextAlignment + lineBreakMode:NSLineBreakByTruncatingTail]; @@ -74,33 +74,16 @@
newCell->proxyObject = nil;
[newCell setProxyListObject:proxyObject];
- [newCell->font retain];
- [newCell->textColor retain];
- [newCell->invertedTextColor retain];
- [invertedTextColor release];
- [labelAttributes release];
//Set the list object being drawn
- (void)setProxyListObject:(AIProxyListObject *)inProxyObject
if (proxyObject != inProxyObject) {
- proxyObject = [inProxyObject retain];
+ proxyObject = inProxyObject; isGroup = [[proxyObject listObject] isKindOfClass:[AIListGroup class]];
@@ -120,13 +103,12 @@
- (void)setFont:(NSFont *)inFont
- font = [inFont retain];
//Calculate and cache the height of this font
- labelFontHeight = [[[[NSLayoutManager alloc] init] autorelease] defaultLineHeightForFont:[self font]];
- [labelAttributes release]; labelAttributes = nil;
+ labelFontHeight = [[[NSLayoutManager alloc] init] defaultLineHeightForFont:[self font]]; @@ -260,8 +242,8 @@
NSDictionary *attributes = self.labelAttributes;
NSString *labelString = self.labelString;
if (![labelAttributes isEqualToDictionary:proxyObject.cachedLabelAttributes] || ![labelString isEqualToString:proxyObject.cachedDisplayNameString]) {
- proxyObject.cachedDisplayName = [[[NSAttributedString alloc] initWithString:labelString
- attributes:attributes] autorelease];
+ proxyObject.cachedDisplayName = [[NSAttributedString alloc] initWithString:labelString + attributes:attributes]; proxyObject.cachedDisplayNameString = labelString;
proxyObject.cachedLabelAttributes = attributes;
proxyObject.cachedDisplayNameSize = NSZeroSize;
@@ -346,10 +328,10 @@
- (NSMutableDictionary *)labelAttributes
- labelAttributes = [[NSMutableDictionary dictionaryWithObjectsAndKeys:
+ labelAttributes = [NSMutableDictionary dictionaryWithObjectsAndKeys: leftParagraphStyleWithTruncatingTail, NSParagraphStyleAttributeName,
[self font], NSFontAttributeName,
@@ -398,7 +380,7 @@
NSMutableArray *attributeNames = [[super accessibilityAttributeNames] mutableCopy];
[attributeNames addObject:NSAccessibilityValueAttribute];
- return [attributeNames autorelease];
- (id)accessibilityAttributeValue:(NSString *)attribute
@@ -425,7 +407,7 @@
statusType:[proxyObject listObject].statusType];
statusMessage = [[proxyObject listObject] statusMessageString];
- value = [[name mutableCopy] autorelease];
+ value = [name mutableCopy]; if (statusDescription) [value appendFormat:@"; %@", statusDescription];
if (statusMessage) [value appendFormat:AILocalizedString(@"; status message %@", "please keep the semicolon at the start of the line. %@ will be replaced by a status message. This is used when reading an entry in the contact list aloud, such as 'Evan Schoenberg; status message I am bouncing up and down'"), statusMessage];
--- a/Frameworks/Adium Framework/Source/AIListContact.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIListContact.h Sun Sep 09 12:24:39 2012 -0400
@@ -58,10 +58,10 @@
- (id)initWithUID:(NSString *)inUID account:(AIAccount *)inAccount service:(AIService *)inService;
- (id)initWithUID:(NSString *)inUID service:(AIService *)inService;
-@property (readonly, nonatomic) id<AIContainingObject>containingObject __attribute__((deprecated));
+@property (unsafe_unretained, readonly, nonatomic) id<AIContainingObject>containingObject __attribute__((deprecated)); @property (readwrite, copy, nonatomic) NSSet *remoteGroupNames;
@property (readonly, nonatomic) NSUInteger countOfRemoteGroupNames;
-@property (readonly, nonatomic) NSSet *remoteGroups;
+@property (weak, readonly, nonatomic) NSSet *remoteGroups; - (void) addRemoteGroupName:(NSString *)name;
- (void) removeRemoteGroupName:(NSString *)name;
@@ -71,12 +71,12 @@
+ (NSString *)internalUniqueObjectIDForService:(AIService *)inService account:(AIAccount *)inAccount UID:(NSString *)inUID;
-@property (readonly, nonatomic) AIListContact *parentContact; //This needs renaming. It's the 'topmost' contact, either self or meta
-@property (readonly, nonatomic, assign) AIMetaContact *metaContact;
+@property (weak, readonly, nonatomic) AIListContact *parentContact; //This needs renaming. It's the 'topmost' contact, either self or meta +@property (readonly, nonatomic, weak) AIMetaContact *metaContact; -@property (readonly, nonatomic) NSString *ownDisplayName;
-@property (readonly, nonatomic) NSString *ownPhoneticName;
-@property (readonly, nonatomic) NSString *serversideDisplayName;
+@property (weak, readonly, nonatomic) NSString *ownDisplayName; +@property (weak, readonly, nonatomic) NSString *ownPhoneticName; +@property (weak, readonly, nonatomic) NSString *serversideDisplayName; @property (readonly, nonatomic) BOOL canJoinMetaContacts;
--- a/Frameworks/Adium Framework/Source/AIListContact.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIListContact.m Sun Sep 09 12:24:39 2012 -0400
@@ -46,7 +46,7 @@
@interface AIListContact ()
-@property (readwrite, nonatomic, assign) AIMetaContact *metaContact;
+@property (readwrite, nonatomic, weak) AIMetaContact *metaContact; - (void) remoteGroupingChanged;
@@ -56,7 +56,7 @@
- (id)initWithUID:(NSString *)inUID account:(AIAccount *)inAccount service:(AIService *)inService
if ((self = [self initWithUID:inUID service:inService])) {
- account = [inAccount retain];
@@ -74,26 +74,6 @@
- [account release]; account = nil;
- [m_remoteGroupNames release]; m_remoteGroupNames = nil;
- [internalUniqueObjectID release]; internalUniqueObjectID = nil;
- [textColor release]; textColor = nil;
- [invertedTextColor release]; invertedTextColor = nil;
- [labelColor release]; labelColor = nil;
- [imageOpacity release]; imageOpacity = nil;
- [ABUniqueID release]; ABUniqueID = nil;
- [textProfile release]; textProfile = nil;
- [idleSince release]; idleSince = nil;
- [idleReadable release]; idleReadable = nil;
- [serverDisplayName release]; serverDisplayName = nil;
- [formattedUID release]; formattedUID = nil;
//The account that owns this contact
@@ -106,9 +86,9 @@
- (void)setUID:(NSString *)inUID
- [UID release]; UID = [inUID retain];
- [internalObjectID release]; internalObjectID = nil;
- [internalUniqueObjectID release]; internalUniqueObjectID = nil;
+ internalObjectID = nil; + internalUniqueObjectID = nil; @@ -117,9 +97,9 @@
- (NSString *)internalUniqueObjectID
if (!internalUniqueObjectID) {
- internalUniqueObjectID = [[AIListContact internalUniqueObjectIDForService:self.service
+ internalUniqueObjectID = [AIListContact internalUniqueObjectIDForService:self.service
return internalUniqueObjectID;
@@ -136,7 +116,7 @@
- (NSSet *) remoteGroupNames
- return [[m_remoteGroupNames copy] autorelease];
+ return [m_remoteGroupNames copy]; - (void) setRemoteGroupNames:(NSSet *)inGroupNames
@@ -311,8 +291,6 @@
userInfo:[NSDictionary dictionaryWithObject:[NSNumber numberWithBool:YES]
- [cleanedAlias release];
@@ -665,7 +643,7 @@
statusType:self.statusType];
- contactListStatusMessage = [[[NSAttributedString alloc] initWithString:descriptionOfStatus] autorelease];
+ contactListStatusMessage = [[NSAttributedString alloc] initWithString:descriptionOfStatus]; @@ -879,9 +857,9 @@
- (NSScriptObjectSpecifier *)objectSpecifier
NSScriptObjectSpecifier *containerRef = self.account.objectSpecifier;
- return [[[NSNameSpecifier allocWithZone:[self zone]]
+ return [[NSNameSpecifier alloc] initWithContainerClassDescription:[containerRef keyClassDescription]
- containerSpecifier:containerRef key:@"contacts" name:self.UID] autorelease];
+ containerSpecifier:containerRef key:@"contacts" name:self.UID]; --- a/Frameworks/Adium Framework/Source/AIListContactBubbleCell.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIListContactBubbleCell.m Sun Sep 09 12:24:39 2012 -0400
@@ -45,18 +45,11 @@
- (AIListContactBubbleCell *)copyWithZone:(NSZone *)zone
AIListContactBubbleCell *newCell = [super copyWithZone:zone];
- newCell->lastBackgroundBezierPath = [lastBackgroundBezierPath retain];
+ newCell->lastBackgroundBezierPath = lastBackgroundBezierPath;
- [lastBackgroundBezierPath release]; lastBackgroundBezierPath = nil;
//Give ourselves extra padding to compensate for the rounded bubble
return [super leftPadding] + EDGE_INDENT;
@@ -84,13 +77,12 @@
if (!labelColor) labelColor = [self backgroundColor];
//Draw our background with rounded corners, retaining the bezier path for use in drawUserIconInRect:position:
- [lastBackgroundBezierPath release];
- lastBackgroundBezierPath = [[NSBezierPath bezierPathWithRoundedRect:[self bubbleRectForFrame:rect]] retain];
+ lastBackgroundBezierPath = [NSBezierPath bezierPathWithRoundedRect:[self bubbleRectForFrame:rect]]; //Draw using a (slow) AIGradient if requested, otherwise just fill
- NSGradient *gradient = [[[NSGradient alloc] initWithStartingColor:labelColor endingColor:[labelColor darkenAndAdjustSaturationBy:0.4f]] autorelease];
+ NSGradient *gradient = [[NSGradient alloc] initWithStartingColor:labelColor endingColor:[labelColor darkenAndAdjustSaturationBy:0.4f]]; [gradient drawInBezierPath:lastBackgroundBezierPath angle:90.0f];
@@ -113,11 +105,10 @@
if ([self cellIsSelected]) {
NSColor *highlightColor = [controlView highlightColor];
NSGradient *gradient = highlightColor
- ? [[[NSGradient alloc] initWithStartingColor:highlightColor endingColor:[highlightColor darkenAndAdjustSaturationBy:0.4f]] autorelease]
+ ? [[NSGradient alloc] initWithStartingColor:highlightColor endingColor:[highlightColor darkenAndAdjustSaturationBy:0.4f]] : [NSGradient selectedControlGradient];
- [lastBackgroundBezierPath release];
- lastBackgroundBezierPath = [[NSBezierPath bezierPathWithRoundedRect:[self bubbleRectForFrame:cellFrame]] retain];
+ lastBackgroundBezierPath = [NSBezierPath bezierPathWithRoundedRect:[self bubbleRectForFrame:cellFrame]]; //Draw our bubble with the selected control gradient
[gradient drawInBezierPath:lastBackgroundBezierPath angle:90.0f];
--- a/Frameworks/Adium Framework/Source/AIListContactCell.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIListContactCell.m Sun Sep 09 12:24:39 2012 -0400
@@ -38,10 +38,10 @@
AIListContactCell *newCell = [super copyWithZone:zone];
- newCell->statusFont = [statusFont retain];
- newCell->statusColor = [statusColor retain];
- newCell->_statusAttributes = [_statusAttributes retain];
- newCell->_statusAttributesInverted = [_statusAttributesInverted retain];
+ newCell->statusFont = statusFont; + newCell->statusColor = statusColor; + newCell->_statusAttributes = _statusAttributes; + newCell->_statusAttributesInverted = _statusAttributesInverted; @@ -52,7 +52,7 @@
if ((self = [super init]))
backgroundOpacity = 1.0f;
- statusFont = [[NSFont systemFontOfSize:12] retain];
+ statusFont = [NSFont systemFontOfSize:12]; _statusAttributesInverted = nil;
@@ -62,19 +62,6 @@
- [_statusAttributes release];
- [_statusAttributesInverted release];
//Cell sizing and padding ----------------------------------------------------------------------------------------------
#pragma mark Cell sizing and padding
@@ -127,7 +114,6 @@
NSAttributedString *idleAttString = [[NSAttributedString alloc] initWithString:idleTimeString attributes:self.statusAttributes];
width += AIceil([idleAttString size].width);
width += NAME_STATUS_PAD;
- [idleAttString release];
@@ -174,14 +160,13 @@
- (void)setStatusFont:(NSFont *)inFont
if (statusFont != inFont) {
- statusFont = [inFont retain];
//Calculate and cache the height of this font
- statusFontHeight = [[[[NSLayoutManager alloc] init] autorelease] defaultLineHeightForFont:[self statusFont]];
+ statusFontHeight = [[[NSLayoutManager alloc] init] defaultLineHeightForFont:[self statusFont]]; //Flush the status attributes cache
- [_statusAttributes release]; _statusAttributes = nil;
+ _statusAttributes = nil; @@ -192,11 +177,10 @@
- (void)setStatusColor:(NSColor *)inColor
if (statusColor != inColor) {
- statusColor = [inColor retain];
//Flush the status attributes cache
- [_statusAttributes release]; _statusAttributes = nil;
+ _statusAttributes = nil; @@ -215,10 +199,10 @@
lineBreakMode:NSLineBreakByTruncatingTail];
[paragraphStyle setMaximumLineHeight:(float)labelFontHeight];
- _statusAttributes = [[NSDictionary dictionaryWithObjectsAndKeys:
+ _statusAttributes = [NSDictionary dictionaryWithObjectsAndKeys: paragraphStyle, NSParagraphStyleAttributeName,
[self statusColor], NSForegroundColorAttributeName,
- [self statusFont], NSFontAttributeName,nil] retain];
+ [self statusFont], NSFontAttributeName,nil]; if (backgroundColorIsEvents && [listObject boolValueForProperty:@"isEvent"]) {
@@ -228,7 +212,7 @@
[mutableStatusAttributes setObject:[self textColor]
forKey:NSForegroundColorAttributeName];
- return [mutableStatusAttributes autorelease];
+ return mutableStatusAttributes; return _statusAttributes;
@@ -249,7 +233,7 @@
- (void)setTextAlignment:(NSTextAlignment)inAlignment
[super setTextAlignment:inAlignment];
- [_statusAttributes release]; _statusAttributes = nil;
+ _statusAttributes = nil; @@ -626,8 +610,6 @@
drawRect.origin.y + half + offset,
drawRect.size.height - (half + offset))];
rect.origin.y -= halfHeight;
--- a/Frameworks/Adium Framework/Source/AIListContactGroupChatCell.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIListContactGroupChatCell.h Sun Sep 09 12:24:39 2012 -0400
@@ -21,6 +21,6 @@
-@property (readwrite, retain, nonatomic) AIChat *chat;
+@property (readwrite, nonatomic) AIChat *chat; --- a/Frameworks/Adium Framework/Source/AIListContactGroupChatCell.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIListContactGroupChatCell.m Sun Sep 09 12:24:39 2012 -0400
@@ -22,11 +22,6 @@
@implementation AIListContactGroupChatCell
- (NSString *)labelString
--- a/Frameworks/Adium Framework/Source/AIListContactMockieCell.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIListContactMockieCell.m Sun Sep 09 12:24:39 2012 -0400
@@ -37,18 +37,11 @@
- (id)copyWithZone:(NSZone *)zone
AIListContactMockieCell *newCell = [super copyWithZone:zone];
- newCell->lastBackgroundBezierPath = [lastBackgroundBezierPath retain];
+ newCell->lastBackgroundBezierPath = lastBackgroundBezierPath;
- [lastBackgroundBezierPath release]; lastBackgroundBezierPath = nil;
//Draw the background of our cell
- (NSBezierPath *)bezierPathForDrawingInRect:(NSRect)rect
@@ -91,8 +84,7 @@
labelColor = [self labelColor];
[(labelColor ? labelColor : [self backgroundColor]) set];
- [lastBackgroundBezierPath release];
- lastBackgroundBezierPath = [[self bezierPathForDrawingInRect:rect] retain];
+ lastBackgroundBezierPath = [self bezierPathForDrawingInRect:rect]; if (lastBackgroundBezierPath)
[lastBackgroundBezierPath fill];
@@ -107,11 +99,10 @@
if ([self cellIsSelected]) {
NSColor *highlightColor = [controlView highlightColor];
NSGradient *gradient = (highlightColor ?
- [[[NSGradient alloc] initWithStartingColor:highlightColor endingColor:[highlightColor darkenAndAdjustSaturationBy:0.4f]] autorelease] :
+ [[NSGradient alloc] initWithStartingColor:highlightColor endingColor:[highlightColor darkenAndAdjustSaturationBy:0.4f]] : [NSGradient selectedControlGradient]);
- [lastBackgroundBezierPath release];
- lastBackgroundBezierPath = [[self bezierPathForDrawingInRect:cellFrame] retain];
+ lastBackgroundBezierPath = [self bezierPathForDrawingInRect:cellFrame]; if (lastBackgroundBezierPath)
[gradient drawInBezierPath:lastBackgroundBezierPath angle:90.0f];
--- a/Frameworks/Adium Framework/Source/AIListGroup.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIListGroup.h Sun Sep 09 12:24:39 2012 -0400
@@ -41,6 +41,6 @@
@property (readonly, nonatomic) NSUInteger visibleCount;
-@property (readonly, nonatomic) AIContactList *contactList;
+@property (weak, readonly, nonatomic) AIContactList *contactList; --- a/Frameworks/Adium Framework/Source/AIListGroup.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIListGroup.m Sun Sep 09 12:24:39 2012 -0400
@@ -51,14 +51,8 @@
- [_visibleObjects release]; _visibleObjects = nil;
- [_containedObjects release]; _containedObjects = nil;
[[AIContactObserverManager sharedManager] unregisterListObjectObserver:self];
[[NSNotificationCenter defaultCenter] removeObserver:self];
- [countText release]; countText = nil;
/* An object ID generated by Adium that is shared by all objects which are, to most intents and purposes, identical to
@@ -68,7 +62,7 @@
- (NSString *)internalObjectID
- internalObjectID = [[AIListObject internalObjectIDForServiceID:@"Group" UID:self.UID] retain];
+ internalObjectID = [AIListObject internalObjectIDForServiceID:@"Group" UID:self.UID]; @@ -126,8 +120,6 @@
[[AIProxyListObject existingProxyListObjectForListObject:obj inListObject:self] flushCache];
[AIUserIcons flushCacheForObject:obj];
- [oldVisibleObjects release];
- (NSSet *)updateListObject:(AIListObject *)inObject keys:(NSSet *)inModifiedKeys silent:(BOOL)silent
@@ -196,12 +188,12 @@
#pragma mark Object Storage
- (NSArray *)visibleContainedObjects
- return [[_visibleObjects copy] autorelease];
+ return [_visibleObjects copy]; - (NSArray *)containedObjects
- return [[_containedObjects copy] autorelease];
+ return [_containedObjects copy]; - (NSUInteger)countOfContainedObjects
@@ -288,7 +280,6 @@
AIListContact *contact = (AIListContact *)inObject;
if ([_visibleObjects containsObject:contact])
[_visibleObjects removeObject:contact];
if ([contact.groups containsObject:self])
@@ -297,7 +288,6 @@
[self didModifyProperties:[NSSet setWithObjects:@"VisibleObjectCount", @"ObjectCount", nil] silent:NO];
@@ -305,13 +295,11 @@
NSParameterAssert([self canContainObject:inObject]);
if ([_visibleObjects containsObject:inObject])
[_visibleObjects removeObject:inObject];
[(AIListContact *)inObject removeContainingGroup:self];
[_containedObjects removeObject:inObject];
[self didModifyProperties:[NSSet setWithObjects:@"VisibleObjectCount", @"ObjectCount", nil] silent:NO];
@@ -358,7 +346,7 @@
-- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id *)stackbuf count:(NSUInteger)len
+- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(__unsafe_unretained id [])stackbuf count:(NSUInteger)len return [self.containedObjects countByEnumeratingWithState:state objects:stackbuf count:len];
@@ -368,10 +356,10 @@
- (NSScriptObjectSpecifier *)objectSpecifier
NSScriptClassDescription *containerClassDesc = (NSScriptClassDescription *)[NSScriptClassDescription classDescriptionForClass:[NSApp class]];
- return [[[NSNameSpecifier alloc]
+ return [[NSNameSpecifier alloc] initWithContainerClassDescription:containerClassDesc
containerSpecifier:nil key:@"contactGroups"
- name:self.UID] autorelease];
--- a/Frameworks/Adium Framework/Source/AIListGroupBubbleCell.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIListGroupBubbleCell.m Sun Sep 09 12:24:39 2012 -0400
@@ -75,7 +75,7 @@
if ([self cellIsSelected]) {
NSColor *highlightColor = [controlView highlightColor];
NSGradient *gradient = (highlightColor ?
- [[[NSGradient alloc] initWithStartingColor:highlightColor endingColor:[highlightColor darkenAndAdjustSaturationBy:0.4f]] autorelease] :
+ [[NSGradient alloc] initWithStartingColor:highlightColor endingColor:[highlightColor darkenAndAdjustSaturationBy:0.4f]] : [NSGradient selectedControlGradient]);
[gradient drawInBezierPath:[NSBezierPath bezierPathWithRoundedRect:[self bubbleRectForFrame:cellFrame]] angle:270.0f];
--- a/Frameworks/Adium Framework/Source/AIListGroupBubbleToFitCell.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIListGroupBubbleToFitCell.m Sun Sep 09 12:24:39 2012 -0400
@@ -31,8 +31,8 @@
if ([listObject boolValueForProperty:@"showCount"] &&
(countText = [listObject valueForProperty:@"countText"])) {
- return [[[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@ (%@)", [self labelString], countText]
- attributes:[self labelAttributes]] autorelease];
+ return [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@ (%@)", [self labelString], countText] + attributes:[self labelAttributes]]; return super.displayName;
@@ -55,7 +55,6 @@
NSAttributedString *countText = [[NSAttributedString alloc] initWithString:@" ()"
attributes:[self labelAttributes]];
width += AIceil([countText size].width);
--- a/Frameworks/Adium Framework/Source/AIListGroupCell.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIListGroupCell.m Sun Sep 09 12:24:39 2012 -0400
@@ -16,6 +16,7 @@
#import <Adium/AIListGroupCell.h>
#import <Adium/AIListOutlineView.h>
+#import <Adium/AIListObject.h> #import <Adium/ESObjectWithProperties.h>
#import <AIUtilities/AIColorAdditions.h>
#import <AIUtilities/AIGradientAdditions.h>
@@ -31,11 +32,11 @@
AIListGroupCell *newCell = [super copyWithZone:zone];
- newCell->shadowColor = [shadowColor retain];
- newCell->backgroundColor = [backgroundColor retain];
- newCell->gradientColor = [gradientColor retain];
- newCell->_gradient = [_gradient retain];
- newCell->layoutManager = [layoutManager retain];
+ newCell->shadowColor = shadowColor; + newCell->backgroundColor = backgroundColor; + newCell->gradientColor = gradientColor; + newCell->_gradient = _gradient; + newCell->layoutManager = layoutManager; newCell->drawsGradientEdges = drawsGradientEdges;
@@ -59,13 +60,7 @@
- [backgroundColor release];
- [gradientColor release];
- [layoutManager release];
[self flushGradientCache];
@@ -75,10 +70,9 @@
- (void)setShadowColor:(NSColor *)inColor
if (inColor != shadowColor) {
- shadowColor = [inColor retain];
- [labelAttributes release]; labelAttributes = nil;
- (NSColor *)shadowColor{
@@ -93,12 +87,10 @@
- (void)setBackgroundColor:(NSColor *)inBackgroundColor gradientColor:(NSColor *)inGradientColor
if (inBackgroundColor != backgroundColor) {
- [backgroundColor release];
- backgroundColor = [inBackgroundColor retain];
+ backgroundColor = inBackgroundColor; if (inGradientColor != gradientColor) {
- [gradientColor release];
- gradientColor = [inGradientColor retain];
+ gradientColor = inGradientColor; @@ -145,7 +137,6 @@
NSAttributedString *countText = [[NSAttributedString alloc] initWithString:[listObject valueForProperty:@"countText"]
attributes:[self labelAttributes]];
width += AIceil([countText size].width) + 1;
@@ -233,8 +224,6 @@
inRect.size.width -= countSize.width + GROUP_COUNT_PADDING;
@@ -271,7 +260,7 @@
labelAttributes = super.labelAttributes;
- NSShadow *textShadow = [[[NSShadow alloc] init] autorelease];
+ NSShadow *textShadow = [[NSShadow alloc] init]; [textShadow setShadowOffset:NSMakeSize(0.0f, -1.0f)];
[textShadow setShadowBlurRadius:2.0f];
@@ -283,8 +272,8 @@
static NSMutableParagraphStyle *leftParagraphStyleWithTruncatingMiddle = nil;
if (!leftParagraphStyleWithTruncatingMiddle) {
- leftParagraphStyleWithTruncatingMiddle = [[NSMutableParagraphStyle styleWithAlignment:NSLeftTextAlignment
- lineBreakMode:NSLineBreakByTruncatingMiddle] retain];
+ leftParagraphStyleWithTruncatingMiddle = [NSMutableParagraphStyle styleWithAlignment:NSLeftTextAlignment + lineBreakMode:NSLineBreakByTruncatingMiddle]; [leftParagraphStyleWithTruncatingMiddle setMaximumLineHeight:(float)labelFontHeight];
@@ -302,7 +291,6 @@
- (NSImage *)cachedGradient:(NSSize)inSize
if (!_gradient || !NSEqualSizes(inSize,_gradientSize)) {
_gradient = [[NSImage alloc] initWithSize:inSize];
@@ -346,13 +334,13 @@
//Group background gradient
- (NSGradient *)backgroundGradient
- return [[[NSGradient alloc] initWithStartingColor:backgroundColor endingColor:gradientColor] autorelease];
+ return [[NSGradient alloc] initWithStartingColor:backgroundColor endingColor:gradientColor]; - (void)flushGradientCache
- [_gradient release]; _gradient = nil;
--- a/Frameworks/Adium Framework/Source/AIListGroupMockieCell.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIListGroupMockieCell.m Sun Sep 09 12:24:39 2012 -0400
@@ -28,7 +28,7 @@
AIListGroupMockieCell *newCell = [super copyWithZone:zone];
for (int i = 0; i < NUMBER_OF_GROUP_STATES; i++) {
- newCell->_mockieGradient[i] = [_mockieGradient[i] retain];
+ newCell->_mockieGradient[i] = _mockieGradient[i]; @@ -51,7 +51,6 @@
[self flushGradientCache];
//Draw a regular mockie background for our cell if gradient background drawing is disabled
@@ -77,7 +76,7 @@
if ([self cellIsSelected]) {
NSColor *highlightColor = [controlView highlightColor];
NSGradient *gradient = (highlightColor ?
- [[[NSGradient alloc] initWithStartingColor:highlightColor endingColor:[highlightColor darkenAndAdjustSaturationBy:0.4f]] autorelease] :
+ [[NSGradient alloc] initWithStartingColor:highlightColor endingColor:[highlightColor darkenAndAdjustSaturationBy:0.4f]] : [NSGradient selectedControlGradient]);
if ([controlView isItemExpanded:proxyObject]) {
@@ -94,7 +93,6 @@
AIGroupState state = ([controlView isItemExpanded:proxyObject] ? AIGroupExpanded : AIGroupCollapsed);
if (!_mockieGradient[state] || !NSEqualSizes(inSize,_mockieGradientSize[state])) {
- [_mockieGradient[state] release];
_mockieGradient[state] = [[NSImage alloc] initWithSize:inSize];
_mockieGradientSize[state] = inSize;
@@ -110,7 +108,7 @@
- (void)flushGradientCache
for (int i = 0; i < NUMBER_OF_GROUP_STATES; i++) {
- [_mockieGradient[i] release]; _mockieGradient[i] = nil;
+ _mockieGradient[i] = nil; _mockieGradientSize[i] = NSMakeSize(0,0);
--- a/Frameworks/Adium Framework/Source/AIListObject.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIListObject.h Sun Sep 09 12:24:39 2012 -0400
@@ -85,7 +85,7 @@
@interface AIListObject : ESObjectWithProperties {
+ AIService *__weak service; NSString *internalObjectID;
@@ -123,8 +123,8 @@
//Identifying information
@property (readonly, nonatomic) NSString *UID;
-@property (readonly, assign, nonatomic) AIService *service;
-@property (readonly, nonatomic) NSString *internalObjectID;
+@property (readonly, weak, nonatomic) AIService *service; +@property (weak, readonly, nonatomic) NSString *internalObjectID; + (NSString *)internalObjectIDForServiceID:(NSString *)inServiceID UID:(NSString *)inUID;
@@ -132,31 +132,31 @@
//Not recommended for most uses. Use -groups and -metaContact instead unless you really need both
-@property (readonly, nonatomic) NSSet *containingObjects;
+@property (weak, readonly, nonatomic) NSSet *containingObjects; @property (readonly, copy, nonatomic) NSSet *groups;
- (void)removeContainingGroup:(AIListGroup *)group;
- (void)addContainingGroup:(AIListGroup *)group;
- (void)removeFromGroup:(AIListObject <AIContainingObject> *)group;
-@property (readonly, nonatomic) NSString *formattedUID;
+@property (weak, readonly, nonatomic) NSString *formattedUID; - (void)setFormattedUID:(NSString *)inFormattedUID notify:(NotifyTiming)notify;
-@property (readonly, nonatomic) NSString *longDisplayName;
+@property (weak, readonly, nonatomic) NSString *longDisplayName; - (void)setPreference:(id)value forKey:(NSString *)inKey group:(NSString *)groupName;
- (void)setPreferences:(NSDictionary *)prefs inGroup:(NSString *)group;
- (id)preferenceForKey:(NSString *)inKey group:(NSString *)groupName;
-@property (readonly, nonatomic) NSString *pathToPreferences;
+@property (weak, readonly, nonatomic) NSString *pathToPreferences; @property (readonly, nonatomic) BOOL online;
-@property (readonly, nonatomic) NSString *statusName;
+@property (weak, readonly, nonatomic) NSString *statusName; @property (readonly, nonatomic) AIStatusType statusType;
- (void)setStatusWithName:(NSString *)statusName statusType:(AIStatusType)statusType notify:(NotifyTiming)notify;
-@property (readonly, nonatomic) NSAttributedString *statusMessage;
-@property (readonly, nonatomic) NSString *statusMessageString;
+@property (weak, readonly, nonatomic) NSAttributedString *statusMessage; +@property (weak, readonly, nonatomic) NSString *statusMessageString; - (void)setStatusMessage:(NSAttributedString *)statusMessage notify:(NotifyTiming)notify;
- (void)setBaseAvailableStatusAndNotify:(NotifyTiming)notify;
@property (readonly, nonatomic) AIStatusSummary statusSummary;
@@ -167,22 +167,22 @@
@property (readonly, nonatomic) BOOL isMobile;
@property (readonly, nonatomic) BOOL isBlocked;
-@property (readwrite, nonatomic, retain) NSString *displayName;
+@property (readwrite, nonatomic, strong) NSString *displayName; -@property (readonly, nonatomic) NSString *phoneticName;
+@property (weak, readonly, nonatomic) NSString *phoneticName; -@property (readwrite, nonatomic, retain) NSString *notes;
+@property (readwrite, nonatomic, strong) NSString *notes; @property (readonly, nonatomic) NSInteger idleTime;
-@property (readonly, nonatomic) NSImage *userIcon;
-@property (readonly, nonatomic) NSImage *menuIcon;
-@property (readonly, nonatomic) NSImage *statusIcon;
-@property (readonly, nonatomic) NSData *userIconData;
+@property (unsafe_unretained, readonly, nonatomic) NSImage *userIcon; +@property (unsafe_unretained, readonly, nonatomic) NSImage *menuIcon; +@property (unsafe_unretained, readonly, nonatomic) NSImage *statusIcon; +@property (weak, readonly, nonatomic) NSData *userIconData; - (void)setUserIconData:(NSData *)inData;
//For use only by subclasses
-@property (readonly, nonatomic) NSImage *internalUserIcon;
+@property (unsafe_unretained, readonly, nonatomic) NSImage *internalUserIcon; //mutableOwnerArray delegate and methods
- (void)listObject:(AIListObject *)listObject mutableOwnerArray:(AIMutableOwnerArray *)inArray didSetObject:(id)anObject withOwner:(AIListObject *)inOwner priorityLevel:(float)priority;
--- a/Frameworks/Adium Framework/Source/AIListObject.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIListObject.m Sun Sep 09 12:24:39 2012 -0400
@@ -38,7 +38,7 @@
- (void)setupObservedValues;
- (void)updateOrderCache;
-@property (nonatomic, assign) AIService *service;
+@property (nonatomic, weak) AIService *service; @@ -58,7 +58,7 @@
if ((self = [super init])) {
m_groups = [[NSMutableSet alloc] initWithCapacity:1];
// Delay until the next run loop so bookmarks can instantiate their values first.
@@ -68,26 +68,6 @@
- [UID release]; UID = nil;
- [internalObjectID release]; internalObjectID = nil;
- [m_groups release]; m_groups = nil;
- [listObjectStatusMessage release]; listObjectStatusMessage = nil;
- [listStateIcon release]; listStateIcon = nil;
- [listStatusIcon release]; listStatusIcon = nil;
- [listObjectStatusType release]; listObjectStatusType = nil;
- [extendedStatus release]; extendedStatus = nil;
- [listObjectStatusName release]; listObjectStatusName = nil;
- [webKitUserIconPath release]; webKitUserIconPath = nil;
- (void)setupObservedValues
[self setValue:[self preferenceForKey:@"Visible" group:PREF_GROUP_ALWAYS_VISIBLE]
@@ -122,7 +102,7 @@
- (NSString *)internalObjectID
- internalObjectID = [[AIListObject internalObjectIDForServiceID:self.service.serviceID UID:self.UID] retain];
+ internalObjectID = [AIListObject internalObjectIDForServiceID:self.service.serviceID UID:self.UID]; @@ -171,7 +151,7 @@
#warning Very inefficient
- return [[m_groups copy] autorelease];
+ return [m_groups copy]; - (void) addContainingGroup:(AIListGroup *)inGroup
@@ -248,7 +228,7 @@
* Dropping between Away Contact and Offline Contact should make an Away Contact be > 120 but an Offline Contact be < 110.
* Only the sort controller knows the answer as to where this contact should be positioned in the end.
- AILogWithSignature(@"%@: Moving %@ into %@'s index %i using order index %f (between %@ and %@)",
+ AILogWithSignature(@"%@: Moving %@ into %@'s index %li using order index %f (between %@ and %@)", container, listObject, container.visibleContainedObjects, idx,
(nextHighest + nextLowest) / 2, nextObject, previousObject);
[container listObject: listObject didSetOrderIndex: (nextHighest + nextLowest) / 2];
@@ -664,7 +644,7 @@
NSDictionary *dict = [self preferenceForKey:@"OrderIndexDictionary"
group:PREF_GROUP_OBJECT_STATUS_CACHE];
- NSMutableDictionary *newDict = (dict ? [[dict mutableCopy] autorelease] : [NSMutableDictionary dictionary]);
+ NSMutableDictionary *newDict = (dict ? [dict mutableCopy] : [NSMutableDictionary dictionary]); // Sanity check - are we trying to assign infinity?
if (orderIndexForObject == INFINITY) {
@@ -808,7 +788,7 @@
- (NSString *)description
- return [NSString stringWithFormat:@"<%@:%x %@>",NSStringFromClass([self class]), self, self.internalObjectID];
+ return [NSString stringWithFormat:@"<%@:%p %@>",NSStringFromClass([self class]), self, self.internalObjectID]; @@ -833,7 +813,7 @@
- (NSTextStorage *)scriptingStatusMessage
- return [[[NSTextStorage alloc] initWithAttributedString:self.statusMessage] autorelease];
+ return [[NSTextStorage alloc] initWithAttributedString:self.statusMessage]; --- a/Frameworks/Adium Framework/Source/AIListOutlineView+Drawing.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIListOutlineView+Drawing.m Sun Sep 09 12:24:39 2012 -0400
@@ -137,8 +137,7 @@
- (void)setBackgroundImage:(NSImage *)inImage
if (backgroundImage != inImage) {
- [backgroundImage release];
- backgroundImage = [inImage retain];
+ backgroundImage = inImage; [backgroundImage setFlipped:YES];
@@ -157,8 +156,8 @@
backgroundOpacity = opacity;
//Reset all our opacity dependent values
- [_backgroundColorWithOpacity release]; _backgroundColorWithOpacity = nil;
- [_rowColorWithOpacity release]; _rowColorWithOpacity = nil;
+ _backgroundColorWithOpacity = nil; + _rowColorWithOpacity = nil; windowStyle = inWindowStyle;
@@ -190,9 +189,7 @@
- (void)setBackgroundColor:(NSColor *)inColor
if (backgroundColor != inColor) {
- [backgroundColor release];
- backgroundColor = [inColor retain];
- [_backgroundColorWithOpacity release];
+ backgroundColor = inColor; _backgroundColorWithOpacity = nil;
[self setNeedsDisplay:YES];
@@ -202,7 +199,7 @@
if (!_backgroundColorWithOpacity) {
CGFloat backgroundAlpha = ([backgroundColor alphaComponent] * backgroundOpacity);
- _backgroundColorWithOpacity = [[backgroundColor colorWithAlphaComponent:backgroundAlpha] retain];
+ _backgroundColorWithOpacity = [backgroundColor colorWithAlphaComponent:backgroundAlpha]; //Mockie and pillow lists always require a non-opaque window, other lists only require a non-opaque window when
//the user has requested transparency.
@@ -237,8 +234,7 @@
if (highlightColor != inColor) {
[self willChangeValueForKey:@"highlightColor"];
- [highlightColor release];
- highlightColor = [inColor retain];
+ highlightColor = inColor; [self didChangeValueForKey:@"highlightColor"];
[self setNeedsDisplay:YES];
@@ -252,9 +248,7 @@
- (void)setAlternatingRowColor:(NSColor *)color
- rowColor = [color retain];
- [_rowColorWithOpacity release];
_rowColorWithOpacity = nil;
@@ -265,7 +259,7 @@
if (!_rowColorWithOpacity) {
CGFloat rowAlpha = [rowColor alphaComponent];
- _rowColorWithOpacity = [[rowColor colorWithAlphaComponent:(rowAlpha * backgroundOpacity)] retain];
+ _rowColorWithOpacity = [rowColor colorWithAlphaComponent:(rowAlpha * backgroundOpacity)]; return _rowColorWithOpacity;
--- a/Frameworks/Adium Framework/Source/AIListOutlineView.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIListOutlineView.h Sun Sep 09 12:24:39 2012 -0400
@@ -57,10 +57,10 @@
@property (readonly, nonatomic) NSInteger desiredWidth;
-@property (readonly, nonatomic) AIListObject *listObject;
-@property (readonly, nonatomic) NSArray *arrayOfListObjects;
-@property (readonly, nonatomic) NSArray *arrayOfListObjectsWithGroups;
-@property (readonly, nonatomic) AIListContact *firstVisibleListContact;
+@property (weak, readonly, nonatomic) AIListObject *listObject; +@property (weak, readonly, nonatomic) NSArray *arrayOfListObjects; +@property (weak, readonly, nonatomic) NSArray *arrayOfListObjectsWithGroups; +@property (weak, readonly, nonatomic) AIListContact *firstVisibleListContact; --- a/Frameworks/Adium Framework/Source/AIListOutlineView.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIListOutlineView.m Sun Sep 09 12:24:39 2012 -0400
@@ -96,17 +96,8 @@
[adium.preferenceController unregisterPreferenceObserver:self];
- [backgroundImage release];
- [backgroundColor release];
- [_backgroundColorWithOpacity release];
- [highlightColor release];
- [_rowColorWithOpacity release];
[self unregisterDraggedTypes];
[[NSNotificationCenter defaultCenter] removeObserver:self];
- (void)preferencesChangedForGroup:(NSString *)group
--- a/Frameworks/Adium Framework/Source/AIManuallySetUserIconSource.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIManuallySetUserIconSource.m Sun Sep 09 12:24:39 2012 -0400
@@ -45,7 +45,7 @@
[AIUserIcons userIconSource:self
- didDetermineUserIcon:[[[NSImage alloc] initWithData:userIconData] autorelease]
+ didDetermineUserIcon:[[NSImage alloc] initWithData:userIconData] --- a/Frameworks/Adium Framework/Source/AIMessageEntryTextView.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIMessageEntryTextView.h Sun Sep 09 12:24:39 2012 -0400
@@ -34,7 +34,7 @@
NSAttributedString *string;
-@property (readwrite, retain, nonatomic) NSAttributedString *string;
+@property (readwrite, nonatomic) NSAttributedString *string; @@ -68,12 +68,12 @@
-@property (readwrite, assign, nonatomic) id<AIMessageEntryTextViewDelegate> delegate;
+@property (readwrite, unsafe_unretained, nonatomic) id<AIMessageEntryTextViewDelegate> delegate; @property (readwrite, nonatomic) BOOL clearOnEscape;
@property (readwrite, nonatomic) BOOL homeToStartOfLine;
-@property (readwrite, retain, nonatomic) NSView *associatedView;
+@property (readwrite, nonatomic) NSView *associatedView; - (void)setAttributedString:(NSAttributedString *)inAttributedString;
@@ -84,8 +84,8 @@
-@property (readwrite, retain, nonatomic) AIChat *chat;
-@property (readonly, nonatomic) AIListContact *listObject;
+@property (readwrite, nonatomic) AIChat *chat; +@property (weak, readonly, nonatomic) AIListContact *listObject; - (void)scrollPageUp:(id)sender;
--- a/Frameworks/Adium Framework/Source/AIMessageEntryTextView.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIMessageEntryTextView.m Sun Sep 09 12:24:39 2012 -0400
@@ -78,11 +78,6 @@
@implementation AISimpleTextView
- (void)drawRect:(NSRect)rect
@@ -202,15 +197,8 @@
[adium.preferenceController unregisterPreferenceObserver:self];
[[AIContactObserverManager sharedManager] unregisterListObjectObserver:self];
- [savedTextColor release];
- [characterCounter release];
- [characterCounterPrefix release];
- [associatedView release];
- [historyArray release]; historyArray = nil;
- [pushArray release]; pushArray = nil;
- (void) setDelegate:(id<AIMessageEntryTextViewDelegate>)del
@@ -366,8 +354,6 @@
[newTypingAttributes removeObjectForKey:NSLinkAttributeName];
[self setTypingAttributes:newTypingAttributes];
- [newTypingAttributes release];
@@ -380,7 +366,7 @@
NSUndoManager *undoManager = [self undoManager];
[undoManager registerUndoWithTarget:self
selector:@selector(setAttributedString:)
- object:[[[self textStorage] copy] autorelease]];
+ object:[[self textStorage] copy]]; [undoManager setActionName:AILocalizedString(@"Clear", nil)];
@@ -548,8 +534,6 @@
[self setTypingAttributes:attributes];
[self scrollRangeToVisible:[self selectedRange]];
@@ -606,7 +590,6 @@
NSString *string = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
attributedString = [[NSMutableAttributedString alloc] initWithString:string
attributes:[self typingAttributes]];
@@ -627,7 +610,6 @@
NSString *string = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
attributedString = [[NSMutableAttributedString alloc] initWithString:string
attributes:[self typingAttributes]];
@@ -660,7 +642,6 @@
//Notify that we changed our text
[[NSNotificationCenter defaultCenter] postNotificationName:NSTextDidChangeNotification
- [attributedString release];
} else if ([FILES_AND_IMAGES_TYPES containsObject:type] ||
[type isEqualToString:NSURLPboardType]) {
@@ -677,8 +658,6 @@
[self setTypingAttributes:attributes];
[self scrollRangeToVisible:[self selectedRange]];
@@ -706,8 +685,7 @@
[chat removeObserver:self forKeyPath:@"Character Counter Prefix"];
- chat = [inChat retain];
// We only need to update our observation state for group chats.
@@ -838,7 +816,7 @@
if (currentHistoryLocation == 0) {
- [historyArray replaceObjectAtIndex:0 withObject:[[[self textStorage] copy] autorelease]];
+ [historyArray replaceObjectAtIndex:0 withObject:[[self textStorage] copy]]; if (currentHistoryLocation < [historyArray count]-1) {
@@ -868,7 +846,7 @@
NSAttributedString *textStorage = [self textStorage];
//Add to history if there is text being sent
- [historyArray insertObject:[[textStorage copy] autorelease] atIndex:1];
+ [historyArray insertObject:[textStorage copy] atIndex:1]; if ([historyArray count] > MAX_HISTORY) {
[historyArray removeLastObject];
@@ -908,7 +886,7 @@
if ([[self textStorage] length] != 0 && pushPopEnabled) {
- [pushArray addObject:[[[self textStorage] copy] autorelease]];
+ [pushArray addObject:[[self textStorage] copy]]; [self _setPushIndicatorVisible:YES];
@@ -931,7 +909,7 @@
- NSAttributedString *tempMessage = [[[self textStorage] copy] autorelease];
+ NSAttributedString *tempMessage = [[self textStorage] copy]; @@ -952,7 +930,7 @@
static NSImage *pushIndicatorImage = nil;
- if (!pushIndicatorImage) pushIndicatorImage = [[NSImage imageNamed:@"stackImage" forClass:[self class]] retain];
+ if (!pushIndicatorImage) pushIndicatorImage = [NSImage imageNamed:@"stackImage" forClass:[self class]]; if (visible && !pushIndicatorVisible) {
pushIndicatorVisible = visible;
@@ -995,7 +973,7 @@
[pushIndicator removeFromSuperview];
- [pushIndicator release]; pushIndicator = nil;
[self positionPushIndicator];
@@ -1059,7 +1037,6 @@
[[NSNotificationCenter defaultCenter] removeObserver:self name:NSViewFrameDidChangeNotification object:[self superview]];
- [characterCounter release];
// Reposition the push indicator, if necessary.
@@ -1076,8 +1053,7 @@
- (void)setCharacterCounterPrefix:(NSString *)prefix
if(prefix != characterCounterPrefix) {
- [characterCounterPrefix release];
- characterCounterPrefix = [prefix retain];
+ characterCounterPrefix = prefix; @@ -1103,7 +1079,7 @@
NSInteger currentCount = (maxCharacters - [inputString length]);
if(maxCharacters && currentCount < 0) {
- savedTextColor = [[self textColor] retain];
+ savedTextColor = [self textColor]; [self setBackgroundColor:[NSColor colorWithCalibratedHue:0.983f
@@ -1124,7 +1100,7 @@
[self.enclosingScrollView setBackgroundColor:[NSColor controlBackgroundColor]];
- NSString *counterText = [NSString stringWithFormat:@"%d", currentCount];
+ NSString *counterText = [NSString stringWithFormat:@"%ld", currentCount]; if (characterCounterPrefix) {
counterText = [NSString stringWithFormat:@"%@%@", characterCounterPrefix, counterText];
@@ -1134,7 +1110,6 @@
attributes:[adium.contentController defaultFormattingAttributes]];
[characterCounter setString:label];
[characterCounter setFrameSize:label.size];
//Reposition the character counter.
[self positionCharacterCounter];
@@ -1207,7 +1182,7 @@
BOOL addedOurLinkItems = NO;
if ((contextualMenu = [super menuForEvent:theEvent])) {
- contextualMenu = [[contextualMenu copy] autorelease];
+ contextualMenu = [contextualMenu copy]; NSMenuItem *editLinkItem = nil;
for (NSMenuItem *menuItem in contextualMenu.itemArray) {
@@ -1226,13 +1201,13 @@
[NSNumber numberWithInt:Context_TextView_LinkEditing]]];
for (NSMenuItem *menuItem in linkItemsMenu.itemArray) {
- [contextualMenu insertItem:[[menuItem copy] autorelease] atIndex:editIndex++];
+ [contextualMenu insertItem:[menuItem copy] atIndex:editIndex++]; - contextualMenu = [[[NSMenu alloc] init] autorelease];
+ contextualMenu = [[NSMenu alloc] init]; //Retrieve the items which should be added to the bottom of the default menu
@@ -1249,7 +1224,7 @@
for (NSMenuItem *menuItem in itemsArray) {
//We're going to be copying; call menu needs update now since it won't be called later.
NSMenu *submenu = [menuItem submenu];
- NSMenuItem *menuItemCopy = [[menuItem copy] autorelease];
+ NSMenuItem *menuItemCopy = [menuItem copy]; if (submenu && [submenu respondsToSelector:@selector(delegate)]) {
[[menuItemCopy submenu] setDelegate:[submenu delegate]];
@@ -1367,7 +1342,6 @@
//The pasteboard contains image data with no corresponding file.
NSImage *image = [[NSImage alloc] initWithPasteboard:pasteboard];
[self addAttachmentOfImage:image];
@@ -1548,8 +1522,6 @@
//Insert an attributed string into the text at the current insertion point
[self insertText:[self attributedStringWithTextAttachmentExtension:attachment]];
@@ -1565,7 +1537,6 @@
//Insert an attributed string into the text at the current insertion point
[self insertText:[self attributedStringWithTextAttachmentExtension:attachment]];
@@ -1577,7 +1548,6 @@
[attachment setHasAlternate:NO];
[attachment setAttachmentCell:cell];
return [NSAttributedString attributedStringWithAttachment:attachment];
@@ -1587,13 +1557,13 @@
- (NSAttributedString *)attributedStringWithAITextAttachmentExtensionsFromRTFDData:(NSData *)data
- NSMutableAttributedString *attributedString = [[[NSMutableAttributedString alloc] initWithRTFD:data
- documentAttributes:NULL] autorelease];
+ NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithRTFD:data + documentAttributes:NULL]; if ([attributedString length] && [attributedString containsAttachments]) {
NSUInteger currentLocation = 0;
- NSString *attachmentCharacterString = [NSString stringWithFormat:@"%C",NSAttachmentCharacter];
+ NSString *attachmentCharacterString = [NSString stringWithFormat:@"%C",(unichar)NSAttachmentCharacter]; attachmentRange = [[attributedString string] rangeOfString:attachmentCharacterString
@@ -1631,7 +1601,6 @@
//Insert an attributed string into the text at the current insertion point
replacement = [self attributedStringWithTextAttachmentExtension:textAttachment];
- [textAttachment release];
//Remove the NSTextAttachment, replacing it the AITextAttachmentExtension
[attributedString replaceCharactersInRange:attachmentRange
@@ -1670,7 +1639,6 @@
[typingAttributes setObject:backgroundColor forKey:AIBodyColorAttributeName];
[typingAttributes setObject:backgroundColor forKey:NSBackgroundColorAttributeName];
[self setTypingAttributes:typingAttributes];
- [typingAttributes release];
[[self textStorage] edited:NSTextStorageEditedAttributes
--- a/Frameworks/Adium Framework/Source/AIMetaContact.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIMetaContact.h Sun Sep 09 12:24:39 2012 -0400
@@ -40,7 +40,7 @@
@property (readonly, nonatomic) NSNumber *objectID;
+ (NSString *)internalObjectIDFromObjectID:(NSNumber *)inObjectID;
-@property (readonly, nonatomic) AIListContact *preferredContact;
+@property (weak, readonly, nonatomic) AIListContact *preferredContact; - (AIListContact *)preferredContactWithCompatibleService:(AIService *)inService;
- (void)updateRemoteGroupingOfContact:(AIListContact *)inListContact;
@@ -49,8 +49,8 @@
@property (readonly, nonatomic) NSUInteger uniqueContainedObjectsCount;
- (AIListObject *)uniqueObjectAtIndex:(int)inIndex;
-@property (readonly, nonatomic) NSDictionary *dictionaryOfServiceClassesAndListContacts;
-@property (readonly, nonatomic) NSArray *servicesOfContainedObjects;
+@property (weak, readonly, nonatomic) NSDictionary *dictionaryOfServiceClassesAndListContacts; +@property (weak, readonly, nonatomic) NSArray *servicesOfContainedObjects; * @brief A flat array of AIListContacts each with a different internalObjectID
--- a/Frameworks/Adium Framework/Source/AIMetaContact.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIMetaContact.m Sun Sep 09 12:24:39 2012 -0400
@@ -46,7 +46,7 @@
- (void)updateDisplayName;
-@property (readonly, nonatomic) NSArray *visibleListContacts;
+@property (weak, readonly, nonatomic) NSArray *visibleListContacts; + (NSArray *)_forwardedProperties;
@@ -58,7 +58,7 @@
- (id)initWithObjectID:(NSNumber *)inObjectID
if ((self = [super initWithUID:[inObjectID stringValue] service:nil])) {
- objectID = [inObjectID retain];
_listContactsIncludingOfflineAccounts = nil;
@@ -74,17 +74,10 @@
//I've seen a crashlog with a delayed -updateDisplayName causing crashes due to a freed AIMetaContact, so let's cancel any pending updates
[[NSRunLoop currentRunLoop] cancelPerformSelectorsWithTarget:self];
- [_containedObjects release]; _containedObjects = nil;
- [_listContacts release]; _listContacts = nil;
- [_listContactsIncludingOfflineAccounts release]; _listContactsIncludingOfflineAccounts = nil;
@@ -92,7 +85,7 @@
- (NSString *)internalObjectID
- internalObjectID = [[AIMetaContact internalObjectIDFromObjectID:objectID] retain];
+ internalObjectID = [AIMetaContact internalObjectIDFromObjectID:objectID]; @@ -237,8 +230,8 @@
- (void)containedObjectsOrOrderDidChange
- [_listContacts release]; _listContacts = nil;
- [_listContactsIncludingOfflineAccounts release]; _listContactsIncludingOfflineAccounts = nil;
+ _listContactsIncludingOfflineAccounts = nil; //Our effective icon may have changed
[AIUserIcons flushCacheForObject:self];
@@ -300,8 +293,6 @@
if ([self.containedObjects containsObjectIdenticalTo:inObject]) {
BOOL needToResetToRemoteGroup = NO;
BOOL wasPreferredContact = (inObject == self.preferredContact);
[_containedObjects removeObject:inObject];
@@ -342,8 +333,6 @@
if (needToResetToRemoteGroup) {
[(AIListContact *)inObject restoreGrouping];
@@ -356,7 +345,6 @@
NSParameterAssert([inObject isKindOfClass:[AIListContact class]]);
AIListContact *contact = (AIListContact *)inObject;
[_containedObjects removeObject:inObject];
contact.metaContact = nil;
@@ -366,7 +354,6 @@
if (self.countOfContainedObjects == 0)
[adium.contactController _moveContactLocally:self fromGroups:self.groups toGroups:[NSSet set]];
- (AIListContact *)preferredContactForContentType:(NSString *)inType
@@ -496,7 +483,7 @@
- (NSArray *)uniqueContainedObjects
- _listContacts = [[self uniqueContainedListContactsIncludingOfflineAccounts:NO visibleOnly:NO] retain];
+ _listContacts = [self uniqueContainedListContactsIncludingOfflineAccounts:NO visibleOnly:NO]; @@ -521,7 +508,7 @@
- (NSArray *)listContactsIncludingOfflineAccounts
if (!_listContactsIncludingOfflineAccounts) {
- _listContactsIncludingOfflineAccounts = [[self uniqueContainedListContactsIncludingOfflineAccounts:YES visibleOnly:NO] retain];
+ _listContactsIncludingOfflineAccounts = [self uniqueContainedListContactsIncludingOfflineAccounts:YES visibleOnly:NO]; return _listContactsIncludingOfflineAccounts;
@@ -561,7 +548,7 @@
if (![services containsObject:listObject.service]) [services addObject:listObject.service];
- return [services autorelease];
- (NSUInteger)uniqueContainedObjectsCount
@@ -607,7 +594,7 @@
- return [listContacts autorelease];
- (BOOL)containsOnlyOneService
@@ -966,10 +953,10 @@
//Sort the containedObjects if the flag tells us it's needed
if (containedObjectsNeedsSort) {
containedObjectsNeedsSort = NO;
- [_containedObjects sortUsingFunction:containedContactSort context:self];
+ [_containedObjects sortUsingFunction:containedContactSort context:(__bridge void *)(self)]; - return [[_containedObjects copy] autorelease];
+ return [_containedObjects copy]; - (NSUInteger)countOfContainedObjects
@@ -1038,7 +1025,7 @@
[self containedObjectsOrOrderDidChange];
-- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id *)stackbuf count:(NSUInteger)len
+- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(__unsafe_unretained id [])stackbuf count:(NSUInteger)len return [self.containedObjects countByEnumeratingWithState:state objects:stackbuf count:len];
@@ -1050,8 +1037,8 @@
NSComparisonResult containedContactSort(AIListContact *objectA, AIListContact *objectB, void *context)
- float orderIndexA = [(AIMetaContact *)context orderIndexForObject:objectA];
- float orderIndexB = [(AIMetaContact *)context orderIndexForObject:objectB];
+ float orderIndexA = [(__bridge AIMetaContact *)context orderIndexForObject:objectA]; + float orderIndexB = [(__bridge AIMetaContact *)context orderIndexForObject:objectB]; if (orderIndexA > orderIndexB) {
return NSOrderedDescending;
@@ -1095,9 +1082,8 @@
[subobjectDescs addObject:[subobject description]];
NSString *subobjectDescsDesc = [subobjectDescs description];
- [subobjectDescs release];
- return [NSString stringWithFormat:@"<%@:%x %@: %@>",NSStringFromClass([self class]), self, self.internalObjectID, subobjectDescsDesc];
+ return [NSString stringWithFormat:@"<%@:%p %@: %@>",NSStringFromClass([self class]), self, self.internalObjectID, subobjectDescsDesc]; - (BOOL) canContainObject:(id)obj
--- a/Frameworks/Adium Framework/Source/AIModularPane.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIModularPane.m Sun Sep 09 12:24:39 2012 -0400
@@ -21,13 +21,13 @@
//Return a new modular pane
+ (AIModularPane *)modularPane
- return [[[self alloc] init] autorelease];
+ return [[self alloc] init]; //Return a new modular pane, passing plugin
+ (AIModularPane *)modularPaneForPlugin:(id)inPlugin
- return [[[self alloc] initForPlugin:inPlugin] autorelease];
+ return [[self alloc] initForPlugin:inPlugin]; @@ -73,7 +73,7 @@
- [view release]; view = nil;
--- a/Frameworks/Adium Framework/Source/AIPathUtilities.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIPathUtilities.m Sun Sep 09 12:24:39 2012 -0400
@@ -142,5 +142,5 @@
- return [dirs autorelease];
--- a/Frameworks/Adium Framework/Source/AIPreferencePane.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIPreferencePane.m Sun Sep 09 12:24:39 2012 -0400
@@ -23,13 +23,13 @@
//Return a new preference pane
+ (AIPreferencePane *)preferencePane
- return [[[self alloc] init] autorelease];
+ return [[self alloc] init]; //Return a new preference pane, passing plugin
+ (AIPreferencePane *)preferencePaneForPlugin:(id)inPlugin
- return [[[self alloc] initForPlugin:inPlugin] autorelease];
+ return [[self alloc] initForPlugin:inPlugin]; @@ -41,11 +41,6 @@
+ (NSArray *)preferencePanes
--- a/Frameworks/Adium Framework/Source/AIProxyListObject.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIProxyListObject.h Sun Sep 09 12:24:39 2012 -0400
@@ -18,8 +18,8 @@
@protocol AIContainingObject;
@interface AIProxyListObject : NSObject {
- AIListObject *listObject;
- ESObjectWithProperties <AIContainingObject> *containingObject;
+ AIListObject *__weak listObject; + ESObjectWithProperties <AIContainingObject> *__weak containingObject; NSString *cachedDisplayNameString;
NSAttributedString *cachedDisplayName;
@@ -27,14 +27,14 @@
NSSize cachedDisplayNameSize;
@property (nonatomic, copy) NSDictionary *cachedLabelAttributes;
-@property (nonatomic, retain) NSString *cachedDisplayNameString;
-@property (nonatomic, retain) NSAttributedString *cachedDisplayName;
+@property (nonatomic, strong) NSString *cachedDisplayNameString; +@property (nonatomic, strong) NSAttributedString *cachedDisplayName; @property (nonatomic) NSSize cachedDisplayNameSize;
-@property (nonatomic, retain) NSString *key;
+@property (nonatomic, strong) NSString *key; -@property (nonatomic, assign) AIListObject *listObject;
-@property (nonatomic, assign) ESObjectWithProperties <AIContainingObject> * containingObject;
+@property (nonatomic, weak) AIListObject *listObject; +@property (nonatomic, weak) ESObjectWithProperties <AIContainingObject> * containingObject; + (AIProxyListObject *)proxyListObjectForListObject:(ESObjectWithProperties *)inListObject
inListObject:(ESObjectWithProperties<AIContainingObject> *)containingObject;
--- a/Frameworks/Adium Framework/Source/AIProxyListObject.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIProxyListObject.m Sun Sep 09 12:24:39 2012 -0400
@@ -76,7 +76,6 @@
[inListObject noteProxyObject:proxy];
[proxyDict setObject:proxy
@@ -96,7 +95,6 @@
+ (void)releaseProxyObject:(AIProxyListObject *)proxyObject
- [[proxyObject retain] autorelease];
proxyObject.listObject = nil;
[proxyObject flushCache];
[proxyDict removeObjectForKey:proxyObject.key];
@@ -105,11 +103,8 @@
AILogWithSignature(@"%@", self);
/* Pretend to be our listObject. I suspect being an NSProxy subclass could do this more cleanly, but my initial attempt
--- a/Frameworks/Adium Framework/Source/AIServersideUserIconSource.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIServersideUserIconSource.m Sun Sep 09 12:24:39 2012 -0400
@@ -76,7 +76,7 @@
[AIUserIcons userIconSource:self
- didDetermineUserIcon:[[[NSImage alloc] initWithData:iconData] autorelease]
+ didDetermineUserIcon:[[NSImage alloc] initWithData:iconData] --- a/Frameworks/Adium Framework/Source/AIService.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIService.h Sun Sep 09 12:24:39 2012 -0400
@@ -38,30 +38,30 @@
- (id)accountWithUID:(NSString *)inUID internalObjectID:(NSString *)inInternalObjectID;
-@property (readonly, nonatomic) Class accountClass;
-@property (readonly, nonatomic) AIAccountViewController *accountViewController;
-@property (readonly, nonatomic) DCJoinChatViewController *joinChatView;
+@property (unsafe_unretained, readonly, nonatomic) Class accountClass; +@property (weak, readonly, nonatomic) AIAccountViewController *accountViewController; +@property (unsafe_unretained, readonly, nonatomic) DCJoinChatViewController *joinChatView; -@property (readonly, nonatomic) NSString *serviceCodeUniqueID;
-@property (readonly, nonatomic) NSString *serviceID;
-@property (readonly, nonatomic) NSString *serviceClass;
-@property (readonly, nonatomic) NSString *shortDescription;
-@property (readonly, nonatomic) NSString *longDescription;
-@property (readonly, nonatomic) NSString *userNameLabel;
-@property (readonly, nonatomic) NSString *contactUserNameLabel;
-@property (readonly, nonatomic) NSString *UIDPlaceholder;
-@property (readonly, nonatomic) NSURL *serviceAccountSetupURL;
-@property (readonly, nonatomic) NSString *accountSetupLabel;
+@property (weak, readonly, nonatomic) NSString *serviceCodeUniqueID; +@property (weak, readonly, nonatomic) NSString *serviceID; +@property (weak, readonly, nonatomic) NSString *serviceClass; +@property (weak, readonly, nonatomic) NSString *shortDescription; +@property (weak, readonly, nonatomic) NSString *longDescription; +@property (weak, readonly, nonatomic) NSString *userNameLabel; +@property (weak, readonly, nonatomic) NSString *contactUserNameLabel; +@property (weak, readonly, nonatomic) NSString *UIDPlaceholder; +@property (weak, readonly, nonatomic) NSURL *serviceAccountSetupURL; +@property (weak, readonly, nonatomic) NSString *accountSetupLabel; @property (readonly, nonatomic) AIServiceImportance serviceImportance;
- (NSImage *)defaultServiceIconOfType:(AIServiceIconType)iconType;
- (NSString *)pathForDefaultServiceIconOfType:(AIServiceIconType)iconType;
-@property (readonly, nonatomic) NSCharacterSet *allowedCharacters;
-@property (readonly, nonatomic) NSCharacterSet *allowedCharactersForUIDs;
-@property (readonly, nonatomic) NSCharacterSet *allowedCharactersForAccountName;
-@property (readonly, nonatomic) NSCharacterSet *ignoredCharacters;
+@property (weak, readonly, nonatomic) NSCharacterSet *allowedCharacters; +@property (weak, readonly, nonatomic) NSCharacterSet *allowedCharactersForUIDs; +@property (weak, readonly, nonatomic) NSCharacterSet *allowedCharactersForAccountName; +@property (weak, readonly, nonatomic) NSCharacterSet *ignoredCharacters; @property (readonly, nonatomic) NSUInteger allowedLength;
@property (readonly, nonatomic) NSUInteger allowedLengthForUIDs;
@property (readonly, nonatomic) NSUInteger allowedLengthForAccountName;
@@ -72,7 +72,7 @@
@property (readonly, nonatomic) BOOL supportsPassword;
@property (readonly, nonatomic) BOOL requiresPassword;
@property (readonly, nonatomic) BOOL isSocialNetworkingService;
-@property (readonly, nonatomic) NSString *defaultUserName;
+@property (weak, readonly, nonatomic) NSString *defaultUserName; @property (readonly, nonatomic) BOOL isHidden;
--- a/Frameworks/Adium Framework/Source/AIService.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIService.m Sun Sep 09 12:24:39 2012 -0400
@@ -32,7 +32,7 @@
- [[[self alloc] init] autorelease];
+ (void)[[self alloc] init]; @@ -64,9 +64,9 @@
- (id)accountWithUID:(NSString *)inUID internalObjectID:(NSString *)inInternalObjectID
- return [[[[self accountClass] alloc] initWithUID:[self normalizeUID:inUID removeIgnoredCharacters:YES]
+ return [[[self accountClass] alloc] initWithUID:[self normalizeUID:inUID removeIgnoredCharacters:YES] internalObjectID:inInternalObjectID
- service:self] autorelease];
@@ -515,7 +515,7 @@
/* If all characters are allowed, and we're either not removing ignored characters OR there are none, no change
if (!allowedCharacters && (!removeIgnored || !ignoredCharacters))
- return [[inUID copy] autorelease];
//Prepare a little buffer for our filtered UID
NSUInteger destLength = 0;
@@ -572,7 +572,7 @@
- NSMutableArray *accountsForThisService = [[[NSMutableArray alloc] init] autorelease];
+ NSMutableArray *accountsForThisService = [[NSMutableArray alloc] init]; for (AIAccount *account in adium.accountController.accounts) {
if (account.service == self)
[accountsForThisService addObject:account];
@@ -586,10 +586,10 @@
- (NSScriptObjectSpecifier *)objectSpecifier
NSScriptClassDescription *containerClassDesc = (NSScriptClassDescription *)[NSScriptClassDescription classDescriptionForClass:[NSApp class]];
- return [[[NSNameSpecifier alloc]
+ return [[NSNameSpecifier alloc] initWithContainerClassDescription:containerClassDesc
containerSpecifier:nil key:@"services"
- name:self.serviceID] autorelease];
--- a/Frameworks/Adium Framework/Source/AIServiceIcons.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIServiceIcons.m Sun Sep 09 12:24:39 2012 -0400
@@ -100,14 +100,13 @@
AIService *service = [adium.accountController firstServiceWithServiceID:serviceID];
- serviceIcon = [[service defaultServiceIconOfType:iconType] retain];
+ serviceIcon = [service defaultServiceIconOfType:iconType]; if (iconDirection == AIIconFlipped) [serviceIcon setFlipped:YES];
[serviceIcons[iconType][iconDirection] setObject:serviceIcon forKey:serviceID];
//Attempt to load the default service icon
serviceIcon = [self defaultServiceIconForType:iconType serviceID:serviceID];
@@ -128,17 +127,13 @@
NSDictionary *serviceIconDict = [NSDictionary dictionaryWithContentsOfFile:[inPath stringByAppendingPathComponent:@"Icons.plist"]];
if (serviceIconDict && [[serviceIconDict objectForKey:@"AdiumSetVersion"] intValue] == 1) {
- [serviceIconBasePath release];
- serviceIconBasePath = [inPath retain];
+ serviceIconBasePath = inPath; - [serviceIconNames[AIServiceIconSmall] release];
- serviceIconNames[AIServiceIconSmall] = [[serviceIconDict objectForKey:@"Interface-Small"] retain];
+ serviceIconNames[AIServiceIconSmall] = [serviceIconDict objectForKey:@"Interface-Small"]; - [serviceIconNames[AIServiceIconLarge] release];
- serviceIconNames[AIServiceIconLarge] = [[serviceIconDict objectForKey:@"Interface-Large"] retain];
+ serviceIconNames[AIServiceIconLarge] = [serviceIconDict objectForKey:@"Interface-Large"]; - [serviceIconNames[AIServiceIconList] release];
- serviceIconNames[AIServiceIconList] = [[serviceIconDict objectForKey:@"List"] retain];
+ serviceIconNames[AIServiceIconList] = [serviceIconDict objectForKey:@"List"]; //Clear out the service icon cache
@@ -180,7 +175,7 @@
NSString *anIconPath = [inPath stringByAppendingPathComponent:[previewIconNames objectForKey:iconID]];
- if ((anIcon = [[[NSImage alloc] initWithContentsOfFile:anIconPath] autorelease])) {
+ if ((anIcon = [[NSImage alloc] initWithContentsOfFile:anIconPath])) { NSSize anIconSize = [anIcon size];
NSRect targetRect = NSMakeRect(xOrigin, 0, PREVIEW_MENU_IMAGE_SIZE, PREVIEW_MENU_IMAGE_SIZE);
@@ -210,7 +205,7 @@
- return [image autorelease];
#pragma mark Default loading
@@ -255,7 +250,7 @@
if ((thisServiceIconImageName = [defaultServiceIconNames objectForKey:serviceID])) {
NSString *iconPath = [defaultPath stringByAppendingPathComponent:thisServiceIconImageName];
- defaultServiceIcon = [[[NSImage alloc] initWithContentsOfFile:iconPath] autorelease];
+ defaultServiceIcon = [[NSImage alloc] initWithContentsOfFile:iconPath]; --- a/Frameworks/Adium Framework/Source/AISharedAdium.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AISharedAdium.m Sun Sep 09 12:24:39 2012 -0400
@@ -27,5 +27,5 @@
NSCAssert(adium == nil, @"Attempt to set the shared AIAdium instance after it's already been set");
NSCParameterAssert(shared != nil);
- adium = [shared retain];
--- a/Frameworks/Adium Framework/Source/AISocialNetworkingStatusMenu.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AISocialNetworkingStatusMenu.m Sun Sep 09 12:24:39 2012 -0400
@@ -18,6 +18,7 @@
#import "AICustomSocialNetworkingStatusWindowController.h"
#import <Adium/AIAccount.h>
#import <Adium/AIService.h>
+#import <Adium/AIStatus.h> #import <Adium/AIAccountControllerProtocol.h>
#import <Adium/AIContentControllerProtocol.h>
#import <Adium/AIStatusControllerProtocol.h>
@@ -47,7 +48,7 @@
representedObject:inAccount];
- return [menu autorelease];
+ (NSMenuItem *)socialNetworkingSubmenuItem
@@ -58,7 +59,7 @@
[menuItem setSubmenu:[self socialNetworkingSubmenuForAccount:nil]];
- return [menuItem autorelease];
+ (void)showCustomSocialNetworkingStatusWindow:(NSMenuItem *)sender
--- a/Frameworks/Adium Framework/Source/AISortController.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AISortController.h Sun Sep 09 12:24:39 2012 -0400
@@ -20,7 +20,7 @@
typedef NSComparisonResult(*sortfunc)(id, id, BOOL, id<AIContainingObject>);
- id<AIContainingObject> container;
+__unsafe_unretained id<AIContainingObject> container; #define PREF_GROUP_CONTACT_SORTING @"Sorting"
@@ -46,19 +46,19 @@
- (BOOL)shouldSortForModifiedAttributeKeys:(NSSet *)inModifiedKeys;
@property (readonly, nonatomic) BOOL alwaysSortGroupsToTopByDefault;
- (int)indexForInserting:(AIListObject *)inObject intoObjects:(NSArray *)inObjects inContainer:(id<AIContainingObject>)container;
-@property (readonly, nonatomic) NSView *configureView;
+@property (weak, readonly, nonatomic) NSView *configureView; - (void)forceIgnoringOfGroups:(BOOL)shouldForce;
@property (readonly, nonatomic) BOOL canSortManually;
//For subclasses to override
-@property (readonly, nonatomic) NSString *identifier;
-@property (readonly, nonatomic) NSString *displayName;
-@property (readonly, nonatomic) NSSet *statusKeysRequiringResort;
-@property (readonly, nonatomic) NSSet *attributeKeysRequiringResort;
+@property (weak, readonly, nonatomic) NSString *identifier; +@property (weak, readonly, nonatomic) NSString *displayName; +@property (weak, readonly, nonatomic) NSSet *statusKeysRequiringResort; +@property (weak, readonly, nonatomic) NSSet *attributeKeysRequiringResort; @property (readonly, nonatomic) sortfunc sortFunction;
-@property (readonly, nonatomic) NSString *configureSortMenuItemTitle;
-@property (readonly, nonatomic) NSString *configureSortWindowTitle;
-@property (readonly, nonatomic) NSString *configureNibName;
+@property (weak, readonly, nonatomic) NSString *configureSortMenuItemTitle; +@property (weak, readonly, nonatomic) NSString *configureSortWindowTitle; +@property (weak, readonly, nonatomic) NSString *configureNibName; - (IBAction)changePreference:(id)sender;
--- a/Frameworks/Adium Framework/Source/AISortController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AISortController.m Sun Sep 09 12:24:39 2012 -0400
@@ -37,8 +37,7 @@
+ (void) setActiveSortController:(AISortController *)newSortController
- [activeSortController autorelease];
- activeSortController = [newSortController retain];
+ activeSortController = newSortController; [activeSortController didBecomeActive];
@@ -73,8 +72,8 @@
if ((self = [super init])) {
- statusKeysRequiringResort = [[self statusKeysRequiringResort] retain];
- attributeKeysRequiringResort = [[self attributeKeysRequiringResort] retain];
+ statusKeysRequiringResort = [self statusKeysRequiringResort]; + attributeKeysRequiringResort = [self attributeKeysRequiringResort]; sortFunction = [self sortFunction];
alwaysSortGroupsToTop = [self alwaysSortGroupsToTopByDefault];
@@ -86,19 +85,6 @@
- [statusKeysRequiringResort release];
- [attributeKeysRequiringResort release];
- [configureView release]; configureView = nil;
* @brief Configure our customization view
- (NSView *)configureView
--- a/Frameworks/Adium Framework/Source/AISoundSet.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AISoundSet.m Sun Sep 09 12:24:39 2012 -0400
@@ -44,7 +44,7 @@
+ (id)soundSetWithContentsOfFile:(NSString *)inPath
- return [[[self alloc] initWithContentsOfFile:inPath] autorelease];
+ return [[self alloc] initWithContentsOfFile:inPath]; @@ -60,7 +60,7 @@
- sourcePath = [inPath retain];
@@ -68,12 +68,7 @@
- [name release]; name = nil;
- [info release]; info = nil;
- [sounds release]; sounds = nil;
- [sourcePath release]; sourcePath = nil;
@@ -112,7 +107,7 @@
NSBundle * xtraBundle = [NSBundle bundleWithPath:inPath];
if (xtraBundle && ([[xtraBundle objectForInfoDictionaryKey:@"XtraBundleVersion"] intValue] == 1)) {
inPath = [xtraBundle resourcePath];
- name = [[xtraBundle objectForInfoDictionaryKey:@"CFBundleName"]retain];
+ name = [xtraBundle objectForInfoDictionaryKey:@"CFBundleName"]; //If we don't have a Sound.plist, assume this is an old format soundset and attempt to upgrade it
@@ -148,8 +143,8 @@
//Retrieve the set name and information
if(!name) //this will have been set from info.plist if it's a new-format xtra
- name = [[[inPath lastPathComponent] stringByDeletingPathExtension] retain];
- info = [[soundSet objectForKey:SOUNDSET_INFO] retain];
+ name = [[inPath lastPathComponent] stringByDeletingPathExtension]; + info = [soundSet objectForKey:SOUNDSET_INFO]; //Search locations. If none are provided, search within the soundset folder.
NSArray *locations = [soundSet objectForKey:SOUNDSET_SOUND_LOCATIONS];
@@ -363,6 +358,6 @@
- (NSString *)description
- return [NSString stringWithFormat:@"<%@: %x - %@: %i sounds at %@>", NSStringFromClass([self class]), self, self.name, [self.sounds count], sourcePath];
+ return [NSString stringWithFormat:@"<%@: %p - %@: %li sounds at %@>", NSStringFromClass([self class]), self, self.name, [self.sounds count], sourcePath]; --- a/Frameworks/Adium Framework/Source/AIStatus.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIStatus.h Sun Sep 09 12:24:39 2012 -0400
@@ -43,7 +43,7 @@
+ (AIStatus *)statusWithDictionary:(NSDictionary *)inDictionary;
+ (AIStatus *)statusOfType:(AIStatusType)inStatusType;
-@property (readwrite, nonatomic, retain) NSAttributedString *statusMessage;
+@property (readwrite, nonatomic) NSAttributedString *statusMessage; @property (readwrite, nonatomic, copy) NSString *statusMessageString;
@@ -51,13 +51,13 @@
- (NSString *)statusMessageTooltipString;
-@property (readwrite, nonatomic, retain) NSAttributedString *autoReply;
+@property (readwrite, nonatomic) NSAttributedString *autoReply; - (void)setAutoReplyString:(NSString *)autoReplyString;
@property (readwrite, nonatomic) BOOL hasAutoReply;
@property (readwrite, nonatomic) BOOL autoReplyIsStatusMessage;
-@property (readwrite, nonatomic, retain) NSString *statusName;
+@property (readwrite, nonatomic) NSString *statusName; @property (readwrite, nonatomic) BOOL shouldForceInitialIdleTime;
@property (readwrite, nonatomic) double forcedInitialIdleTime;
--- a/Frameworks/Adium Framework/Source/AIStatus.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIStatus.m Sun Sep 09 12:24:39 2012 -0400
@@ -33,7 +33,7 @@
- AIStatus *newStatus = [[[self alloc] init] autorelease];
+ AIStatus *newStatus = [[self alloc] init]; //Configure defaults as necessary
[newStatus setAutoReplyIsStatusMessage:YES];
@@ -75,13 +75,6 @@
- [filteredStatusMessage release];
* @brief Returns an appropriate icon for this state
@@ -146,7 +139,7 @@
[statusDict removeObjectForKey:STATUS_STATUS_MESSAGE];
- [filteredStatusMessage release]; filteredStatusMessage = nil;
+ filteredStatusMessage = nil; @@ -162,8 +155,7 @@
- (void)setFilteredStatusMessage:(NSString *)inFilteredStatusMessage
if (![filteredStatusMessage isEqualToString:inFilteredStatusMessage]) {
- [filteredStatusMessage release];
- filteredStatusMessage = [inFilteredStatusMessage retain];
+ filteredStatusMessage = inFilteredStatusMessage; [[NSNotificationCenter defaultCenter] postNotificationName:@"AIStatusFilteredStatusMessageChanged"
@@ -455,7 +447,7 @@
- (NSTextStorage *)scriptingMessage
- return [[[NSTextStorage alloc] initWithAttributedString:self.statusMessage] autorelease];
+ return [[NSTextStorage alloc] initWithAttributedString:self.statusMessage]; - (void)setScriptingMessage:(NSTextStorage *)newMessage
@@ -474,7 +466,7 @@
AILogWithSignature(@"Applying %@ to %@", self, [adium.accountController accountsWithCurrentStatus:self]);
[adium.statusController applyState:self toAccounts:[adium.accountController accountsWithCurrentStatus:self]];
- AIStatus *newStatus = [[self mutableCopy] autorelease];
+ AIStatus *newStatus = [self mutableCopy]; [newStatus setMutabilityType:AITemporaryEditableStatusState];
if ([newMessage isKindOfClass:[NSAttributedString class]])
[newStatus setStatusMessage:newMessage];
@@ -491,7 +483,7 @@
- (NSTextStorage *)scriptingAutoreply
- return [[[NSTextStorage alloc] initWithAttributedString:[self autoReply]] autorelease];
+ return [[NSTextStorage alloc] initWithAttributedString:[self autoReply]]; - (void)setScriptingAutoreply:(NSTextStorage *)newAutoreply
@@ -508,7 +500,7 @@
[adium.statusController savedStatusesChanged];
[adium.statusController applyState:self toAccounts:[adium.accountController accountsWithCurrentStatus:self]];
- AIStatus *newStatus = [[self mutableCopy] autorelease];
+ AIStatus *newStatus = [self mutableCopy]; [newStatus setMutabilityType:AITemporaryEditableStatusState];
if ([newAutoreply isKindOfClass:[NSAttributedString class]])
[newStatus setAutoReply:newAutoreply];
@@ -548,7 +540,7 @@
[adium.statusController savedStatusesChanged];
[adium.statusController applyState:self toAccounts:[adium.accountController accountsWithCurrentStatus:self]];
- AIStatus *newStatus = [[self mutableCopy] autorelease];
+ AIStatus *newStatus = [self mutableCopy]; [newStatus setMutabilityType:AITemporaryEditableStatusState];
[newStatus setStatusType:statusType];
[newStatus setStatusName:[adium.statusController defaultStatusNameForType:statusType]];
@@ -576,7 +568,7 @@
[adium.statusController savedStatusesChanged];
[adium.statusController applyState:self toAccounts:[adium.accountController accountsWithCurrentStatus:self]];
- AIStatus *newStatus = [[self mutableCopy] autorelease];
+ AIStatus *newStatus = [self mutableCopy]; [newStatus setMutabilityType:AITemporaryEditableStatusState];
[newStatus setTitle:newTitle];
[adium.statusController savedStatusesChanged];
--- a/Frameworks/Adium Framework/Source/AIStatusGroup.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIStatusGroup.m Sun Sep 09 12:24:39 2012 -0400
@@ -26,7 +26,7 @@
- return [[[self alloc] init] autorelease];
+ return [[self alloc] init]; + (id)statusGroupWithContainedStatusItems:(NSArray *)inContainedObjects
@@ -52,14 +52,6 @@
- [containedStatusItems release];
- [_flatStatusSet release];
* @brief Encode with Coder
@@ -146,8 +138,8 @@
- (NSArray *)sortedContainedStatusItems
if (!_sortedContainedStatusItems) {
- _sortedContainedStatusItems = [[containedStatusItems sortedArrayUsingFunction:statusArraySort
- context:containedStatusItems] retain];
+ _sortedContainedStatusItems = [containedStatusItems sortedArrayUsingFunction:statusArraySort + context:(__bridge void*)containedStatusItems]; return _sortedContainedStatusItems;
@@ -170,7 +162,7 @@
- (NSMenu *)statusSubmenuNotifyingTarget:(id)target action:(SEL)selector
- NSMenu *menu = [[NSMenu allocWithZone:[NSMenu menuZone]] init];
+ NSMenu *menu = [[NSMenu alloc] init]; AIStatusType currentStatusType = AIAvailableStatusType;
BOOL addedItemForThisStatusType = NO;
@@ -214,19 +206,17 @@
[menuItem setTag:currentStatusType];
[menuItem setImage:[statusState menuIcon]];
addedItemForThisStatusType = YES;
- return [menu autorelease];
#pragma mark Modifying contents
- (void)setContainedStatusItems:(NSArray *)inContainedStatusItems
if (containedStatusItems != inContainedStatusItems) {
- [containedStatusItems release];
containedStatusItems = [inContainedStatusItems mutableCopy];
@@ -234,8 +224,8 @@
- (void)statusesOfContainedGroupChanged
//Clear our cached sorted array so it'll resort as needed
- [_sortedContainedStatusItems release]; _sortedContainedStatusItems = nil;
- [_flatStatusSet release]; _flatStatusSet = nil;
+ _sortedContainedStatusItems = nil; //Let our containing group or the status controller know that there's power in the blood
if ([self containingStatusGroup]) {
@@ -248,7 +238,7 @@
- (void)containedStatusesChanged
//Clear our cached sorted array so it'll resort as needed
- [_sortedContainedStatusItems release]; _sortedContainedStatusItems = nil;
+ _sortedContainedStatusItems = nil; //Let our containing group or the status controller know that there's power in the blood
if ([self containingStatusGroup]) {
@@ -299,7 +289,7 @@
[_flatStatusSet removeObject:(AIStatus *)inStatusItem];
} else if ([inStatusItem isKindOfClass:[AIStatusGroup class]]) {
- [_flatStatusSet release]; _flatStatusSet = nil;
if (!delaySavingAndNotification) {
@@ -320,7 +310,6 @@
NSUInteger sourceIndex = [containedStatusItems indexOfObjectIdenticalTo:statusState];
[containedStatusItems removeObject:statusState];
@@ -328,7 +317,6 @@
if (destIndex > [containedStatusItems count]) destIndex = [containedStatusItems count];
[containedStatusItems insertObject:statusState atIndex:destIndex];
if (!delaySavingAndNotification) {
[self containedStatusesChanged];
@@ -429,7 +417,7 @@
return NSOrderedAscending;
- NSArray *originalArray = (NSArray *)context;
+ NSArray *originalArray = (__bridge NSArray *)context; //Return them in the same relative order as the original array if they are of the same type
NSUInteger indexA = [originalArray indexOfObjectIdenticalTo:objectA];
--- a/Frameworks/Adium Framework/Source/AIStatusIcons.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIStatusIcons.m Sun Sep 09 12:24:39 2012 -0400
@@ -127,7 +127,6 @@
if(![statusIcon isValid]) {
AILog(@"\"%@\" cannot be found.",path);
statusIcon = [[NSImage alloc] initWithSize:NSMakeSize(8,8)];
@@ -138,7 +137,6 @@
if ([statusName isEqualToString:@"Blocked"]) {
@@ -206,17 +204,13 @@
NSDictionary *statusIconDict = [NSDictionary dictionaryWithContentsOfFile:[inPath stringByAppendingPathComponent:@"Icons.plist"]];
if (statusIconDict && [[statusIconDict objectForKey:@"AdiumSetVersion"] intValue] == 1) {
- [statusIconBasePath release];
- statusIconBasePath = [inPath retain];
+ statusIconBasePath = inPath; - [statusIconNames[AIStatusIconTab] release];
- statusIconNames[AIStatusIconTab] = [[statusIconDict objectForKey:@"Tabs"] retain];
+ statusIconNames[AIStatusIconTab] = [statusIconDict objectForKey:@"Tabs"]; - [statusIconNames[AIStatusIconList] release];
- statusIconNames[AIStatusIconList] = [[statusIconDict objectForKey:@"List"] retain];
+ statusIconNames[AIStatusIconList] = [statusIconDict objectForKey:@"List"]; - [statusIconNames[AIStatusIconMenu] release];
- statusIconNames[AIStatusIconMenu] = [statusIconNames[AIStatusIconTab] retain];
+ statusIconNames[AIStatusIconMenu] = statusIconNames[AIStatusIconTab]; //Clear out the status icon cache
for (unsigned i = 0; i < NUMBER_OF_STATUS_ICON_TYPES; i++) {
@@ -364,7 +358,7 @@
- return [image autorelease];
--- a/Frameworks/Adium Framework/Source/AIStatusItem.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIStatusItem.m Sun Sep 09 12:24:39 2012 -0400
@@ -44,14 +44,13 @@
- (id)copyWithZone:(NSZone *)zone
AIStatusItem *miniMe = [[[self class] alloc] init];
- [miniMe->statusDict release];
miniMe->statusDict = [statusDict mutableCopy];
//Clear the unique ID for this new status, since it should not share our ID.
@@ -100,16 +99,6 @@
NSString *title = [statusDict objectForKey:STATUS_TITLE];
@@ -209,8 +198,8 @@
NSNumber *nextUniqueStatusID;
//Retain and autorelease since we'll be replacing this value (and therefore releasing it) via the preferenceController.
- nextUniqueStatusID = [[[adium.preferenceController preferenceForKey:@"TopStatusID"
- group:PREF_GROUP_SAVED_STATUS] retain] autorelease];
+ nextUniqueStatusID = [adium.preferenceController preferenceForKey:@"TopStatusID" + group:PREF_GROUP_SAVED_STATUS]; if (!nextUniqueStatusID) nextUniqueStatusID = [NSNumber numberWithInt:1];
[adium.preferenceController setPreference:[NSNumber numberWithInt:([nextUniqueStatusID intValue] + 1)]
@@ -273,14 +262,13 @@
- (void)setContainingStatusGroup:(AIStatusGroup *)inStatusGroup
if (containingStatusGroup != inStatusGroup) {
- [containingStatusGroup release];
- containingStatusGroup = [inStatusGroup retain];
+ containingStatusGroup = inStatusGroup; - (NSString *)description
- return [NSString stringWithFormat:@"<%@: %x [%@]>",
+ return [NSString stringWithFormat:@"<%@: %p [%@]>", NSStringFromClass([self class]),
[[self title] stringWithEllipsisByTruncatingToLength:20]];
@@ -294,10 +282,10 @@
- (NSScriptObjectSpecifier *)objectSpecifier
NSScriptClassDescription *containerClassDesc = (NSScriptClassDescription *)[NSScriptClassDescription classDescriptionForClass:[NSApp class]];
- return [[[NSUniqueIDSpecifier alloc]
+ return [[NSUniqueIDSpecifier alloc] initWithContainerClassDescription:containerClassDesc
containerSpecifier:nil key:@"statuses"
- uniqueID:[self uniqueStatusID]] autorelease];
+ uniqueID:[self uniqueStatusID]]; - (AIStatusTypeApplescript)statusTypeApplescript
--- a/Frameworks/Adium Framework/Source/AIStatusMenu.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIStatusMenu.h Sun Sep 09 12:24:39 2012 -0400
@@ -21,12 +21,12 @@
NSMutableArray *menuItemArray;
NSMutableSet *stateMenuItemsAlreadyValidated;
- id<AIStatusMenuDelegate> delegate;
+ id<AIStatusMenuDelegate> __unsafe_unretained delegate; + (id)statusMenuWithDelegate:(id<AIStatusMenuDelegate>)inDelegate;
-@property (readwrite, nonatomic, assign) id<AIStatusMenuDelegate> delegate;
+@property (readwrite, nonatomic, unsafe_unretained) id<AIStatusMenuDelegate> delegate; - (void)delegateWillReplaceAllMenuItems;
- (void)delegateCreatedMenuItems:(NSArray *)addedMenuItems;
--- a/Frameworks/Adium Framework/Source/AIStatusMenu.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIStatusMenu.m Sun Sep 09 12:24:39 2012 -0400
@@ -46,7 +46,7 @@
+ (id)statusMenuWithDelegate:(id<AIStatusMenuDelegate>)inDelegate
- return [[[self alloc] initWithDelegate:inDelegate] autorelease];
+ return [[self alloc] initWithDelegate:inDelegate]; - (id)initWithDelegate:(id<AIStatusMenuDelegate>)inDelegate
@@ -83,12 +83,8 @@
[[NSNotificationCenter defaultCenter] removeObserver:self];
- [stateMenuItemsAlreadyValidated release];
- [menuItemArray release];
@@ -147,7 +143,7 @@
direction:AIIconNormal]];
[menuItem setTag:statusType];
- return [menuItem autorelease];
@@ -223,7 +219,6 @@
[menuItem setTag:currentStatusType];
[menuItem setImage:[statusState menuIcon]];
[menuItemArray addObject:menuItem];
currentStatusMutabilityType = thisStatusMutabilityType;
@@ -236,7 +231,7 @@
[menuItemArray addObject:[self customMenuItemForStatusType:currentStatusType]];
//Now that we are done creating the menu items, tell the plugin about them
[delegate statusMenu:self didRebuildStatusMenuItems:menuItemArray];
@@ -429,7 +424,7 @@
lastStatusStateOfThisType.statusMessage = baseStatusState.statusMessage;
- baseStatusState = [[lastStatusStateOfThisType retain] autorelease];
+ baseStatusState = lastStatusStateOfThisType; @@ -445,7 +440,7 @@
#pragma mark Class methods
+ (NSMenu *)staticStatusStatesMenuNotifyingTarget:(id)target selector:(SEL)selector
- NSMenu *statusStatesMenu = [[NSMenu allocWithZone:[NSMenu menuZone]] init];
+ NSMenu *statusStatesMenu = [[NSMenu alloc] init]; AIStatusType currentStatusType = AIAvailableStatusType;
@@ -492,12 +487,11 @@
[statusStatesMenu addItem:menuItem];
[statusStatesMenu setMenuChangedMessagesEnabled:YES];
- return [statusStatesMenu autorelease];
+ return statusStatesMenu; --- a/Frameworks/Adium Framework/Source/AITextAttachmentExtension.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AITextAttachmentExtension.h Sun Sep 09 12:24:39 2012 -0400
@@ -31,8 +31,8 @@
@property (readwrite, nonatomic) BOOL shouldSaveImageForLogging;
@property (readwrite, nonatomic) BOOL hasAlternate;
@property (readwrite, nonatomic, copy) NSString *path;
-@property (readwrite, nonatomic, retain) NSImage *image;
-@property (readonly, nonatomic) NSImage *iconImage;
+@property (readwrite, nonatomic) NSImage *image; +@property (unsafe_unretained, readonly, nonatomic) NSImage *iconImage; @property (readonly, nonatomic) BOOL attachesAnImage;
@property (readwrite, nonatomic) BOOL shouldAlwaysSendAsText;
--- a/Frameworks/Adium Framework/Source/AITextAttachmentExtension.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AITextAttachmentExtension.m Sun Sep 09 12:24:39 2012 -0400
@@ -27,13 +27,13 @@
+ (AITextAttachmentExtension *)textAttachmentExtensionFromTextAttachment:(NSTextAttachment *)textAttachment
- AITextAttachmentExtension *textAttachmentExtension = [[[AITextAttachmentExtension alloc] init] autorelease];
+ AITextAttachmentExtension *textAttachmentExtension = [[AITextAttachmentExtension alloc] init]; [textAttachmentExtension setShouldSaveImageForLogging:YES];
[textAttachmentExtension setAttachmentCell:[textAttachment attachmentCell]];
NSFileWrapper *fileWrapper = [textAttachment fileWrapper];
[textAttachmentExtension setString:[fileWrapper preferredFilename]];
- [textAttachmentExtension setImage:[[[NSImage alloc] initWithData:[fileWrapper regularFileContents]] autorelease]];
+ [textAttachmentExtension setImage:[[NSImage alloc] initWithData:[fileWrapper regularFileContents]]]; NSLog(@"image is %@", [textAttachmentExtension image]);
return textAttachmentExtension;
@@ -55,7 +55,7 @@
- (id)copyWithZone:(NSZone *)zone
- AITextAttachmentExtension *ret = [[[self class] allocWithZone:zone] init];
+ AITextAttachmentExtension *ret = [[[self class] alloc] init]; @@ -73,17 +73,6 @@
- [stringRepresentation release];
- (void)encodeWithCoder:(NSCoder *)encoder
if ([encoder allowsKeyedCoding]) {
@@ -142,7 +131,6 @@
- (void)setPath:(NSString *)inPath
@@ -170,8 +158,7 @@
- (void)setImage:(NSImage *)inImage
- image = [inImage retain];
@@ -215,7 +202,7 @@
iconImage = [originalImage imageByScalingToSize:NSMakeSize(ICON_WIDTH, ICON_WIDTH)];
- iconImage = [[originalImage copy] autorelease];
+ iconImage = [originalImage copy]; @@ -233,7 +220,6 @@
- (void)setString:(NSString *)inString
if (stringRepresentation != inString) {
- [stringRepresentation autorelease];
stringRepresentation = [inString copy];
@@ -249,10 +235,10 @@
- myFilewrapper = [[[NSFileWrapper alloc] initWithPath:[self path]] autorelease];
+ myFilewrapper = [[NSFileWrapper alloc] initWithPath:[self path]]; } else if ([self image]) {
- myFilewrapper = [[[NSFileWrapper alloc] initWithSerializedRepresentation:[[self image] PNGRepresentation]] autorelease];
+ myFilewrapper = [[NSFileWrapper alloc] initWithSerializedRepresentation:[[self image] PNGRepresentation]]; [myFilewrapper setPreferredFilename:[[[NSProcessInfo processInfo] globallyUniqueString] stringByAppendingPathExtension:@"png"]];
@@ -284,7 +270,7 @@
- (NSString *)description
- return [NSString stringWithFormat:@"%@<%x>: %@",NSStringFromClass([self class]),self,[super description]];
+ return [NSString stringWithFormat:@"%@<%p>: %@",NSStringFromClass([self class]),self,[super description]]; --- a/Frameworks/Adium Framework/Source/AIUserIcons.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIUserIcons.m Sun Sep 09 12:24:39 2012 -0400
@@ -171,12 +171,10 @@
AILogWithSignature(@"%@ provided icon for %@", inSource, inObject);
[self flushCacheForObjectAndParentOnly:inObject];
[iconCache setObject:inUserIcon forKey:internalObjectID];
[iconCacheOwners setObject:inSource forKey:internalObjectID];
id <AIUserIconSource> source = [self userIconSourceForObject:inObject];
@@ -385,7 +383,6 @@
if (userIcon && inSource) {
NSString *internalObjectID = inObject.internalObjectID;
[self flushCacheForObjectOnly:inObject];
@@ -396,7 +393,6 @@
forKey:internalObjectID];
[iconCacheOwners setObject:inSource
forKey:internalObjectID];
@@ -471,7 +467,7 @@
- return [[userIcon retain] autorelease];
--- a/Frameworks/Adium Framework/Source/AIWindowController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIWindowController.m Sun Sep 09 12:24:39 2012 -0400
@@ -121,7 +121,7 @@
for (NSScreen *screen in [NSScreen screens])
[multiscreenKey appendFormat:@"-%@", NSStringFromRect([screen frame])];
- return [multiscreenKey autorelease];
@@ -147,7 +147,7 @@
//Fall back on the old number-of-screens key
- frameString = [adium.preferenceController preferenceForKey:[NSString stringWithFormat:@"%@-%i",key,[[NSScreen screens] count]]
+ frameString = [adium.preferenceController preferenceForKey:[NSString stringWithFormat:@"%@-%li",key,[[NSScreen screens] count]] group:PREF_GROUP_WINDOW_POSITIONS];
//Fall back on the single screen preference if necessary (this is effectively a preference upgrade).
--- a/Frameworks/Adium Framework/Source/AIXMLElement.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIXMLElement.m Sun Sep 09 12:24:39 2012 -0400
@@ -28,8 +28,8 @@
@interface AIXMLElement()
-@property (readwrite, retain, nonatomic) NSMutableArray *attributeNames;
-@property (readwrite, retain, nonatomic) NSMutableArray *attributeValues;
+@property (readwrite, nonatomic) NSMutableArray *attributeNames; +@property (readwrite, nonatomic) NSMutableArray *attributeValues; @implementation AIXMLElement
@@ -48,7 +48,7 @@
+ (id) elementWithName:(NSString *)newName
- return [[[self alloc] initWithName:newName] autorelease];
+ return [[self alloc] initWithName:newName]; - (id) initWithName:(NSString *)newName
@@ -77,18 +77,8 @@
- [attributeNames release];
- [attributeValues release];
- (id) copyWithZone:(NSZone *)zone {
- AIXMLElement *other = [[AIXMLElement allocWithZone:zone] initWithName:name];
+ AIXMLElement *other = [[AIXMLElement alloc] initWithName:name]; other.attributeNames = [NSMutableArray arrayWithArray:attributeNames];
other.attributeValues = [NSMutableArray arrayWithArray:attributeValues];
other.selfCloses = selfCloses;
@@ -141,9 +131,9 @@
- (void)setAttributeNames:(NSArray *)newAttrNames values:(NSArray *)newAttrVals
- NSAssert2([newAttrNames count] == [newAttrVals count], @"Attribute names and values have different lengths, %ui and %ui respectively", [newAttrNames count], [newAttrVals count]);
+ NSAssert2([newAttrNames count] == [newAttrVals count], @"Attribute names and values have different lengths, %lu and %lu respectively", [newAttrNames count], [newAttrVals count]); NSUInteger numberOfDuplicates = [newAttrNames count] - [[NSSet setWithArray:newAttrNames] count];
- NSAssert1(numberOfDuplicates == 0, @"Duplicate attributes are not allowed; found %ui duplicate(s)", numberOfDuplicates);
+ NSAssert1(numberOfDuplicates == 0, @"Duplicate attributes are not allowed; found %lu duplicate(s)", numberOfDuplicates); [attributeNames setArray:newAttrNames];
[attributeValues setArray:newAttrVals];
--- a/Frameworks/Adium Framework/Source/AIXtraInfo.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AIXtraInfo.m Sun Sep 09 12:24:39 2012 -0400
@@ -39,60 +39,57 @@
if(!inName) name = @"Unnamed Xtra";
- (NSString *) description
- return [NSString stringWithFormat:@"%@, %@, %@, retaincount=%lu", [self name], [self path], [self type], [self retainCount]];
+ return [NSString stringWithFormat:@"%@, %@, %@, retaincount=%u", [self name], [self path], [self type], 0]; + (AIXtraInfo *) infoWithURL:(NSURL *)url
- return [[[self alloc] initWithURL:url] autorelease];
+ return [[self alloc] initWithURL:url]; - (id) initWithURL:(NSURL *)url
if((self = [super init]))
- path = [[url path] retain];
- type = [[[[url path] pathExtension] lowercaseString] retain];
+ type = [[[url path] pathExtension] lowercaseString]; xtraBundle = [[NSBundle alloc] initWithPath:path];
- version = [[xtraBundle objectForInfoDictionaryKey:@"CFBundleVersion"] retain];
+ version = [xtraBundle objectForInfoDictionaryKey:@"CFBundleVersion"]; if (xtraBundle && ([[xtraBundle objectForInfoDictionaryKey:@"XtraBundleVersion"] integerValue] == 1)) { //This checks for a new-style xtra
[self setName:[xtraBundle objectForInfoDictionaryKey:(NSString *)kCFBundleNameKey]];
- resourcePath = [[xtraBundle resourcePath] retain];
+ resourcePath = [xtraBundle resourcePath]; icon = [[NSImage alloc] initByReferencingFile:[xtraBundle pathForResource:@"Icon" ofType:@"icns"]];
- readMePath = [[xtraBundle pathForResource:@"ReadMe" ofType:@"rtf"] retain];
+ readMePath = [xtraBundle pathForResource:@"ReadMe" ofType:@"rtf"]; NSString *previewImagePath = [xtraBundle pathForImageResource:@"PreviewImage"];
previewImage = [[NSImage alloc] initByReferencingFile:previewImagePath];
if (![[NSFileManager defaultManager] fileExistsAtPath:path]) {
[self setName:[[path lastPathComponent] stringByDeletingPathExtension]];
resourcePath = [path copy];//root of the xtra
- readMePath = [[[NSBundle mainBundle] pathForResource:@"DefaultXtraReadme" ofType:@"rtf"] retain];
+ readMePath = [[NSBundle mainBundle] pathForResource:@"DefaultXtraReadme" ofType:@"rtf"]; if ([[path pathExtension] caseInsensitiveCompare:@"AdiumIcon"] == NSOrderedSame) {
AIIconState *previewState = [adium.dockController previewStateForIconPackAtPath:path];
- icon = [[previewState image] retain];
+ icon = [previewState image]; - icon = [[[NSWorkspace sharedWorkspace] iconForFileType:[path pathExtension]] retain];
+ icon = [[NSWorkspace sharedWorkspace] iconForFileType:[path pathExtension]]; - previewImage = [icon retain];
@@ -105,19 +102,6 @@
- [previewImage release];
- [resourcePath release];
- (NSString *)resourcePath
--- a/Frameworks/Adium Framework/Source/AdiumAuthorization.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/AdiumAuthorization.m Sun Sep 09 12:24:39 2012 -0400
@@ -81,8 +81,6 @@
+ (void)closeAuthorizationForUIHandle:(id)handle
[[AIAuthorizationRequestsWindowController sharedController] removeRequest:handle];
#pragma mark Event descriptions
@@ -179,7 +177,7 @@
- (NSImage *)imageForEventID:(NSString *)eventID
static NSImage *eventImage = nil;
- if (!eventImage) eventImage = [[NSImage imageNamed:@"default-icon" forClass:[self class]] retain];
+ if (!eventImage) eventImage = [NSImage imageNamed:@"default-icon" forClass:[self class]]; --- a/Frameworks/Adium Framework/Source/CSNewContactAlertWindowController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/CSNewContactAlertWindowController.m Sun Sep 09 12:24:39 2012 -0400
@@ -85,8 +85,8 @@
defaultEventID:(NSString *)inDefaultEventID
if ((self = [super initWithWindowNibName:windowNibName])) {
- oldAlert = [inAlert retain];
- listObject = [inListObject retain];
+ listObject = inListObject; configureForGlobal = inConfigureForGlobal;
@@ -116,13 +116,6 @@
[[NSNotificationCenter defaultCenter] removeObserver:self];
// Setup the window before it is displayed
@@ -246,7 +239,7 @@
[detailsView removeFromSuperview], detailsView = nil;
- [detailsPane release], detailsPane = nil;
// Configure the details pane for our current alert
@@ -263,7 +256,7 @@
[self cleanUpDetailsPane];
// Get a new pane for the current action type, and configure it for our alert
- detailsPane = [[actionHandler detailsPaneForActionID:actionID] retain];
+ detailsPane = [actionHandler detailsPaneForActionID:actionID]; NSDictionary *actionDetails = [alert objectForKey:KEY_ACTION_DETAILS];
--- a/Frameworks/Adium Framework/Source/DCJoinChatViewController.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/DCJoinChatViewController.h Sun Sep 09 12:24:39 2012 -0400
@@ -18,19 +18,19 @@
@class AIChat, AIAccount, AIMetaContact, AIListContact, AIService;
@interface DCJoinChatViewController : NSObject {
- IBOutlet NSView *view; // Custom view
+ IBOutlet NSView *__weak view; // Custom view AIChat *chat; // The newly created chat
AIAccount *account; // The account we're being configured for
- id delegate; // Our delegate
+ id __unsafe_unretained delegate; // Our delegate + id __unsafe_unretained sharedChatInstance; + (DCJoinChatViewController *)joinChatView;
-@property (readonly, nonatomic) NSView *view;
-@property (readonly, nonatomic) NSString *nibName;
+@property (weak, readonly, nonatomic) NSView *view; +@property (weak, readonly, nonatomic) NSString *nibName; - (void)configureForAccount:(AIAccount *)inAccount;
- (void)joinChatWithAccount:(AIAccount *)inAccount;
@@ -47,10 +47,10 @@
withInvitationMessage:(NSString *)invitationMessage;
- (NSArray *)contactsFromNamesSeparatedByCommas:(NSString *)namesSeparatedByCommas onAccount:(AIAccount *)inAccount;
-@property (readwrite, nonatomic, assign) id delegate;
+@property (readwrite, nonatomic, unsafe_unretained) id delegate; //roomlistWindowController delegate
-@property (readwrite, nonatomic, assign) id sharedChatInstance;
+@property (readwrite, nonatomic, unsafe_unretained) id sharedChatInstance; --- a/Frameworks/Adium Framework/Source/DCJoinChatViewController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/DCJoinChatViewController.m Sun Sep 09 12:24:39 2012 -0400
@@ -34,7 +34,7 @@
//Create a new join chat view
+ (DCJoinChatViewController *)joinChatView
- return [[[self alloc] init] autorelease];
+ return [[self alloc] init]; @@ -55,14 +55,6 @@
- [view release]; view = nil;
@@ -78,8 +70,7 @@
- (void)configureForAccount:(AIAccount *)inAccount
if (inAccount != account) {
- account = [inAccount retain];
@@ -120,7 +111,7 @@
[chat setValue:invitationMessage forProperty:@"InitialInivitationMessage" notify:NotifyNever];
- [[NSNotificationCenter defaultCenter] addObserver:[self retain] selector:@selector(chatDidOpen:) name:Chat_DidOpen object:chat];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(chatDidOpen:) name:Chat_DidOpen object:chat]; @@ -135,7 +126,7 @@
NSMutableDictionary *inviteUsersDict;
NSString *initialInvitationMessage = [chat valueForProperty:@"InitialInivitationMessage"];
- inviteUsersDict = [NSMutableDictionary dictionaryWithObjectsAndKeys:[[contacts mutableCopy] autorelease],@"ContactsToInvite",nil];
+ inviteUsersDict = [NSMutableDictionary dictionaryWithObjectsAndKeys:[contacts mutableCopy],@"ContactsToInvite",nil]; if (initialInvitationMessage) {
[inviteUsersDict setObject:initialInvitationMessage
forKey:@"InitialInivitationMessage"];
@@ -155,7 +146,6 @@
//We are no longer concerned with the opening of this chat.
[[NSNotificationCenter defaultCenter] removeObserver:self name:Chat_DidOpen object:chat];
@@ -170,13 +160,12 @@
NSMutableArray *contactArray = [userInfo objectForKey:@"ContactsToInvite"];
if ([contactArray count]) {
- AIListContact *listContact = [[contactArray objectAtIndex:0] retain];
+ AIListContact *listContact = [contactArray objectAtIndex:0]; [contactArray removeObjectAtIndex:0];
AILog(@"Inviting %@ to %@", listContact, chat);
[chat inviteListContact:listContact
withMessage:[userInfo objectForKey:@"InitialInivitationMessage"]];
--- a/Frameworks/Adium Framework/Source/DCJoinChatWindowController.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/DCJoinChatWindowController.h Sun Sep 09 12:24:39 2012 -0400
@@ -34,7 +34,7 @@
+ (DCJoinChatWindowController *)showJoinChatWindow;
-@property (nonatomic, retain) DCJoinChatViewController *joinChatViewController;
+@property (nonatomic) DCJoinChatViewController *joinChatViewController; - (void)configureForAccount:(AIAccount *)inAccount;
- (IBAction)joinChat:(id)sender;
--- a/Frameworks/Adium Framework/Source/DCJoinChatWindowController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/DCJoinChatWindowController.m Sun Sep 09 12:24:39 2012 -0400
@@ -114,13 +114,6 @@
- self.joinChatViewController = nil;
// Setup the window before it is displayed
@@ -132,9 +125,9 @@
[button_cancel setLocalizedString:AILocalizedString(@"Cancel", nil)];
- accountMenu = [[AIAccountMenu accountMenuWithDelegate:self
+ accountMenu = [AIAccountMenu accountMenuWithDelegate:self submenuType:AIAccountNoSubmenu
- showTitleVerbs:NO] retain];
[self configureForAccount:[[popUp_service selectedItem] representedObject]];
@@ -147,8 +140,7 @@
[super windowWillClose:sender];
sharedJoinChatInstance = nil;
- [accountMenu release]; accountMenu = nil;
- [self autorelease]; //Close the shared instance
#pragma mark DCJoinChatViewController delegate
--- a/Frameworks/Adium Framework/Source/ESApplescriptabilityController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/ESApplescriptabilityController.m Sun Sep 09 12:24:39 2012 -0400
@@ -39,7 +39,7 @@
- (void)controllerWillClose
- [applescriptRunner release]; applescriptRunner = nil;
+ applescriptRunner = nil; @@ -110,8 +110,6 @@
[newStatus setStatusTypeApplescript:newStatusType];
[self setMyStatus:newStatus];
- (NSString *)myStatusMessageString
@@ -125,8 +123,6 @@
[newStatus setStatusMessageString:inString];
[self setMyStatus:newStatus];
#pragma mark Controller convenience
--- a/Frameworks/Adium Framework/Source/ESContactAlertsViewController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/ESContactAlertsViewController.m Sun Sep 09 12:24:39 2012 -0400
@@ -62,8 +62,8 @@
- [expandStateDict release]; expandStateDict = [[NSMutableDictionary alloc] init];
- [requiredHeightDict release]; requiredHeightDict = [[NSMutableDictionary alloc] init];
+ expandStateDict = [[NSMutableDictionary alloc] init]; + requiredHeightDict = [[NSMutableDictionary alloc] init]; [self configureEventSummaryOutlineView];
@@ -114,19 +114,6 @@
[outlineView_summary setDelegate:nil];
[outlineView_summary setDataSource:nil];
- [editingPanel release]; editingPanel = nil;
- [contactAlertsEvents release]; contactAlertsEvents = nil;
- [contactAlertsActions release]; contactAlertsActions = nil;
- [listObject release]; listObject = nil;
- [expandStateDict release]; expandStateDict = nil;
- [requiredHeightDict release]; requiredHeightDict = nil;
- // I don't think this needs to be released, because the contact-specific
- // alerts view does not appear to get released. But anyway...
- [targetEventID release]; targetEventID = nil;
- (void)setDelegate:(id)inDelegate
@@ -160,18 +147,15 @@
if (listObject != inObject) {
[editingPanel cancel:nil];
- [editingPanel release]; editingPanel = nil;
//Configure for the list object, using the highest-up metacontact if necessary
listObject = ([inObject isKindOfClass:[AIListContact class]] ?
[(AIListContact *)inObject parentContact] :
- [targetEventID release];
- targetEventID = [inTargetEventID retain];
+ targetEventID = inTargetEventID; [self preferencesChangedForGroup:nil key:nil object:nil preferenceDict:nil firstTime:NO];
@@ -217,12 +201,12 @@
defaultEventID = [item objectForKey:KEY_EVENT_ID];
- editingPanel = [[CSNewContactAlertWindowController editAlert:nil
+ editingPanel = [CSNewContactAlertWindowController editAlert:nil configureForGlobal:configureForGlobal
- defaultEventID:defaultEventID] retain];
+ defaultEventID:defaultEventID]; @@ -232,12 +216,12 @@
if (selectedRow >= 0 && selectedRow < [outlineView_summary numberOfRows]) {
NSDictionary *alert = [outlineView_summary itemAtRow:selectedRow];
- editingPanel = [[CSNewContactAlertWindowController editAlert:alert
+ editingPanel = [CSNewContactAlertWindowController editAlert:alert configureForGlobal:configureForGlobal
- defaultEventID:nil] retain];
@@ -248,8 +232,6 @@
id item = [outlineView_summary itemAtRow:selectedRow];
if ([contactAlertsActions containsObjectIdenticalTo:item]) {
/* Deleting an entire event */
@@ -266,7 +248,7 @@
@selector(sheetDidEnd:returnCode:contextInfo:),
NULL, /* didDismissSelector */
+ (__bridge void*)contactEvents, AILocalizedString(@"Remove the %i actions associated with this event?", nil), contactEventsCount);
//Delete a single event immediately
@@ -286,7 +268,6 @@
//The deletion changed our selection
[self outlineViewSelectionDidChange:nil];
@@ -301,7 +282,7 @@
- (void)sheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo
if (returnCode == NSAlertDefaultReturn) {
- [self deleteContactActionsInArray:(NSArray *)contextInfo];
+ [self deleteContactActionsInArray:(__bridge NSArray *)contextInfo]; @@ -311,7 +292,6 @@
//If this was an edit, remove the old alert first
- [[oldAlert retain] autorelease];
[adium.contactAlertsController removeAlert:oldAlert fromListObject:listObject];
@@ -328,7 +308,7 @@
[self calculateAllHeights];
- [editingPanel release]; editingPanel = nil;
#pragma mark Outline view
@@ -345,18 +325,15 @@
[imageCell setAlignment:NSCenterTextAlignment];
[imageCell setMaxSize:NSMakeSize(MINIMUM_IMAGE_HEIGHT, MINIMUM_IMAGE_HEIGHT)];
[[outlineView_summary tableColumnWithIdentifier:@"image"] setDataCell:imageCell];
imageTextCell = [[AIImageTextCell alloc] init];
[imageTextCell setMaxImageWidth:MINIMUM_ROW_HEIGHT];
[imageTextCell setLineBreakMode:NSLineBreakByWordWrapping];
[[outlineView_summary tableColumnWithIdentifier:@"event"] setDataCell:imageTextCell];
- [imageTextCell release];
verticallyCenteredTextCell = [[AIVerticallyCenteredTextCell alloc] init];
[verticallyCenteredTextCell setFont:[NSFont systemFontOfSize:10]];
[[outlineView_summary tableColumnWithIdentifier:@"action"] setDataCell:verticallyCenteredTextCell];
- [verticallyCenteredTextCell release];
[outlineView_summary setUsesAlternatingRowBackgroundColors:YES];
[outlineView_summary setIntercellSpacing:NSMakeSize(6.0f,6.0f)];
@@ -428,7 +405,6 @@
AILogWithSignature(@"%@: width %f height %f", [attributedTitle string], tableColumnWidth, thisHeight);
- [attributedTitle release];
@@ -441,12 +417,12 @@
[requiredHeightDict setObject:[NSNumber numberWithDouble:(enforceMinimumHeight ?
((necessaryHeight > MINIMUM_ROW_HEIGHT) ? necessaryHeight : MINIMUM_ROW_HEIGHT) :
- forKey:[NSValue valueWithPointer:item]];
+ forKey:[NSValue valueWithPointer:(__bridge void*)item]]; - (void)calculateAllHeights
- [requiredHeightDict release]; requiredHeightDict = [[NSMutableDictionary alloc] init];
+ requiredHeightDict = [[NSMutableDictionary alloc] init]; for (item in contactAlertsActions) {
@@ -469,18 +445,18 @@
id item = [outlineView_summary itemAtRow:row];
if ([contactAlertsActions containsObjectIdenticalTo:item]) {
- selectedEventID = [[contactAlertsEvents objectAtIndex:[contactAlertsActions indexOfObjectIdenticalTo:item]] retain];
+ selectedEventID = [contactAlertsEvents objectAtIndex:[contactAlertsActions indexOfObjectIdenticalTo:item]]; - selectedEventID = [[item objectForKey:KEY_EVENT_ID] retain];
+ selectedEventID = [item objectForKey:KEY_EVENT_ID]; contactAlertsDict = [adium.preferenceController preferenceForKey:KEY_CONTACT_ALERTS
group:PREF_GROUP_CONTACT_ALERTS
objectIgnoringInheritance:listObject];
- [contactAlertsEvents release]; contactAlertsEvents = [[NSMutableArray alloc] init];
- [contactAlertsActions release]; contactAlertsActions = [[NSMutableArray alloc] init];
+ contactAlertsEvents = [[NSMutableArray alloc] init]; + contactAlertsActions = [[NSMutableArray alloc] init]; for (NSString *eventID in [adium.contactAlertsController sortedArrayOfEventIDsFromArray:[contactAlertsDict allKeys]]) {
[contactAlertsEvents addObject:eventID];
@@ -512,8 +488,6 @@
[outlineView_summary selectRowIndexes:[NSIndexSet indexSetWithIndex:rowToSelect]
byExtendingSelection:NO];
- [selectedEventID release];
@@ -737,7 +711,7 @@
if ([contactAlertsActions containsObjectIdenticalTo:item]) {
- NSNumber *cachedHeight = [requiredHeightDict objectForKey:[NSValue valueWithPointer:item]];
+ NSNumber *cachedHeight = [requiredHeightDict objectForKey:[NSValue valueWithPointer:(__bridge void *)item]]; necessaryHeight = (cachedHeight ? [cachedHeight floatValue] : MINIMUM_ROW_HEIGHT);
@@ -846,7 +820,7 @@
[adium.preferenceController delayPreferenceChangedNotifications:YES];
- for (eventDict in [[contactEventArray copy] autorelease]) {
+ for (eventDict in [contactEventArray copy]) { [adium.contactAlertsController removeAlert:eventDict fromListObject:listObject];
[adium.preferenceController delayPreferenceChangedNotifications:NO];
--- a/Frameworks/Adium Framework/Source/ESDebugAILog.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/ESDebugAILog.m Sun Sep 09 12:24:39 2012 -0400
@@ -56,9 +56,9 @@
[adium.debugController addMessage:actualMessage];
- [adium.debugController performSelectorOnMainThread:@selector(addMessage:)
- withObject:actualMessage
+ dispatch_async(dispatch_get_main_queue(), ^{ + [adium.debugController addMessage:actualMessage]; @@ -71,7 +71,6 @@
debugMessage = [[NSString alloc] initWithFormat:format
AIAddDebugMessage(debugMessage);
- [debugMessage release];
va_end(ap); /* clean up when done */
@@ -94,7 +93,6 @@
actualMessage = [NSString stringWithFormat:@"%s:%d: (on %s) %@", name, line, (queue ?: ""), debugMessage];
AIAddDebugMessage(actualMessage);
- [debugMessage release];
va_end(ap); /* clean up when done */
@@ -109,7 +107,6 @@
actualMessage = [NSString stringWithFormat:@"%s: %@", prefix, debugMessage];
AIAddDebugMessage(actualMessage);
- [debugMessage release];
va_end(ap); /* clean up when done */
--- a/Frameworks/Adium Framework/Source/ESFileTransfer.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/ESFileTransfer.h Sun Sep 09 12:24:39 2012 -0400
@@ -43,7 +43,7 @@
AIFileTransferStatus status;
- id <FileTransferDelegate> delegate;
+ id <FileTransferDelegate> __unsafe_unretained delegate; ESFileTransferRequestPromptController *promptController;
@@ -51,12 +51,12 @@
+ (id)fileTransferWithContact:(AIListContact *)inContact forAccount:(AIAccount *)inAccount type:(AIFileTransferType)t;
+ (ESFileTransfer *)existingFileTransferWithID:(NSString *)fileTransferID;
-@property (readonly, nonatomic) AIListContact *contact;
-@property (readonly, nonatomic) AIAccount<AIAccount_Files> *account;
+@property (weak, readonly, nonatomic) AIListContact *contact; +@property (weak, readonly, nonatomic) AIAccount<AIAccount_Files> *account; -@property (readwrite, nonatomic, retain) NSString *remoteFilename;
-@property (readwrite, nonatomic, retain) NSString *localFilename;
-@property (readonly, nonatomic) NSString *displayFilename;
+@property (readwrite, nonatomic) NSString *remoteFilename; +@property (readwrite, nonatomic) NSString *localFilename; +@property (weak, readonly, nonatomic) NSString *displayFilename; @property (readwrite, nonatomic) unsigned long long size;
@property (readwrite, nonatomic) BOOL isDirectory;
@@ -70,9 +70,9 @@
- (void)setSizeWithNumber:(NSNumber *)newSize;
- (NSNumber *)sizeNumber;
-@property (readwrite, nonatomic, retain) id accountData;
+@property (readwrite, nonatomic) id accountData; -@property (readwrite, nonatomic, assign) id <FileTransferDelegate> delegate;
+@property (readwrite, nonatomic, unsafe_unretained) id <FileTransferDelegate> delegate; @property (readonly, nonatomic) BOOL isStopped;
@@ -80,10 +80,10 @@
-@property (readonly, nonatomic) NSImage *iconImage;
+@property (unsafe_unretained, readonly, nonatomic) NSImage *iconImage; -@property (readonly, nonatomic) NSString *uniqueID;
+@property (weak, readonly, nonatomic) NSString *uniqueID; -@property (readwrite, nonatomic, retain) ESFileTransferRequestPromptController *fileTransferRequestPromptController;
+@property (readwrite, nonatomic) ESFileTransferRequestPromptController *fileTransferRequestPromptController; --- a/Frameworks/Adium Framework/Source/ESFileTransfer.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/ESFileTransfer.m Sun Sep 09 12:24:39 2012 -0400
@@ -39,12 +39,12 @@
+ (id)fileTransferWithContact:(AIListContact *)inContact forAccount:(AIAccount *)inAccount type:(AIFileTransferType)inType
- return [[[self alloc] initWithContact:inContact forAccount:inAccount type:inType] autorelease];
+ return [[self alloc] initWithContact:inContact forAccount:inAccount type:inType]; + (ESFileTransfer *)existingFileTransferWithID:(NSString *)fileTransferID
- return [[[[fileTransferDict objectForKey:fileTransferID] nonretainedObjectValue] retain] autorelease];
+ return [[fileTransferDict objectForKey:fileTransferID] nonretainedObjectValue]; @@ -73,7 +73,7 @@
- message:[[[NSAttributedString alloc] initWithString:@""] autorelease]
+ message:[[NSAttributedString alloc] initWithString:@""] status = Unknown_Status_FileTransfer;
@@ -92,14 +92,7 @@
[fileTransferDict removeObjectForKey:[self uniqueID]];
- [remoteFilename release];
- [localFilename release];
- [promptController release];
- (AIListContact *)contact
@@ -115,8 +108,7 @@
- (void)setRemoteFilename:(NSString *)inRemoteFilename
if (remoteFilename != inRemoteFilename) {
- [remoteFilename release];
- remoteFilename = [inRemoteFilename retain];
+ remoteFilename = inRemoteFilename; @@ -129,8 +121,7 @@
- (void)setLocalFilename:(NSString *)inLocalFilename
if (localFilename != inLocalFilename) {
- [localFilename release];
- localFilename = [inLocalFilename retain];
+ localFilename = inLocalFilename; @@ -276,7 +267,7 @@
if (CFGetTypeID(cfOldQuarantineProperties) == CFDictionaryGetTypeID()) {
- quarantineProperties = [[(NSDictionary *)cfOldQuarantineProperties mutableCopy] autorelease];
+ quarantineProperties = [(__bridge NSDictionary *)cfOldQuarantineProperties mutableCopy]; AILogWithSignature(@"Getting quarantine data failed for %@ (%@)", self, localFilename);
@@ -298,7 +289,7 @@
// [quarantineProperties setObject:[NSURL URLWithString:@"file:///dev/null"]
// forKey:(NSString *)kLSQuarantineOriginURLKey];
- if (LSSetItemAttribute(&fsRef, kLSRolesAll, kLSItemQuarantineProperties, quarantineProperties) != noErr) {
+ if (LSSetItemAttribute(&fsRef, kLSRolesAll, kLSItemQuarantineProperties, (__bridge void*)quarantineProperties) != noErr) { AILogWithSignature(@"Danger! Quarantining file %@ failed!", localFilename);
@@ -422,7 +413,7 @@
- return [iconImage autorelease];
--- a/Frameworks/Adium Framework/Source/ESFileWrapperExtension.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/ESFileWrapperExtension.m Sun Sep 09 12:24:39 2012 -0400
@@ -33,7 +33,7 @@
/*immutable flavours of NSString only retain when we call -copy, so
* originPath may still == path even though we used -copy above.
- [originalPath release]; originalPath = [path copy];
+ originalPath = [path copy]; return ([super updateFromPath:path]);
@@ -46,7 +46,7 @@
/*immutable flavours of NSString only retain when we call -copy, so
* originPath may still == path even though we used -copy above.
- [originalPath release]; originalPath = [path copy];
+ originalPath = [path copy]; --- a/Frameworks/Adium Framework/Source/ESPresetManagementController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/ESPresetManagementController.m Sun Sep 09 12:24:39 2012 -0400
@@ -62,26 +62,15 @@
NSParameterAssert([inDelegate respondsToSelector:@selector(deletePreset:inPresets:)]);
if ((self = [super initWithWindowNibName:@"PresetManagement"])) {
- presets = [inPresets retain];
- nameKey = [inNameKey retain];
- delegate = [inDelegate retain];
@@ -127,8 +116,6 @@
- (void)sheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo
@@ -139,8 +126,6 @@
- (void)windowWillClose:(id)sender
[super windowWillClose:sender];
@@ -166,7 +151,7 @@
createdDuplicate:&duplicatePreset];
- [presets autorelease]; presets = [newPresets retain];
//The delegate returned a potentially changed presets array; reload table data
[tableView_presets reloadData];
@@ -202,7 +187,7 @@
//Inform the delegate of the deletion
newPresets = [delegate deletePreset:selectedPreset inPresets:presets];
- [presets autorelease]; presets = [newPresets retain];
//The delegate returned a potentially changed presets array; reload table data
[tableView_presets reloadData];
@@ -298,7 +283,7 @@
newPresets = [delegate renamePreset:preset toName:(NSString *)anObject inPresets:presets renamedPreset:&renamedPreset];
- [presets autorelease]; presets = [newPresets retain];
//The delegate returned a potentially changed presets array; reload table data
[tableView_presets reloadData];
@@ -333,8 +318,7 @@
- (BOOL)tableView:(NSTableView *)tableView writeRowsWithIndexes:(NSIndexSet *)rowIndexes toPasteboard:(NSPasteboard *)pboard
if ([delegate respondsToSelector:@selector(movePreset:toIndex:inPresets:presetAfterMove:)]) {
- [tempDragPreset release];
- tempDragPreset = [[presets objectAtIndex:[rowIndexes firstIndex]] retain];
+ tempDragPreset = [presets objectAtIndex:[rowIndexes firstIndex]]; [pboard declareTypes:[NSArray arrayWithObject:PRESET_DRAG_TYPE] owner:self];
[pboard setString:@"Preset" forType:PRESET_DRAG_TYPE]; //Arbitrary state
@@ -370,7 +354,7 @@
//Inform the delegate of the move; it may pass back a changed preset by reference
newPresets = [delegate movePreset:tempDragPreset toIndex:row inPresets:presets presetAfterMove:&presetAfterMove];
- [presets autorelease]; presets = [newPresets retain];
//Reload with the new data
[tableView_presets reloadData];
@@ -384,7 +368,7 @@
- [tempDragPreset release]; tempDragPreset = nil;
--- a/Frameworks/Adium Framework/Source/ESPresetNameSheetController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/ESPresetNameSheetController.m Sun Sep 09 12:24:39 2012 -0400
@@ -43,10 +43,10 @@
NSParameterAssert([inTarget respondsToSelector:@selector(presetNameSheetControllerDidEnd:returnCode:newName:userInfo:)]);
if ((self = [super initWithWindowNibName:PRESET_NAME_SHEET])) {
- defaultName = [inDefaultName retain];
- explanatoryText = [inExplanatoryText retain];
- target = [inTarget retain];
- userInfo = [inUserInfo retain];
+ defaultName = inDefaultName; + explanatoryText = inExplanatoryText; @@ -58,8 +58,6 @@
- (void)sheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo
@@ -70,8 +68,6 @@
- (void)windowWillClose:(id)sender
[super windowWillClose:sender];
- (IBAction)okay:(id)sender
--- a/Frameworks/Adium Framework/Source/ESTextAndButtonsWindowController.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/ESTextAndButtonsWindowController.h Sun Sep 09 12:24:39 2012 -0400
@@ -15,19 +15,7 @@
#import <Adium/AIWindowController.h>
- AITextAndButtonsDefaultReturn = 1,
- AITextAndButtonsAlternateReturn = 0,
- AITextAndButtonsOtherReturn = -1,
- AITextAndButtonsClosedWithoutResponse = -2
-} AITextAndButtonsReturnCode;
- AITextAndButtonsWindowButtonDefault = 0,
- AITextAndButtonsWindowButtonAlternate,
- AITextAndButtonsWindowButtonOther
-} AITextAndButtonsWindowButton;
+#import <Adium/AIInterfaceControllerProtocol.h> @interface ESTextAndButtonsWindowController : AIWindowController {
IBOutlet NSTextView *textView_messageHeader;
--- a/Frameworks/Adium Framework/Source/ESTextAndButtonsWindowController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/ESTextAndButtonsWindowController.m Sun Sep 09 12:24:39 2012 -0400
@@ -154,27 +154,16 @@
- [defaultButton release];
- [alternateButton release];
- [messageHeader release];
- title = [inTitle retain];
- defaultButton = [inDefaultButton retain];
- alternateButton = ([inAlternateButton length] ? [inAlternateButton retain] : nil);
- otherButton = ([inOtherButton length] ? [inOtherButton retain] : nil);
- suppression = ([inSuppression length] ? [inSuppression retain] : nil);
- messageHeader = ([inMessageHeader length] ? [inMessageHeader retain] : nil);
- message = [inMessage retain];
- target = [inTarget retain];
- userInfo = [inUserInfo retain];
- image = [inImage retain];
+ defaultButton = inDefaultButton; + alternateButton = ([inAlternateButton length] ? inAlternateButton : nil); + otherButton = ([inOtherButton length] ? inOtherButton : nil); + suppression = ([inSuppression length] ? inSuppression : nil); + messageHeader = ([inMessageHeader length] ? inMessageHeader : nil); allowsCloseWithoutResponse = YES;
@@ -203,8 +192,7 @@
- (void)setImage:(NSImage *)inImage;
- image = [inImage retain];
[imageView setImage:image];
@@ -264,10 +252,8 @@
[super windowWillClose:sender];
//Release our target immediately to avoid a potential mutual retain (if the target is retaining us)
- [target release]; target = nil;
@@ -276,8 +262,6 @@
- (void)sheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo
@@ -526,20 +510,4 @@
- [defaultButton release];
- [alternateButton release];
- [messageHeader release];
--- a/Frameworks/Adium Framework/Source/JVFontPreviewField.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/Adium Framework/Source/JVFontPreviewField.m Sun Sep 09 12:24:39 2012 -0400
@@ -24,11 +24,11 @@
if ( [coder allowsKeyedCoding] ) {
_showPointSize = [coder decodeBoolForKey:@"showPointSize"];
_showFontFace = [coder decodeBoolForKey:@"showFontFace"];
- _actualFont = [[coder decodeObjectForKey:@"actualFont"] retain];
+ _actualFont = [coder decodeObjectForKey:@"actualFont"]; [coder decodeValueOfObjCType:@encode( char ) at:&_showPointSize];
[coder decodeValueOfObjCType:@encode( char ) at:&_showFontFace];
- _actualFont = [[coder decodeObject] retain];
+ _actualFont = [coder decodeObject]; @@ -46,12 +46,6 @@
- (void) changeFont:(id) sender {
NSFont *font = [sender convertFont:[self font]];
NSObject <NSObject,JVFontPreviewFieldDelegate> *__delegate = (id <NSObject,JVFontPreviewFieldDelegate>)self.delegate;
@@ -109,12 +103,12 @@
[super setFont:[[NSFontManager sharedFontManager] convertFont:_actualFont toSize:11.0f]];
- text = [[[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@ %.0f", (_showFontFace ? [_actualFont displayName] : [_actualFont familyName]), [_actualFont pointSize]]] autorelease];
+ text = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@ %.0f", (_showFontFace ? [_actualFont displayName] : [_actualFont familyName]), [_actualFont pointSize]]]; - text = [[[NSMutableAttributedString alloc] initWithString:( _showFontFace ? [_actualFont displayName] : [_actualFont familyName] )] autorelease];
+ text = [[NSMutableAttributedString alloc] initWithString:( _showFontFace ? [_actualFont displayName] : [_actualFont familyName] )]; - NSMutableParagraphStyle *paraStyle = [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] autorelease];
+ NSMutableParagraphStyle *paraStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy]; [paraStyle setMinimumLineHeight:NSHeight([self bounds])];
[paraStyle setMaximumLineHeight:NSHeight([self bounds])];
@@ -137,8 +131,7 @@
- [_actualFont autorelease];
- _actualFont = [font retain];
[self updateDisplayedFont];
--- a/Frameworks/AutoHyperlinks Framework/AutoHyperlinks.framework.xcodeproj/project.pbxproj Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AutoHyperlinks Framework/AutoHyperlinks.framework.xcodeproj/project.pbxproj Sun Sep 09 12:24:39 2012 -0400
@@ -65,7 +65,7 @@
3496A81D07CE69270055BBAB /* AutoHyperlinks.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = AutoHyperlinks.h; path = Source/AutoHyperlinks.h; sourceTree = "<group>"; };
3496A81E07CE69270055BBAB /* AHLinkLexer.l */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.lex; name = AHLinkLexer.l; path = Source/AHLinkLexer.l; sourceTree = "<group>"; };
3496A81F07CE69270055BBAB /* AHMarkedHyperlink.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = AHMarkedHyperlink.h; path = Source/AHMarkedHyperlink.h; sourceTree = "<group>"; };
- 3496A82007CE69270055BBAB /* AHHyperlinkScanner.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = AHHyperlinkScanner.m; path = Source/AHHyperlinkScanner.m; sourceTree = "<group>"; };
+ 3496A82007CE69270055BBAB /* AHHyperlinkScanner.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AHHyperlinkScanner.m; path = Source/AHHyperlinkScanner.m; sourceTree = "<group>"; }; 3496A82107CE69270055BBAB /* AHHyperlinkScanner.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = AHHyperlinkScanner.h; path = Source/AHHyperlinkScanner.h; sourceTree = "<group>"; };
3496A82207CE69270055BBAB /* AHMarkedHyperlink.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = AHMarkedHyperlink.m; path = Source/AHMarkedHyperlink.m; sourceTree = "<group>"; };
7E0CF1AF11769E6100EDC305 /* AutoHyperlinks.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = AutoHyperlinks.xcconfig; path = xcconfigs/AutoHyperlinks.xcconfig; sourceTree = "<group>"; };
--- a/Frameworks/AutoHyperlinks Framework/Source/AHHyperlinkScanner.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AutoHyperlinks Framework/Source/AHHyperlinkScanner.m Sun Sep 09 12:24:39 2012 -0400
@@ -77,7 +77,7 @@
NSMutableCharacterSet *mutableStartSet = [[NSMutableCharacterSet alloc] init];
[mutableStartSet formUnionWithCharacterSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
- [mutableStartSet formUnionWithCharacterSet:[NSCharacterSet characterSetWithCharactersInString:[NSString stringWithFormat:@"\"'“”‘’.…,:;<?!-–—@%C%C", 0x2014, 0x2013]]];
+ [mutableStartSet formUnionWithCharacterSet:[NSCharacterSet characterSetWithCharactersInString:@"\"'“”‘’.…,:;<?!-–—@"]]; startSet = [[NSCharacterSet characterSetWithBitmapRepresentation:[mutableStartSet bitmapRepresentation]] retain];
[mutableStartSet release];
--- a/Frameworks/AutoHyperlinks Framework/Source/AHMarkedHyperlink.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/AutoHyperlinks Framework/Source/AHMarkedHyperlink.m Sun Sep 09 12:24:39 2012 -0400
@@ -129,7 +129,7 @@
- (id)copyWithZone:(NSZone *)zone
- AHMarkedHyperlink *newLink = [[[self class] allocWithZone:zone] initWithString:[self.URL absoluteString]
+ AHMarkedHyperlink *newLink = [[[self class] alloc] initWithString:[self.URL absoluteString] withValidationStatus:self.validationStatus
parentString:self.parentString
--- a/Frameworks/JSONKit/JSONKit.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Frameworks/JSONKit/JSONKit.m Sun Sep 09 12:24:39 2012 -0400
@@ -2594,18 +2594,18 @@
BOOL workAroundMacOSXABIBreakingBug = NO;
if(JK_EXPECT_F(((NSUInteger)object) & 0x1)) { workAroundMacOSXABIBreakingBug = YES; goto slowClassLookup; }
- if(JK_EXPECT_T(object->isa == encodeState->fastClassLookup.stringClass)) { isClass = JKClassString; }
- else if(JK_EXPECT_T(object->isa == encodeState->fastClassLookup.numberClass)) { isClass = JKClassNumber; }
- else if(JK_EXPECT_T(object->isa == encodeState->fastClassLookup.dictionaryClass)) { isClass = JKClassDictionary; }
- else if(JK_EXPECT_T(object->isa == encodeState->fastClassLookup.arrayClass)) { isClass = JKClassArray; }
- else if(JK_EXPECT_T(object->isa == encodeState->fastClassLookup.nullClass)) { isClass = JKClassNull; }
+ if(JK_EXPECT_T(object_getClass(object) == encodeState->fastClassLookup.stringClass)) { isClass = JKClassString; } + else if(JK_EXPECT_T(object_getClass(object) == encodeState->fastClassLookup.numberClass)) { isClass = JKClassNumber; } + else if(JK_EXPECT_T(object_getClass(object) == encodeState->fastClassLookup.dictionaryClass)) { isClass = JKClassDictionary; } + else if(JK_EXPECT_T(object_getClass(object) == encodeState->fastClassLookup.arrayClass)) { isClass = JKClassArray; } + else if(JK_EXPECT_T(object_getClass(object) == encodeState->fastClassLookup.nullClass)) { isClass = JKClassNull; } - if(JK_EXPECT_T([object isKindOfClass:[NSString class]])) { if(workAroundMacOSXABIBreakingBug == NO) { encodeState->fastClassLookup.stringClass = object->isa; } isClass = JKClassString; }
- else if(JK_EXPECT_T([object isKindOfClass:[NSNumber class]])) { if(workAroundMacOSXABIBreakingBug == NO) { encodeState->fastClassLookup.numberClass = object->isa; } isClass = JKClassNumber; }
- else if(JK_EXPECT_T([object isKindOfClass:[NSDictionary class]])) { if(workAroundMacOSXABIBreakingBug == NO) { encodeState->fastClassLookup.dictionaryClass = object->isa; } isClass = JKClassDictionary; }
- else if(JK_EXPECT_T([object isKindOfClass:[NSArray class]])) { if(workAroundMacOSXABIBreakingBug == NO) { encodeState->fastClassLookup.arrayClass = object->isa; } isClass = JKClassArray; }
- else if(JK_EXPECT_T([object isKindOfClass:[NSNull class]])) { if(workAroundMacOSXABIBreakingBug == NO) { encodeState->fastClassLookup.nullClass = object->isa; } isClass = JKClassNull; }
+ if(JK_EXPECT_T([object isKindOfClass:[NSString class]])) { if(workAroundMacOSXABIBreakingBug == NO) { encodeState->fastClassLookup.stringClass = object_getClass(object); } isClass = JKClassString; } + else if(JK_EXPECT_T([object isKindOfClass:[NSNumber class]])) { if(workAroundMacOSXABIBreakingBug == NO) { encodeState->fastClassLookup.numberClass = object_getClass(object); } isClass = JKClassNumber; } + else if(JK_EXPECT_T([object isKindOfClass:[NSDictionary class]])) { if(workAroundMacOSXABIBreakingBug == NO) { encodeState->fastClassLookup.dictionaryClass = object_getClass(object); } isClass = JKClassDictionary; } + else if(JK_EXPECT_T([object isKindOfClass:[NSArray class]])) { if(workAroundMacOSXABIBreakingBug == NO) { encodeState->fastClassLookup.arrayClass = object_getClass(object); } isClass = JKClassArray; } + else if(JK_EXPECT_T([object isKindOfClass:[NSNull class]])) { if(workAroundMacOSXABIBreakingBug == NO) { encodeState->fastClassLookup.nullClass = object_getClass(object); } isClass = JKClassNull; } if((rerunningAfterClassFormatter == NO) && (
@@ -2787,7 +2787,7 @@
for(id keyObject in enumerateObject) {
if(JK_EXPECT_T(printComma)) { if(JK_EXPECT_F(jk_encode_write1(encodeState, 0L, ","))) { return(1); } }
- if(JK_EXPECT_F((keyObject->isa != encodeState->fastClassLookup.stringClass)) && JK_EXPECT_F(([keyObject isKindOfClass:[NSString class]] == NO))) { jk_encode_error(encodeState, @"Key must be a string object."); return(1); }
+ if(JK_EXPECT_F((object_getClass(keyObject) != encodeState->fastClassLookup.stringClass)) && JK_EXPECT_F(([keyObject isKindOfClass:[NSString class]] == NO))) { jk_encode_error(encodeState, @"Key must be a string object."); return(1); } if(JK_EXPECT_F(jk_encode_add_atom_to_buffer(encodeState, keyObject))) { return(1); }
if(JK_EXPECT_F(jk_encode_write1(encodeState, 0L, ":"))) { return(1); }
if(JK_EXPECT_F(jk_encode_add_atom_to_buffer(encodeState, (void *)CFDictionaryGetValue((CFDictionaryRef)object, keyObject)))) { return(1); }
@@ -2798,7 +2798,7 @@
for(idx = 0L; idx < dictionaryCount; idx++) {
if(JK_EXPECT_T(printComma)) { if(JK_EXPECT_F(jk_encode_write1(encodeState, 0L, ","))) { return(1); } }
- if(JK_EXPECT_F(((id)keys[idx])->isa != encodeState->fastClassLookup.stringClass) && JK_EXPECT_F([(id)keys[idx] isKindOfClass:[NSString class]] == NO)) { jk_encode_error(encodeState, @"Key must be a string object."); return(1); }
+ if(JK_EXPECT_F(object_getClass(keys[idx]) != encodeState->fastClassLookup.stringClass) && JK_EXPECT_F([(id)keys[idx] isKindOfClass:[NSString class]] == NO)) { jk_encode_error(encodeState, @"Key must be a string object."); return(1); } if(JK_EXPECT_F(jk_encode_add_atom_to_buffer(encodeState, keys[idx]))) { return(1); }
if(JK_EXPECT_F(jk_encode_write1(encodeState, 0L, ":"))) { return(1); }
if(JK_EXPECT_F(jk_encode_add_atom_to_buffer(encodeState, objects[idx]))) { return(1); }
--- a/Other/Adium Spotlight Importer/GetMetadataForFile.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Other/Adium Spotlight Importer/GetMetadataForFile.m Sun Sep 09 12:24:39 2012 -0400
@@ -57,24 +57,23 @@
/* Return TRUE if successful, FALSE if there was no data provided */
if (CFStringCompare(contentTypeUTI, (CFStringRef)@"com.adiumx.htmllog", kCFCompareBackwards) == kCFCompareEqualTo) {
- success = GetMetadataForHTMLLog((NSMutableDictionary *)attributes, (NSString *)pathToFile);
+ success = GetMetadataForHTMLLog((__bridge NSMutableDictionary *)attributes, (__bridge NSString *)pathToFile); } else if (CFStringCompare(contentTypeUTI, (CFStringRef)@"com.adiumx.xmllog", kCFCompareBackwards) == kCFCompareEqualTo) {
- success = GetMetadataForXMLLog((NSMutableDictionary *)attributes, (NSString *)pathToFile);
+ success = GetMetadataForXMLLog((__bridge_transfer NSMutableDictionary *)attributes, (__bridge NSString *)pathToFile); NSLog(@"We were passed %@, of type %@, which is an unknown type",pathToFile,contentTypeUTI);
static CFStringRef ResolveUTI(CFStringRef contentTypeUTI, NSURL *urlToFile) {
//Deteremine the UTI type if we weren't passed one
- CFStringRef pathExtension = (CFStringRef)[urlToFile pathExtension];
+ CFStringRef pathExtension = (__bridge CFStringRef)[urlToFile pathExtension]; if (contentTypeUTI == NULL) {
if (CFStringCompare(pathExtension, CFSTR("chatLog"), (kCFCompareBackwards | kCFCompareCaseInsensitive)) == kCFCompareEqualTo) {
contentTypeUTI = CFSTR("com.adiumx.xmllog");
@@ -89,7 +88,7 @@
NSData *CopyDataForURL(CFStringRef contentTypeUTI, NSURL *urlToFile) {
contentTypeUTI = ResolveUTI(contentTypeUTI, urlToFile);
@@ -120,7 +119,7 @@
NSData *CopyDataForFile(CFStringRef contentTypeUTI, CFStringRef pathToFile) {
- return CopyDataForURL(contentTypeUTI, [NSURL fileURLWithPath:(NSString *)pathToFile]);
+ return CopyDataForURL(contentTypeUTI, [NSURL fileURLWithPath:(__bridge NSString *)pathToFile]); CFStringRef CopyTextContentForFileData(CFStringRef contentTypeUTI, NSURL *urlToFile, NSData *fileData) {
@@ -135,7 +134,7 @@
} else if (CFEqual(contentTypeUTI, CFSTR("com.adiumx.xmllog"))) {
result = CopyTextContentForXMLLogData(fileData);
- return (CFStringRef)result;
+ return (__bridge CFStringRef)result; @@ -153,7 +152,7 @@
NSData *logData = CopyDataForFile(contentTypeUTI, pathToFile);
- CFStringRef textContent = CopyTextContentForFileData(contentTypeUTI, [NSURL fileURLWithPath:(NSString *)pathToFile], logData);
+ CFStringRef textContent = CopyTextContentForFileData(contentTypeUTI, [NSURL fileURLWithPath:(__bridge NSString *)pathToFile], logData); @@ -244,18 +243,13 @@
[attributes setObject:[NSString stringWithFormat:@"%@ on %@",toUID,[dateFormatter stringFromDate:startDate]]
forKey:(NSString *)kMDItemDisplayName];
- [dateFormatter release];
- [otherAuthors release];
[attributes setObject:@"Chat log"
forKey:(NSString *)kMDItemKind];
[attributes setObject:@"Adium"
forKey:(NSString *)kMDItemCreator];
@@ -322,14 +316,11 @@
if (messages.count) contentString = [messages componentsJoinedByString:@" "];
#ifdef AILogWithSignature
AILogWithSignature(@"Parsing log failed: %@", err);
- [contentString retain];
--- a/Other/Adium Spotlight Importer/GetMetadataForHTMLLog-Additions.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Other/Adium Spotlight Importer/GetMetadataForHTMLLog-Additions.m Sun Sep 09 12:24:39 2012 -0400
@@ -129,11 +129,11 @@
NSData *data = [NSData dataWithContentsOfFile:path];
- string = [[[NSString alloc] initWithData:data
- encoding:NSUTF8StringEncoding] autorelease];
+ string = [[NSString alloc] initWithData:data + encoding:NSUTF8StringEncoding]; - string = [[[NSString alloc] initWithData:data
- encoding:NSASCIIStringEncoding] autorelease];
+ string = [[NSString alloc] initWithData:data + encoding:NSASCIIStringEncoding]; @@ -163,7 +163,7 @@
- (NSString *)stringByUnescapingFromXMLWithEntities:(NSDictionary *)entities
if (floor(NSFoundationVersionNumber) > NSFoundationVersionNumber10_3) {
- return [(NSString *)CFXMLCreateStringByUnescapingEntities(kCFAllocatorDefault, (CFStringRef)self, (CFDictionaryRef)entities) autorelease];
+ return (__bridge_transfer NSString *)CFXMLCreateStringByUnescapingEntities(kCFAllocatorDefault, (__bridge CFStringRef)self, (__bridge CFDictionaryRef)entities); --- a/Other/Adium Spotlight Importer/GetMetadataForHTMLLog.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Other/Adium Spotlight Importer/GetMetadataForHTMLLog.m Sun Sep 09 12:24:39 2012 -0400
@@ -111,8 +111,6 @@
[attributes setObject:textContent
forKey:(NSString *)kMDItemTextContent];
[attributes setObject:serviceClass
forKey:@"com_adiumX_service"];
--- a/Plugins/Bonjour/AWBonjourAccount.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Bonjour/AWBonjourAccount.m Sun Sep 09 12:24:39 2012 -0400
@@ -45,7 +45,7 @@
#import <Adium/AIStatus.h>
#import <Adium/ESFileTransfer.h>
#import <AIUtilities/AIMutableOwnerArray.h>
-#import <AIUtilities/AIObjectAdditions.h>
#import <AIUtilities/AIImageAdditions.h>
#import <AIUtilities/AIImageDrawingAdditions.h>
#import <Adium/AIFileTransferControllerProtocol.h>
@@ -73,10 +73,7 @@
/* Releasing libezv leads to the libezvContacts set being accessed;
* if it has been released but not set to nil, this results in a crash.
- [libezvContacts release]; libezvContacts = nil;
- (BOOL)disconnectOnFastUserSwitch
@@ -180,7 +177,7 @@
NSString *contactStatusMessage = contact.statusMessage;
- [listContact setStatusMessage:(contactStatusMessage ? [[[NSAttributedString alloc] initWithString:contactStatusMessage] autorelease] : nil)
+ [listContact setStatusMessage:(contactStatusMessage ? [[NSAttributedString alloc] initWithString:contactStatusMessage] : nil) NSDate *idleSinceDate = [contact idleSinceDate];
@@ -243,10 +240,10 @@
- attributedMessage = [[[NSAttributedString alloc] initWithString:
+ attributedMessage = [[NSAttributedString alloc] initWithString: [adium.contentController decryptedIncomingMessage:message
- onAccount:self]] autorelease];
msgObj = [AIContentMessage messageInChat:chat
@@ -356,7 +353,6 @@
[XHTMLDecoder setGeneratesStrictXHTML:YES];
[XHTMLDecoder setClosesFontTags:YES];
NSString *encodedMessage = [XHTMLDecoder encodeHTML:inContentMessage.message imagesPath:nil];
- [XHTMLDecoder release];
@@ -580,7 +576,6 @@
[libezv startOutgoingFileTransfer:ezvFileTransfer];
[fileTransfer setStatus:Waiting_on_Remote_User_FileTransfer];
- [ezvFileTransfer release];
#pragma mark Outgoing file transfer status updates
--- a/Plugins/Bonjour/libezv/Classes/AWEzv.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Bonjour/libezv/Classes/AWEzv.m Sun Sep 09 12:24:39 2012 -0400
@@ -59,9 +59,6 @@
//Ensure we log out before deallocing
- (id <AWEzvClientProtocol, NSObject>) client {
@@ -76,8 +73,7 @@
- (void) setName:(NSString *)newName {
- name = [newName retain];
@@ -87,14 +83,11 @@
- (void) setIdleTime:(NSDate *)date {
- idleTime = [date retain];
--- a/Plugins/Bonjour/libezv/Classes/AWEzvContact.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Bonjour/libezv/Classes/AWEzvContact.h Sun Sep 09 12:24:39 2012 -0400
@@ -36,29 +36,29 @@
@class AWEzvXMLStream, AWEzvRendezvousData, AWEzvContactManager, NSImage, ServiceController, EKEzvOutgoingFileTransfer;
@interface AWEzvContact : NSObject <AWEzvXMLStreamProtocol> {
- NSData *contactImageData;
+ NSData *__weak contactImageData;
+ NSDate *__weak idleSinceDate; - AWEzvRendezvousData *rendezvous;
+ AWEzvRendezvousData *__weak rendezvous; + NSString *__weak ipAddr; + NSString *__weak imageHash; AWEzvContactManager *manager;
- ServiceController *resolveServiceController;
- ServiceController *imageServiceController;
- ServiceController *addressServiceController;
+ ServiceController *__weak resolveServiceController; + ServiceController *__weak imageServiceController; + ServiceController *__weak addressServiceController; @property (readwrite, copy, nonatomic) NSString *uniqueID;
-@property (readwrite, retain, nonatomic) NSData *contactImageData;
-@property (readwrite, retain, nonatomic) NSString *imageHash;
+@property (weak, readwrite, nonatomic) NSData *contactImageData; +@property (weak, readwrite, nonatomic) NSString *imageHash; @property (readonly, nonatomic) AWEzvStatus status;
-@property (readonly, nonatomic) NSString *statusMessage;
-@property (readonly, retain, nonatomic) NSDate *idleSinceDate;
-@property (readonly, retain, nonatomic) NSString *name;
+@property (weak, readonly, nonatomic) NSString *statusMessage; +@property (weak, readonly, nonatomic) NSDate *idleSinceDate; +@property (weak, readonly, nonatomic) NSString *name; - (void)sendMessage:(NSString *)message withHtml:(NSString *)html;
- (NSString *) fixHTML:(NSString *)html;
--- a/Plugins/Bonjour/libezv/Classes/AWEzvContact.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Bonjour/libezv/Classes/AWEzvContact.m Sun Sep 09 12:24:39 2012 -0400
@@ -59,22 +59,7 @@
[self.manager contactWillDeallocate:self];
- self.contactImageData = nil;
- self.idleSinceDate = nil;
self.stream.delegate = nil;
- self.resolveServiceController = nil;
- self.imageServiceController = nil;
- self.addressServiceController = nil;
#pragma mark Sending Messages
@@ -108,13 +93,11 @@
[mutableString replaceOccurrencesOfString:@">" withString:@">"
options:NSLiteralSearch range:NSMakeRange(0, [mutableString length])];
messageExtraEscapedString = [mutableString copy];
- [mutableString release];
mutableString = [fixedHTML mutableCopy];
[mutableString replaceOccurrencesOfString:@"<br>" withString:@"<br />"
options:NSCaseInsensitiveSearch range:NSMakeRange(0, [mutableString length])];
htmlFiltered = [mutableString copy];
- [mutableString release];
messageNode = [[AWEzvXMLNode alloc] initWithType:AWEzvXMLElement name:@"message"];
@@ -144,19 +127,6 @@
[self.stream sendString:[messageNode xmlString]];
- [htmlMessageNode release];
- [htmlBodyNode release];
- [messageExtraEscapedString release];
- [htmlFiltered release];
[self setStatus: AWEzvUndefined];
@@ -205,7 +175,7 @@
[mutableHTML replaceOccurrencesOfString:@"pt" withString:@"px" options:NSCaseInsensitiveSearch range:NSMakeRange(findRange.location, NSMaxRange(nextSemicolon) - findRange.location)];
- return [mutableHTML autorelease];
#pragma mark Send Typing Notification
@@ -240,15 +210,6 @@
[self.stream sendString:[messageNode xmlString]];
- [composingNode release];
@@ -310,13 +271,6 @@
[self.stream sendString:[messageNode xmlString]];
@@ -367,11 +321,9 @@
connection = [[NSFileHandle alloc] initWithFileDescriptor:fd];
/* now to create stream */
- self.stream = [[[AWEzvXMLStream alloc] initWithFileHandle:connection initiator:1] autorelease];
+ self.stream = [[AWEzvXMLStream alloc] initWithFileHandle:connection initiator:1]; [self.stream setDelegate:self];
[self.stream readAndParse];
@@ -552,7 +504,6 @@
NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init];
NSNumber *size = [numberFormatter numberFromString:sizeString];
// unsigned long long size = [[numberFormatter numberFromString:sizeString] unsignedLongLongValue];
- [numberFormatter release];
/* Set up EKEzvFileTransfer object */
@@ -570,7 +521,6 @@
[self.manager.client.client user:self sentFile:fileTransfer];
- [fileTransfer release];
--- a/Plugins/Bonjour/libezv/Classes/EKEzvFileTransfer.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Bonjour/libezv/Classes/EKEzvFileTransfer.m Sun Sep 09 12:24:39 2012 -0400
@@ -14,8 +14,6 @@
[self setAccountData:nil];
@@ -32,8 +30,7 @@
//NSLog(@"in -setContact:, old value of contact: %@, changed to: %@", contact, aContact);
if (contact != aContact) {
- contact = [aContact retain];
@@ -49,8 +46,7 @@
//NSLog(@"in -setManager:, old value of manager: %@, changed to: %@", manager, aManager);
if (manager != aManager) {
- manager = [aManager retain];
@@ -116,8 +112,7 @@
//NSLog(@"in -setLocalFilename:, old value of localFilename: %@, changed to: %@", localFilename, aLocalFilename);
if (localFilename != aLocalFilename) {
- [localFilename release];
- localFilename = [aLocalFilename retain];
+ localFilename = aLocalFilename; @@ -133,8 +128,7 @@
//NSLog(@"in -setRemoteFilename:, old value of remoteFilename: %@, changed to: %@", remoteFilename, aRemoteFilename);
if (remoteFilename != aRemoteFilename) {
- [remoteFilename release];
- remoteFilename = [aRemoteFilename retain];
+ remoteFilename = aRemoteFilename; @@ -150,8 +144,7 @@
//NSLog(@"in -setUrl:, old value of url: %@, changed to: %@", url, anUrl);
@@ -167,8 +160,7 @@
//NSLog(@"in -setMimeType:, old value of mimeType: %@, changed to: %@", mimeType, aMimeType);
if (mimeType != aMimeType) {
- mimeType = [aMimeType retain];
@@ -184,8 +176,7 @@
//NSLog(@"in -setAccountData:, old value of accountData: %@, changed to: %@", accountData, anAccountData);
if (accountData != anAccountData) {
- accountData = [anAccountData retain];
+ accountData = anAccountData; @@ -237,8 +228,7 @@
//NSLog(@"in -setUniqueID:, old value of uniqueID: %@, changed to: %@", uniqueID, anUniqueID);
if (uniqueID != anUniqueID) {
- uniqueID = [anUniqueID retain];
--- a/Plugins/Bonjour/libezv/Classes/EKEzvIncomingFileTransfer.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Bonjour/libezv/Classes/EKEzvIncomingFileTransfer.m Sun Sep 09 12:24:39 2012 -0400
@@ -52,12 +52,6 @@
@implementation EKEzvIncomingFileTransfer
- [currentDownloads release];
- [encodedDownloads release];
currentDownloads = [[NSMutableArray alloc] initWithCapacity: 10];
@@ -80,8 +74,8 @@
for ( download in currentDownloads) {
- [currentDownloads release]; currentDownloads = nil;
- [encodedDownloads release]; encodedDownloads = nil;
+ currentDownloads = nil; + encodedDownloads = nil; @@ -89,7 +83,7 @@
/*We need to first get the xml for the layout */
NSURL *URL = [NSURL URLWithString:url];
- NSXMLDocument *documentRoot = [[[NSXMLDocument alloc] initWithContentsOfURL:URL options:0 error:&error] autorelease];
+ NSXMLDocument *documentRoot = [[NSXMLDocument alloc] initWithContentsOfURL:URL options:0 error:&error]; [[[[self manager] client] client] remoteCanceledFileTransfer:self];
@@ -154,8 +148,6 @@
- [permissionsToApply retain];
[[[[self manager] client] client] remoteCanceledFileTransfer:self];
@@ -264,7 +256,7 @@
if ([permissionsToApply count] <= 0) {
- [permissionsToApply release]; permissionsToApply = nil;
+ permissionsToApply = nil; NSDictionary *attributes;
@@ -275,11 +267,11 @@
if (![defaultManager setAttributes:attributes ofItemAtPath:path error:NULL]) {
[[[manager client] client] reportError:[NSString stringWithFormat:@"Error applying permissions of %@ to file at %@", attributes, path] ofLevel: AWEzvError];
[[[manager client] client] remoteCanceledFileTransfer:self];
- [permissionsToApply release]; permissionsToApply = nil;
+ permissionsToApply = nil; - [permissionsToApply release]; permissionsToApply = nil;
+ permissionsToApply = nil; - (void)downloadURL:(NSURL *)downloadURL toPath:(NSString *)path
@@ -293,7 +285,7 @@
// create the connection with the request
// and start loading the data
- NSURLDownload *theDownload = [[[NSURLDownload alloc] initWithRequest:theRequest delegate:self] autorelease];
+ NSURLDownload *theDownload = [[NSURLDownload alloc] initWithRequest:theRequest delegate:self]; [currentDownloads addObject:theDownload];
// set the destination file now
@@ -314,7 +306,6 @@
[[[manager client] client] reportError:[NSString stringWithFormat: @"Download failed! Error - %@ %@",
[error localizedDescription],
[[error userInfo] objectForKey:NSURLErrorFailingURLStringErrorKey]] ofLevel: AWEzvError];
- (void)downloadDidFinish:(NSURLDownload *)download
@@ -338,7 +329,6 @@
[[[manager client] client] updateProgressForFileTransfer:self percent:[NSNumber numberWithFloat:percentComplete] bytesSent:[NSNumber numberWithLongLong:bytesReceived]];
[currentDownloads removeObject:download];
- (void)download:(NSURLDownload *)download didReceiveResponse:(NSURLResponse *)response
--- a/Plugins/Bonjour/libezv/Classes/EKEzvOutgoingFileTransfer.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Bonjour/libezv/Classes/EKEzvOutgoingFileTransfer.m Sun Sep 09 12:24:39 2012 -0400
@@ -61,16 +61,6 @@
- [randomString release];
@@ -85,8 +75,7 @@
- (void)setContactUID:(NSString *)newUID
if (contactUID != newUID) {
- contactUID = [newUID retain];
@@ -118,17 +107,11 @@
/* Now we send the correct information to the contact */
[self sendTransferMessage];
- /* Keep ourself around until the transfer is complete or cancelled */
- /* We called -[self retain] in startSending */
@@ -168,7 +151,7 @@
/*First we need to get the NSData for the xml to describe the directory contents*/
- directoryXMLData = [[self generateDirectoryXML] retain];
+ directoryXMLData = [self generateDirectoryXML]; /* Now we need to get the NSData for each item in the directory */
NSFileManager *fileManager = [NSFileManager defaultManager];
NSString *basePath = [[self localFilename] stringByAppendingString:@"/"];
@@ -237,14 +220,14 @@
NSString *newPath = [self localFilename];
- NSXMLElement *root = [[[NSXMLElement alloc] initWithName:@"dir"] autorelease];
+ NSXMLElement *root = [[NSXMLElement alloc] initWithName:@"dir"]; NSString *posixFlags = [self posixFlagsForPath: newPath];
[root addAttribute:[NSXMLNode attributeWithName:@"posixflags" stringValue:posixFlags]];
- NSXMLElement *name = [[[NSXMLElement alloc] initWithName:@"name" stringValue:[newPath lastPathComponent]] autorelease];
+ NSXMLElement *name = [[NSXMLElement alloc] initWithName:@"name" stringValue:[newPath lastPathComponent]]; NSArray *children = [self generateXMLFromDirectory:newPath];
@@ -285,13 +268,13 @@
// handle the creation of the directory xml
- NSXMLElement *directoryNode = [[[NSXMLElement alloc] initWithName:@"dir"] autorelease];
+ NSXMLElement *directoryNode = [[NSXMLElement alloc] initWithName:@"dir"]; NSString *posixFlags = [self posixFlagsForPath: newPath];
[directoryNode addAttribute:[NSXMLNode attributeWithName:@"posixflags" stringValue:posixFlags]];
- NSXMLElement *name = [[[NSXMLElement alloc] initWithName:@"name" stringValue:file] autorelease];
+ NSXMLElement *name = [[NSXMLElement alloc] initWithName:@"name" stringValue:file]; [directoryNode addChild:name];
NSArray *dirChildren = [self generateXMLFromDirectory:newPath];
@@ -303,7 +286,7 @@
[children addObject:directoryNode];
- NSXMLElement *fileXML = [[[NSXMLElement alloc] initWithName:@"file"] autorelease];
+ NSXMLElement *fileXML = [[NSXMLElement alloc] initWithName:@"file"]; NSString *mimeTypeString = [self mimeTypeForPath:newPath];
[fileXML addAttribute:[NSXMLNode attributeWithName:@"mimetype" stringValue:mimeTypeString]];
@@ -318,7 +301,7 @@
[fileXML addAttribute:[NSXMLNode attributeWithName:@"size" stringValue:sizeString]];
- NSXMLElement *name = [[[NSXMLElement alloc] initWithName:@"name" stringValue:file] autorelease];
+ NSXMLElement *name = [[NSXMLElement alloc] initWithName:@"name" stringValue:file]; /*Now add this to the array */
@@ -336,7 +319,7 @@
URI = [URI stringByAppendingString:[[NSProcessInfo processInfo] globallyUniqueString]];
- randomString = [[URI stringByAppendingString:@"/"] retain];
+ randomString = [URI stringByAppendingString:@"/"]; URI = [URI stringByAppendingPathComponent:[[[self localFilename] lastPathComponent] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
@@ -479,10 +462,10 @@
if ([URI hasPrefix:randomString] && ([URI length] > [randomString length])) {
NSString *path = [URI substringFromIndex:[randomString length]];
- data = [(NSString *)[urlData valueForKey:path] retain];
+ data = (NSString *)[urlData valueForKey:path]; [urlData removeObjectForKey:path];
- return [data autorelease];
- (NSString *)posixFlagsForPath:(NSString *)filePath
@@ -491,7 +474,7 @@
NSDictionary *attributes = [[NSFileManager defaultManager] attributesOfItemAtPath:filePath error:NULL];
if (attributes && [attributes objectForKey:NSFilePosixPermissions]) {
NSNumber *posixInfo = [attributes objectForKey:NSFilePosixPermissions];
- posixFlags = [NSString stringWithFormat:@"%X", [posixInfo longValue]];
+ posixFlags = [NSString stringWithFormat:@"%lX", [posixInfo longValue]]; @@ -500,10 +483,10 @@
- (NSString *)mimeTypeForPath:(NSString *)filePath
- NSString *UTI = [(NSString *)UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension,
- (CFStringRef)[filePath pathExtension],
- mime = [(NSString *)UTTypeCopyPreferredTagWithClass((CFStringRef)UTI, kUTTagClassMIMEType) autorelease];
+ NSString *UTI = (__bridge_transfer NSString *)UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, + (__bridge CFStringRef)[filePath pathExtension], + mime = (__bridge_transfer NSString *)UTTypeCopyPreferredTagWithClass((__bridge CFStringRef)UTI, kUTTagClassMIMEType); if (!mime || [mime length] == 0)
mime = @"application/octet-stream";
--- a/Plugins/Bonjour/libezv/Private Classes/AWEzvContactManager.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Bonjour/libezv/Private Classes/AWEzvContactManager.h Sun Sep 09 12:24:39 2012 -0400
@@ -40,7 +40,7 @@
NSFileHandle *listenSocket;
NSMutableDictionary *contacts;
/* Listener related instance variables */
@@ -67,7 +67,7 @@
- (AWEzvContact *)contactForIdentifier:(NSString *)uniqueID;
-@property (readonly, nonatomic) AWEzv *client;
+@property (weak, readonly, nonatomic) AWEzv *client; - (void)closeConnections;
--- a/Plugins/Bonjour/libezv/Private Classes/AWEzvContactManager.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Bonjour/libezv/Private Classes/AWEzvContactManager.m Sun Sep 09 12:24:39 2012 -0400
@@ -56,8 +56,8 @@
avInstanceName = [[NSString alloc] initWithFormat:@"%@@%@",
- (consoleUser ? (NSString *)consoleUser : @""),
- (computerName ? (NSString *)computerName : @"")];
+ (consoleUser ? (__bridge NSString *)consoleUser : @""), + (computerName ? (__bridge NSString *)computerName : @"")]; if (consoleUser) CFRelease(consoleUser);
if (computerName) CFRelease(computerName);
@@ -90,10 +90,8 @@
/* AWEzvContactManagerListener adds an observer; remove it */
[[NSNotificationCenter defaultCenter] removeObserver:self];
- [userAnnounceData release]; userAnnounceData = nil;
- [avInstanceName release]; avInstanceName = nil;
+ userAnnounceData = nil; --- a/Plugins/Bonjour/libezv/Private Classes/AWEzvContactManagerListener.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Bonjour/libezv/Private Classes/AWEzvContactManagerListener.m Sun Sep 09 12:24:39 2012 -0400
@@ -106,7 +106,6 @@
if (listenSocket != nil) {
[listenSocket closeFile];
- [listenSocket release];
@@ -138,7 +137,7 @@
ipAddr = [NSString stringWithUTF8String:inet_ntoa((&remoteAddress)->sin_addr)];
AILog(@"%s: Remote IP address (basis of contactIdentifier) is %@", __PRETTY_FUNCTION__, ipAddr);
- contactIdentifier = [[ipAddr mutableCopy] autorelease];
+ contactIdentifier = [ipAddr mutableCopy]; [contactIdentifier replaceOccurrencesOfString:@"."
@@ -167,7 +166,6 @@
[contact setManager:self];
/* save contact in dictionary */
[contacts setObject:contact forKey:contactIdentifier];
@@ -182,7 +180,6 @@
[stream setDelegate:contact];
--- a/Plugins/Bonjour/libezv/Private Classes/AWEzvContactManagerRendezvous.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Bonjour/libezv/Private Classes/AWEzvContactManagerRendezvous.m Sun Sep 09 12:24:39 2012 -0400
@@ -78,7 +78,7 @@
- (void)breakdownServiceController;
- (DNSServiceRef)serviceRef;
-@property (readonly, nonatomic) AWEzvContactManager *contactManager;
+@property (weak, readonly, nonatomic) AWEzvContactManager *contactManager; @end // Interface ServiceController
@@ -188,7 +188,7 @@
/* Length of txt record in bytes, 0 for NULL txt record */ TXTRecordGetLength(&txtRecord) ,
/* Txt record properly formatted, may be NULL */ TXTRecordGetBytesPtr(&txtRecord) ,
/* Call back function, may be NULL */ register_reply,
- /* Application context pointer, may be null */ self
+ /* Application context pointer, may be null */ (__bridge void *)(self) if (dnsError == kDNSServiceErr_NoError) {
@@ -214,12 +214,12 @@
AILogWithSignature(@"isDisconnecting");
- [fServiceBrowser release]; fServiceBrowser = nil;
// Remove Resolvers, this also deallocates the DNSServiceReferences
if (fDomainBrowser != nil) {
AILogWithSignature(@"Releasing %@",fDomainBrowser);
- [fDomainBrowser release]; fDomainBrowser = nil;
@@ -385,8 +385,8 @@
CC_SHA1_Update(&ctx, [JPEGData bytes], (CC_LONG)[JPEGData length]);
CC_SHA1_Final(digest, &ctx);
- imagehash = [[NSData dataWithBytes:digest length:20] retain];
- AILogWithSignature(@"Will update with hash %@; length is %u", imagehash, [JPEGData length]);
+ imagehash = [NSData dataWithBytes:digest length:20]; + AILogWithSignature(@"Will update with hash %@; length is %lu", imagehash, [JPEGData length]); [[client client] reportError:@"Error adding image record" ofLevel:AWEzvWarning];
@@ -396,7 +396,7 @@
- [userAnnounceData setField:@"phsh" content:[imagehash autorelease]];
+ [userAnnounceData setField:@"phsh" content:imagehash]; [self updateAnnounceInfo];
@@ -409,10 +409,7 @@
// Start browsing the network for new rendezvous clients
- [fServiceBrowser release]; fServiceBrowser = nil;
- // Destroy old contact dictionary if one exists
// Allocate new contact dictionary
contacts = [[NSMutableDictionary alloc] init];
@@ -427,7 +424,7 @@
/* Registration type */ "_presence._tcp",
/* Domain, may be null for default */ NULL,
/* CallBack function */ handle_av_browse_reply,
- /* Context, may be null */ self);
+ /* Context, may be null */ (__bridge void *)(self)); if (avBrowseError == kDNSServiceErr_NoError) {
fServiceBrowser = [[ServiceController alloc] initWithServiceRef:browsRef forContactManager:self];
@@ -441,8 +438,8 @@
// Stop looking for new rendezvous clients
- AILogWithSignature(@"fServiceBrowser is %@ (retain count %i)", fServiceBrowser, [fServiceBrowser retainCount]);
- [fServiceBrowser release]; fServiceBrowser = nil;
+ AILogWithSignature(@"fServiceBrowser is %@)", fServiceBrowser); // Handle a message from our browser
@@ -473,7 +470,6 @@
// Save contact in dictionary
[contacts setObject:contact forKey:replyNameString];
DNSServiceRef resolveRef;
@@ -487,14 +483,13 @@
/* Registration type */ "_presence._tcp" /* replyType */,
/* Domain */ replyDomain,
/* Callback */ resolve_reply,
- /* Contxt, may be NULL */ contact
+ /* Contxt, may be NULL */ (__bridge void *)contact if (resolveRefError == kDNSServiceErr_NoError) {
ServiceController *serviceResolver = [[ServiceController alloc] initWithServiceRef:resolveRef forContactManager:self];
[contact setResolveServiceController:serviceResolver];
[[contact resolveServiceController] addToCurrentRunLoop];
- [serviceResolver release];
[[client client] reportError:@"Could not search for TXT records" ofLevel:AWEzvConnectionError];
@@ -524,13 +519,12 @@
DNSServiceRef serviceRef;
err = DNSServiceQueryRecord( &serviceRef, (DNSServiceFlags) 0, interface, [host UTF8String],
- kDNSServiceType_A, kDNSServiceClass_IN, AddressQueryRecordReply, contact);
+ kDNSServiceType_A, kDNSServiceClass_IN, AddressQueryRecordReply, (__bridge void *)contact); if (err == kDNSServiceErr_NoError) {
ServiceController *temp = [[ServiceController alloc] initWithServiceRef:serviceRef forContactManager:self];
[contact setAddressServiceController:temp];
[[contact addressServiceController] addToCurrentRunLoop];
[[client client] reportError:@"Error finding adress for contact" ofLevel:AWEzvError];
@@ -553,7 +547,6 @@
// Save contact in dictionary
[contacts setObject:contact forKey:contact.uniqueID];
[[client client] reportError:@"Contact to update not in dictionary and has bad identifier" ofLevel:AWEzvError];
@@ -593,7 +586,7 @@
[contact setImageServiceController: nil];
- AILogWithSignature(@"%@ -> %@ (%i)", [NSData dataWithBytes:data length:dataLen], [[[NSImage alloc] initWithData:[NSData dataWithBytes:data length:dataLen]] autorelease], dataLen);
+ AILogWithSignature(@"%@ -> %@ (%i)", [NSData dataWithBytes:data length:dataLen], [[NSImage alloc] initWithData:[NSData dataWithBytes:data length:dataLen]], dataLen); @@ -629,7 +622,6 @@
// Save contact in dictionary
[contacts setObject:contact forKey:contact.uniqueID];
[[client client] reportError:@"Contact to update not in dictionary and has bad identifier" ofLevel:AWEzvError];
@@ -661,10 +653,10 @@
nick = [rendezvousData getField:@"last"];
- mutableNick = [[nick mutableCopy] autorelease];
+ mutableNick = [nick mutableCopy]; [mutableNick appendString:@" "];
[mutableNick appendString:[rendezvousData getField:@"last"]];
- nick = [[mutableNick copy] autorelease];
+ nick = [mutableNick copy]; } else if (nick == nil) {
nick = @"Unnamed contact";
@@ -712,13 +704,12 @@
NSString *dnsname = [NSString stringWithFormat:@"%@%s", contact.uniqueID,"._presence._tcp.local."];
err = DNSServiceQueryRecord( &serviceRef, (DNSServiceFlags) 0, interface, [dnsname UTF8String],
- kDNSServiceType_NULL, kDNSServiceClass_IN, ImageQueryRecordReply, contact);
+ kDNSServiceType_NULL, kDNSServiceClass_IN, ImageQueryRecordReply, (__bridge void *)contact); if ( err == kDNSServiceErr_NoError) {
ServiceController *temp = [[ServiceController alloc] initWithServiceRef:serviceRef forContactManager:self];
AILogWithSignature(@"requesting image with %@", temp);
[contact setImageServiceController:temp];
[[contact imageServiceController] addToCurrentRunLoop];
[contact setImageHash: NULL];
[[client client] reportError:@"Error finding image for contact" ofLevel:AWEzvError];
@@ -753,8 +744,7 @@
- (void)setInstanceName:(NSString *)newName
if (avInstanceName != newName) {
- [avInstanceName release];
- avInstanceName = [newName retain];
+ avInstanceName = newName; @@ -805,13 +795,12 @@
void register_reply(DNSServiceRef sdRef, DNSServiceFlags flags, DNSServiceErrorType errorCode, const char *name, const char *regtype, const char *domain, void *context)
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- AWEzvContactManager *self = context;
- [self setInstanceName:[NSString stringWithUTF8String:name]];
- [self regCallBack:errorCode];
+ AWEzvContactManager *self = (__bridge AWEzvContactManager *)context; + [self setInstanceName:[NSString stringWithUTF8String:name]]; + [self regCallBack:errorCode]; void image_register_reply(
@@ -821,16 +810,16 @@
DNSServiceErrorType errorCode,
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- if (errorCode != kDNSServiceErr_NoError) {
- AWEzvLog(@"error %d registering image record", errorCode);
- AWEzvContactManager *self = context;
+ if (errorCode != kDNSServiceErr_NoError) { + AWEzvLog(@"error %d registering image record", errorCode); + AWEzvContactManager *self = (__bridge AWEzvContactManager *)context;
#pragma mark mDNS Browse Callback
@@ -849,19 +838,19 @@
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- // Received a browser reply from DNSServiceBrowse for av, now must handle processing the list of results
- if (errorCode == kDNSServiceErr_NoError) {
- AWEzvContactManager *self = context;
- if (![[self myInstanceName] isEqualToString:[NSString stringWithUTF8String:serviceName]]) {
- [self browseResultwithFlags:flags onInterface:interfaceIndex name:serviceName type:regtype domain:replyDomain av:YES];
+ // Received a browser reply from DNSServiceBrowse for av, now must handle processing the list of results + if (errorCode == kDNSServiceErr_NoError) { + AWEzvContactManager *self = (__bridge AWEzvContactManager *)context; + if (![[self myInstanceName] isEqualToString:[NSString stringWithUTF8String:serviceName]]) { + [self browseResultwithFlags:flags onInterface:interfaceIndex name:serviceName type:regtype domain:replyDomain av:YES]; + AWEzvLog(@"Error browsing");
- AWEzvLog(@"Error browsing");
#pragma mark mDNS Resolve Callback
@@ -882,22 +871,22 @@
const unsigned char *txtRecord,
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- if (errorCode == kDNSServiceErr_NoError) {
- // Use TXTRecord methods to resolve this
- AWEzvContact *contact = context;
- AWEzvContactManager *self = [contact manager];
- // AWEzvLog(@"Would update contact");
- AWEzvRendezvousData *data;
- data = [[[AWEzvRendezvousData alloc] initWithTXTRecordRef:txtRecord length:txtLen] autorelease];
- [self findAddressForContact:contact withHost:[NSString stringWithUTF8String:hosttarget] withInterface:interfaceIndex];
- [self updateContact:contact withData:data withHost:[NSString stringWithUTF8String:hosttarget] withInterface:interfaceIndex withPort:ntohs(port) av:YES];
- AWEzvLog(@"Error resolving records");
+ if (errorCode == kDNSServiceErr_NoError) { + // Use TXTRecord methods to resolve this + AWEzvContact *contact = (__bridge AWEzvContact *)context; + AWEzvContactManager *self = [contact manager]; + // AWEzvLog(@"Would update contact"); + AWEzvRendezvousData *data; + data = [[AWEzvRendezvousData alloc] initWithTXTRecordRef:txtRecord length:txtLen]; + [self findAddressForContact:contact withHost:[NSString stringWithUTF8String:hosttarget] withInterface:interfaceIndex]; + [self updateContact:contact withData:data withHost:[NSString stringWithUTF8String:hosttarget] withInterface:interfaceIndex withPort:ntohs(port) av:YES]; + AWEzvLog(@"Error resolving records");
#pragma mark mDNS Address Callback
@@ -907,15 +896,14 @@
uint16_t rdlen, const void *rdata, uint32_t ttl, void *context )
// DNSServiceQueryRecord callback used to look up IP addresses.
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- AWEzvContact *contact = context;
- AWEzvContactManager *self = [contact manager];
- [self updateAddressForContact:contact addr:rdata addrLen:rdlen host:fullname interfaceIndex:interfaceIndex
- more:((flags & kDNSServiceFlagsMoreComing) != 0)];
+ AWEzvContact *contact = (__bridge AWEzvContact *)context; + AWEzvContactManager *self = [contact manager]; + [self updateAddressForContact:contact addr:rdata addrLen:rdlen host:fullname interfaceIndex:interfaceIndex + more:((flags & kDNSServiceFlagsMoreComing) != 0)]; #pragma mark mDNS Image Callback
@@ -925,17 +913,16 @@
uint16_t rdlen, const void *rdata, uint32_t ttl, void *context)
// DNSServiceQueryRecord callback used to look up buddy icon.
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- AWEzvContact *contact = context;
- AWEzvContactManager *self = [contact manager];
- if (errorCode == kDNSServiceErr_NoError) {
- if (flags & kDNSServiceFlagsAdd) {
- [self updateImageForContact:contact data:rdata dataLen:rdlen more:((flags & kDNSServiceFlagsMoreComing) != 0)];
+ AWEzvContact *contact = (__bridge AWEzvContact *)context; + AWEzvContactManager *self = [contact manager]; + if (errorCode == kDNSServiceErr_NoError) { + if (flags & kDNSServiceFlagsAdd) { + [self updateImageForContact:contact data:rdata dataLen:rdlen more:((flags & kDNSServiceFlagsMoreComing) != 0)];
#pragma mark Service Controller
@@ -949,44 +936,40 @@
static void ProcessSockData( CFSocketRef s, CFSocketCallBackType type, CFDataRef address, const void *data, void *info)
// CFRunloop callback that notifies dns_sd when new data appears on a DNSServiceRef's socket.
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- ServiceController *self = (ServiceController *)info;
- AILogWithSignature(@"Processing result for %@", self);
- DNSServiceErrorType err = DNSServiceProcessResult([self serviceRef]);
- if (err != kDNSServiceErr_NoError) {
- if ((err == kDNSServiceErr_Unknown) && !data) {
- // Try to accept(2) a connection. May be the cause of a hang on Tiger; see #7887.
- int socketFD = CFSocketGetNative(s);
- int childFD = accept(socketFD, /*addr*/ NULL, /*addrlen*/ NULL);
- AILog(@"%@: Service ref %p received an unknown error with no data; perhaps mDNSResponder crashed? Result of calling accept(2) on fd %d is %d; will disconnect with error",
- self, [self serviceRef], socketFD, childFD);
- // We don't actually *want* a connection, so close the socket immediately.
+ ServiceController *self = (__bridge ServiceController *)info; + AILogWithSignature(@"Processing result for %@", self); + DNSServiceErrorType err = DNSServiceProcessResult([self serviceRef]); + if (err != kDNSServiceErr_NoError) { + if ((err == kDNSServiceErr_Unknown) && !data) { + // Try to accept(2) a connection. May be the cause of a hang on Tiger; see #7887. + int socketFD = CFSocketGetNative(s); + int childFD = accept(socketFD, /*addr*/ NULL, /*addrlen*/ NULL); + AILog(@"%@: Service ref %p received an unknown error with no data; perhaps mDNSResponder crashed? Result of calling accept(2) on fd %d is %d; will disconnect with error", + self, [self serviceRef], socketFD, childFD); + // We don't actually *want* a connection, so close the socket immediately. + [[self contactManager] serviceControllerReceivedFatalError:self]; + [self breakdownServiceController]; + AILog(@"DNSServiceProcessResult() for socket descriptor %d returned an error! %d with CFSocketCallBackType %ld and data %s\n", + DNSServiceRefSockFD(info), err, type, data);
- [[self contactManager] serviceControllerReceivedFatalError:self];
- [self breakdownServiceController];
- AILog(@"DNSServiceProcessResult() for socket descriptor %d returned an error! %d with CFSocketCallBackType %d and data %s\n",
- DNSServiceRefSockFD(info), err, type, data);
- (id) initWithServiceRef:(DNSServiceRef) ref forContactManager:(AWEzvContactManager *)inContactManager
if ((self = [super init])) {
- contactManager = [inContactManager retain];
+ contactManager = inContactManager; @@ -995,7 +978,7 @@
- (boolean_t) addToCurrentRunLoop
// Add the service to the current runloop. Returns non-zero on success.
- CFSocketContext ctx = { 1, self, NULL, NULL, NULL };
+ CFSocketContext ctx = { 1, (__bridge void *)(self), NULL, NULL, NULL }; fSocketRef = CFSocketCreateWithNative(kCFAllocatorDefault, DNSServiceRefSockFD(fServiceRef),
kCFSocketReadCallBack, ProcessSockData, &ctx);
@@ -1029,8 +1012,6 @@
AILogWithSignature(@"%@", self);
[self breakdownServiceController];
- (void)breakdownServiceController
@@ -1057,7 +1038,7 @@
- [contactManager release]; contactManager = nil;
@end // Implementation ServiceController
--- a/Plugins/Bonjour/libezv/Private Classes/AWEzvContactPrivate.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Bonjour/libezv/Private Classes/AWEzvContactPrivate.h Sun Sep 09 12:24:39 2012 -0400
@@ -36,16 +36,16 @@
@interface AWEzvContact ()
@property (readwrite, nonatomic) AWEzvStatus status;
-@property (readwrite, retain, nonatomic) NSDate *idleSinceDate;
-@property (readwrite, retain, nonatomic) NSString *name;
-@property (readwrite, retain, nonatomic) AWEzvXMLStream *stream;
-@property (readwrite, retain, nonatomic) AWEzvRendezvousData *rendezvous;
-@property (readwrite, retain, nonatomic) NSString *ipAddr;
+@property (weak, readwrite, nonatomic) NSDate *idleSinceDate; +@property (weak, readwrite, nonatomic) NSString *name; +@property (readwrite, nonatomic, strong) AWEzvXMLStream *stream; +@property (weak, readwrite, nonatomic) AWEzvRendezvousData *rendezvous; +@property (weak, readwrite, nonatomic) NSString *ipAddr; @property (readwrite, nonatomic) u_int16_t port;
-@property (readwrite, retain, nonatomic) AWEzvContactManager *manager;
-@property (readwrite, retain, nonatomic) ServiceController * resolveServiceController;
-@property (readwrite, retain, nonatomic) ServiceController * imageServiceController;
-@property (readwrite, retain, nonatomic) ServiceController * addressServiceController;
+@property (readwrite, nonatomic, strong) AWEzvContactManager *manager; +@property (weak, readwrite, nonatomic) ServiceController * resolveServiceController; +@property (weak, readwrite, nonatomic) ServiceController * imageServiceController; +@property (weak, readwrite, nonatomic) ServiceController * addressServiceController; @property (readonly, nonatomic) int serial;
- (void)createConnection;
--- a/Plugins/Bonjour/libezv/Private Classes/AWEzvRendezvousData.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Bonjour/libezv/Private Classes/AWEzvRendezvousData.m Sun Sep 09 12:24:39 2012 -0400
@@ -48,7 +48,7 @@
-(AWEzvRendezvousData *) init
if ((self = [super init])) {
- keys = [[NSMutableDictionary dictionary] retain];
+ keys = [NSMutableDictionary dictionary]; @@ -72,7 +72,6 @@
/* check that the length is ok */
if ([data length] < (sizeof(subn) + 4 + sizeof(endn))) {
AWEzvLog(@"Invalid rendezvous announcement: length %u", [data length]);
@@ -83,7 +82,6 @@
version = ntohl(version);
AWEzvLog(@"Invalid rendezvous announcement: incorrect version: %u", version);
@@ -106,7 +104,6 @@
/* read length of field name */
if ([data length] < i + 2) {
AWEzvLog(@"Invalid rendezvous announcement at field name length");
@@ -119,17 +116,15 @@
if ([data length] < i + fieldLen) {
AWEzvLog(@"Invalid rendezvous announcement at field name");
tmpData = [NSData dataWithBytes:[data bytes] + i length:fieldLen];
- fieldName = [[[NSString alloc] initWithData:tmpData encoding:NSUTF8StringEncoding] autorelease];
+ fieldName = [[NSString alloc] initWithData:tmpData encoding:NSUTF8StringEncoding]; /* read length of field data */
if ([data length] < i + 2) {
AWEzvLog(@"Invalid rendezvous announcement at field data length");
@@ -145,14 +140,13 @@
if ([data length] < i + fieldLen) {
AWEzvLog(@"Invalid rendezvous announcement at field data");
tmpData = [NSData dataWithBytes:[data bytes] + i length:fieldLen];
- fieldContent = [[[NSString alloc] initWithData:tmpData encoding:NSUTF8StringEncoding] autorelease];
+ fieldContent = [[NSString alloc] initWithData:tmpData encoding:NSUTF8StringEncoding]; - fieldContent = [[[NSString alloc] initWithBytes:[data bytes] + i length:fieldLen encoding:NSUTF8StringEncoding] autorelease];
+ fieldContent = [[NSString alloc] initWithBytes:[data bytes] + i length:fieldLen encoding:NSUTF8StringEncoding]; @@ -187,14 +181,12 @@
/* check if there was an error in extraction */
AWEzvLog(@"Unable to extract XML into plist");
/* make sure it's an NSData, or reponds to getBytes:range: */
if (![extracted respondsToSelector:@selector(getBytes:range:)]) {
AWEzvLog(@"Extracted object from XML is not an NSData");
@@ -261,7 +253,7 @@
keyString = [NSString stringWithUTF8String: key];
- data = [[[NSString alloc] initWithBytes: value length: valLen encoding: NSUTF8StringEncoding] autorelease];
+ data = [[NSString alloc] initWithBytes: value length: valLen encoding: NSUTF8StringEncoding]; if (data != NULL && keyString != NULL) {
@@ -298,13 +290,6 @@
-/* deallocate, destroy our dictionary */
/* sets a field in the rendezvous data structures */
-(void) setField:(NSString *)fieldName content:(NSObject *)content {
if (content == nil || fieldName == nil)
@@ -322,7 +307,7 @@
/* get a field from the rendezvous data structure */
-(NSString *) getField:(NSString *)fieldName {
- return [[[keys objectForKey:fieldName] copy] autorelease];
+ return [[keys objectForKey:fieldName] copy]; /* return if a field exists */
@@ -337,7 +322,7 @@
/* return the dictionary */
-(NSDictionary *)dictionary {
- return [[keys copy] autorelease];
@@ -359,7 +344,6 @@
/* allocate NSData to create data in */
data = [[NSMutableData alloc] init];
/* add the subnegotiation string */
[data appendBytes:subn length:sizeof(subn)];
[data appendBytes:&serialBE length:4];
@@ -414,11 +398,10 @@
format:NSPropertyListXMLFormat_v1_0
errorDescription:&error];
infoData = [[NSMutableString alloc] initWithData:xmlData encoding:NSUTF8StringEncoding];
- [infoData autorelease];
/* and now we have the rendezvous data to return to the caller, the copy
converts it to immutable */
- return [[infoData copy] autorelease];
+ return [infoData copy]; @@ -426,7 +409,7 @@
* We add an ASCII 1 character every 255 characters for pascal string separation
-(NSString *)dataAsDNSTXT {
- NSMutableString *infoData = [[[self data] mutableCopy] autorelease]; /* data to be done */
+ NSMutableString *infoData = [[self data] mutableCopy]; /* data to be done */ unsigned long i; /* loop counter */
/* add the character \001 when we exceed 255 characters, required to allow announcement
@@ -437,7 +420,7 @@
/* return a copy so it is immutable */
- return [[infoData copy] autorelease];
+ return [infoData copy]; /* ichat AV style TXT record */
@@ -583,7 +566,7 @@
/* return copy so it is immutable */
- return [[data copy] autorelease];
/* ichat AV style TXT record */
@@ -612,7 +595,7 @@
hexdata[[(NSData *)value length] * 2] = '\0';
- [infoData appendFormat:@"%c", ([(NSData *)value length] * 2 + [key length] + 1)];
+ [infoData appendFormat:@"%c", (unsigned char)([(NSData *)value length] * 2 + [key length] + 1)]; [infoData appendString:key];
[infoData appendString:@"="];
[infoData appendString:[NSString stringWithUTF8String:hexdata]];
@@ -620,7 +603,7 @@
const char *val = [(NSString *)value UTF8String];
NSInteger len = strlen(val);
- [infoData appendFormat:@"%c", len + [key length] + 1];
+ [infoData appendFormat:@"%c", (unsigned char)(len + [key length] + 1)]; [infoData appendString:key];
[infoData appendString:@"="];
[infoData appendString:value];
--- a/Plugins/Bonjour/libezv/Private Classes/AWEzvStack.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Bonjour/libezv/Private Classes/AWEzvStack.h Sun Sep 09 12:24:39 2012 -0400
@@ -32,7 +32,7 @@
typedef struct stacklink {
+__unsafe_unretained id data; @interface AWEzvStack : NSObject {
--- a/Plugins/Bonjour/libezv/Private Classes/AWEzvStack.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Bonjour/libezv/Private Classes/AWEzvStack.m Sun Sep 09 12:24:39 2012 -0400
@@ -52,8 +52,6 @@
- (void) push:(id)value {
@@ -65,7 +63,7 @@
- newlink->data = [value retain];
@@ -78,7 +76,7 @@
- value = [toplink->data autorelease];
--- a/Plugins/Bonjour/libezv/Private Classes/AWEzvXMLNode.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Bonjour/libezv/Private Classes/AWEzvXMLNode.m Sun Sep 09 12:24:39 2012 -0400
@@ -51,25 +51,23 @@
- [children release]; children = nil;
- [attributes release]; attributes = nil;
- [name release]; name = nil;
- return [[children copy] autorelease];
+ return [children copy]; - (void) addChild:(AWEzvXMLNode *)node {
[children addObject:node];
- (NSDictionary *)attributes {
- return [[attributes copy] autorelease];
+ return [attributes copy]; - (void) addAttribute:(NSString *)property withValue:(NSString *)value {
@@ -88,8 +86,7 @@
- (void) setName:(NSString *)theName {
- name = [theName retain];
@@ -99,17 +96,17 @@
if (type == AWEzvXMLText) {
- string = [[name mutableCopy] autorelease];
+ string = [name mutableCopy]; [string replaceOccurrencesOfString:@"&" withString:@"&"
options:NSLiteralSearch range:NSMakeRange(0, [string length])];
[string replaceOccurrencesOfString:@"<" withString:@"<"
options:NSLiteralSearch range:NSMakeRange(0, [string length])];
[string replaceOccurrencesOfString:@">" withString:@">"
options:NSLiteralSearch range:NSMakeRange(0, [string length])];
- return [[string copy] autorelease];
} else if (type == AWEzvXMLRaw) {
- return [[name copy] autorelease];
string = [NSMutableString stringWithString:@"<"];
@@ -130,7 +127,7 @@
[string appendFormat:@"</%@>", name];
- return [[string copy] autorelease];
- (NSString *)description
@@ -155,6 +152,6 @@
[string appendFormat:@"</%@>", name];
- return [NSString stringWithFormat:@"<AWEzvXMLNode %x:type %i:\"%@\">",self,type,string];
+ return [NSString stringWithFormat:@"<AWEzvXMLNode %p:type %i:\"%@\">",self,type,string]; --- a/Plugins/Bonjour/libezv/Private Classes/AWEzvXMLStream.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Bonjour/libezv/Private Classes/AWEzvXMLStream.h Sun Sep 09 12:24:39 2012 -0400
@@ -38,19 +38,19 @@
@interface AWEzvXMLStream : NSObject {
- id <AWEzvXMLStreamProtocol> delegate;
- NSFileHandle *connection;
+ id <AWEzvXMLStreamProtocol> __weak delegate; + NSFileHandle *__weak connection; int initiator, negotiated;
- (id) initWithFileHandle:(NSFileHandle *)connection initiator:(int)initiator;
-@property (readonly, nonatomic) NSFileHandle *fileHandle;
+@property (weak, readonly, nonatomic) NSFileHandle *fileHandle; - (void) sendData:(NSData *)data;
- (void) sendString:(NSString *)string;
-@property (assign, readwrite, nonatomic) id<AWEzvXMLStreamProtocol> delegate;
+@property (weak, readwrite, nonatomic) id<AWEzvXMLStreamProtocol> delegate; /* Private methods: used by private implementation, do NOT use these methods */
- (void) xmlStartElement:(const XML_Char *)name attributes:(const XML_Char **)attributes;
@@ -66,5 +66,5 @@
- (void) XMLConnectionClosed;
- (void) XMLReceived:(AWEzvXMLNode *)root;
@property (readonly, copy, nonatomic) NSString *uniqueID;
-@property (readonly, retain, nonatomic) AWEzvContactManager *manager;
+@property (readonly, strong, nonatomic) AWEzvContactManager *manager; --- a/Plugins/Bonjour/libezv/Private Classes/AWEzvXMLStream.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Bonjour/libezv/Private Classes/AWEzvXMLStream.m Sun Sep 09 12:24:39 2012 -0400
@@ -62,7 +62,7 @@
- (id) initWithFileHandle:(NSFileHandle *)myConnection initiator:(int)myInitiator
if ((self = [super init])) {
- connection = [myConnection retain];
+ connection = myConnection; nodeStack = [[AWEzvStack alloc] init];
@@ -76,13 +76,10 @@
[[NSNotificationCenter defaultCenter] removeObserver:self];
@synthesize fileHandle = connection;
@@ -98,7 +95,7 @@
parser = XML_ParserCreate(NULL);
- XML_SetUserData(parser, self);
+ XML_SetUserData(parser, (__bridge void *)(self)); XML_SetElementHandler(parser, &xml_start_element, &xml_end_element);
XML_SetCharacterDataHandler(parser, &xml_char_data);
XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_NEVER);
@@ -138,8 +135,6 @@
if ([data length] == 0) {
- [[aNotification object] autorelease];
[delegate XMLConnectionClosed];
@@ -161,7 +156,7 @@
NSString *nodeName = [NSString stringWithUTF8String:name];
- AWEzvXMLNode *node = [[[AWEzvXMLNode alloc] initWithType:AWEzvXMLElement name:nodeName] autorelease];
+ AWEzvXMLNode *node = [[AWEzvXMLNode alloc] initWithType:AWEzvXMLElement name:nodeName]; while (*attributes != NULL) {
NSString *attribute = [NSString stringWithUTF8String:*attributes++];
@@ -227,7 +222,6 @@
[delegate XMLConnectionClosed];
@@ -245,7 +239,7 @@
if ((len == 1) && (*data == '\n'))
- newData = [[[NSString alloc] initWithData:[NSData dataWithBytes:data length:len] encoding:NSUTF8StringEncoding] autorelease];
+ newData = [[NSString alloc] initWithData:[NSData dataWithBytes:data length:len] encoding:NSUTF8StringEncoding]; if ([nodeStack size] > 0 && [(AWEzvXMLNode *)[nodeStack top] type] == AWEzvXMLText) {
@@ -254,7 +248,7 @@
- node = [[[AWEzvXMLNode alloc] initWithType:AWEzvXMLText name:newData] autorelease];
+ node = [[AWEzvXMLNode alloc] initWithType:AWEzvXMLText name:newData]; if ([nodeStack top] != nil)
[(AWEzvXMLNode *)[nodeStack top] addChild:node];
@@ -275,14 +269,14 @@
/* and make an element info structure */
CFXMLElementInfo xmlElementInfo;
- xmlElementInfo.attributes = (CFDictionaryRef)handshakeElements;
- xmlElementInfo.attributeOrder = (CFArrayRef)[NSArray arrayWithObjects:@"to", @"from", @"xmlns", @"xmlns:stream", nil];
+ xmlElementInfo.attributes = (__bridge CFDictionaryRef)handshakeElements; + xmlElementInfo.attributeOrder = (__bridge CFArrayRef)[NSArray arrayWithObjects:@"to", @"from", @"xmlns", @"xmlns:stream", nil]; xmlElementInfo.isEmpty = YES;
/* create node and tree, then convert to XML text */
CFXMLNodeRef xmlNode = CFXMLNodeCreate(NULL, kCFXMLNodeTypeElement, (CFStringRef)@"stream:stream", &xmlElementInfo, kCFXMLNodeCurrentVersion);
CFXMLTreeRef xmlTree = CFXMLTreeCreateWithNode(NULL, xmlNode);
- NSData *data = [(NSData *)CFXMLTreeCreateXMLData(NULL, xmlTree) autorelease];
+ NSData *data = (__bridge_transfer NSData *)CFXMLTreeCreateXMLData(NULL, xmlTree); @@ -304,19 +298,19 @@
void xml_start_element (void *userData,
- AWEzvXMLStream *self = userData;
+ AWEzvXMLStream *self = (__bridge AWEzvXMLStream *)userData; [self xmlStartElement:name attributes:atts];
void xml_end_element (void *userData,
- AWEzvXMLStream *self = userData;
+ AWEzvXMLStream *self = (__bridge AWEzvXMLStream *)userData; [self xmlEndElement:name];
void xml_char_data (void *userData,
- AWEzvXMLStream *self = userData;
+ AWEzvXMLStream *self = (__bridge AWEzvXMLStream *)userData; [self xmlCharData:s length:len];
--- a/Plugins/Bonjour/libezv/Simple HTTP Server/AsyncSocket.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Bonjour/libezv/Simple HTTP Server/AsyncSocket.m Sun Sep 09 12:24:39 2012 -0400
@@ -134,7 +134,6 @@
@implementation AsyncReadPacket
@@ -148,7 +147,7 @@
if ((self = [super init]))
readAllAvailableData = a;
@@ -158,13 +157,6 @@
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -180,7 +172,6 @@
- (id)initWithData:(NSData *)d timeout:(NSTimeInterval)t tag:(long)i;
@implementation AsyncWritePacket
@@ -189,7 +180,7 @@
if ((self = [super init]))
@@ -197,12 +188,6 @@
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -251,7 +236,7 @@
NSAssert (sizeof(CFSocketContext) == sizeof(CFStreamClientContext), @"CFSocketContext and CFStreamClientContext aren't the same size anymore. Contact the developer.");
- theContext.info = self;
+ theContext.info = (__bridge void *)(self); theContext.release = nil;
theContext.copyDescription = nil;
@@ -263,11 +248,8 @@
- [theReadQueue release];
- [theWriteQueue release];
[NSObject cancelPreviousPerformRequestsWithTarget:theDelegate selector:@selector(onSocketDidDisconnect:) object:self];
[NSObject cancelPreviousPerformRequestsWithTarget:self];
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -507,7 +489,7 @@
- err = CFSocketSetAddress (theSocket, (CFDataRef)address);
+ err = CFSocketSetAddress (theSocket, (__bridge CFDataRef)address); if (err != kCFSocketSuccess) goto Failed;
//NSLog(@"theSocket4: %hu", [self localPort:theSocket]);
@@ -526,7 +508,7 @@
- err = CFSocketSetAddress (theSocket6, (CFDataRef)address6);
+ err = CFSocketSetAddress (theSocket6, (__bridge CFDataRef)address6); if (err != kCFSocketSuccess) goto Failed;
//NSLog(@"theSocket6: %hu", [self localPort:theSocket6]);
@@ -741,7 +723,7 @@
// The MyCFSocketCallback method will be called when the connection succeeds or fails
- CFSocketError err = CFSocketConnectToAddress(theSocket, (CFDataRef)remoteAddr, -1);
+ CFSocketError err = CFSocketConnectToAddress(theSocket, (__bridge CFDataRef)remoteAddr, -1); if(err != kCFSocketSuccess)
if (errPtr) *errPtr = [self getSocketError];
@@ -750,7 +732,7 @@
- CFSocketError err = CFSocketConnectToAddress(theSocket6, (CFDataRef)remoteAddr, -1);
+ CFSocketError err = CFSocketConnectToAddress(theSocket6, (__bridge CFDataRef)remoteAddr, -1); if(err != kCFSocketSuccess)
if (errPtr) *errPtr = [self getSocketError];
@@ -767,7 +749,7 @@
- (void)doAcceptWithSocket:(CFSocketNativeHandle)newNative
- AsyncSocket *newSocket = [[[AsyncSocket alloc] initWithDelegate:theDelegate] autorelease];
+ AsyncSocket *newSocket = [[AsyncSocket alloc] initWithDelegate:theDelegate]; NSRunLoop *runLoop = nil;
@@ -874,7 +856,7 @@
- (BOOL)createStreamsToHost:(NSString *)hostname onPort:(UInt16)port error:(NSError **)errPtr
// Create the socket & streams.
- CFStreamCreatePairWithSocketToHost(kCFAllocatorDefault, (CFStringRef)hostname, port, &theReadStream, &theWriteStream);
+ CFStreamCreatePairWithSocketToHost(kCFAllocatorDefault, (__bridge CFStringRef)hostname, port, &theReadStream, &theWriteStream); if (theReadStream == NULL || theWriteStream == NULL)
if (errPtr) *errPtr = [self getStreamError];
@@ -1095,7 +1077,6 @@
- [partialReadBuffer release];
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(disconnect) object:nil];
@@ -1586,7 +1567,7 @@
NSMutableString *ms = [[NSMutableString alloc] init];
[ms appendString: [NSString stringWithFormat:@"<AsyncSocket %p", self]];
[ms appendString: [NSString stringWithFormat:@" local %@ remote %@ ", selfstr, peerstr]];
- [ms appendString: [NSString stringWithFormat:@"has queued %d reads %d writes, ", [theReadQueue count], [theWriteQueue count] ]];
+ [ms appendString: [NSString stringWithFormat:@"has queued %ld reads %ld writes, ", [theReadQueue count], [theWriteQueue count] ]]; if (theCurrentRead == nil)
[ms appendString: @"no current read, "];
@@ -1599,7 +1580,7 @@
- [ms appendString: [NSString stringWithFormat:@"currently read %u bytes (%d%% done), ",
+ [ms appendString: [NSString stringWithFormat:@"currently read %lu bytes (%d%% done), ", [theCurrentRead->buffer length],
theCurrentRead->bytesDone ? percentDone : 0]];
@@ -1615,7 +1596,7 @@
- [ms appendString: [NSString stringWithFormat:@"currently written %u (%d%%), ",
+ [ms appendString: [NSString stringWithFormat:@"currently written %lu (%d%%), ", [theCurrentWrite->buffer length],
theCurrentWrite->bytesDone ? percentDone : 0]];
@@ -1626,7 +1607,7 @@
- return [ms autorelease];
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -1648,9 +1629,6 @@
[theReadQueue addObject:packet];
[self scheduleDequeueRead];
- (void)readDataToData:(NSData *)data withTimeout:(NSTimeInterval)timeout tag:(long)tag
@@ -1668,9 +1646,6 @@
[theReadQueue addObject:packet];
[self scheduleDequeueRead];
- (void)readDataWithTimeout:(NSTimeInterval)timeout tag:(long)tag
@@ -1687,9 +1662,6 @@
[theReadQueue addObject:packet];
[self scheduleDequeueRead];
@@ -1714,7 +1686,7 @@
// Get new current read AsyncReadPacket.
AsyncReadPacket *newPacket = [theReadQueue objectAtIndex:0];
- theCurrentRead = [newPacket retain];
+ theCurrentRead = newPacket; [theReadQueue removeObjectAtIndex:0];
@@ -1845,7 +1817,6 @@
[theReadTimer invalidate];
- [theCurrentRead release];
@@ -1872,8 +1843,6 @@
[theWriteQueue addObject:packet];
[self scheduleDequeueWrite];
- (void)scheduleDequeueWrite
@@ -1888,7 +1857,7 @@
// Get new current write AsyncWritePacket.
AsyncWritePacket *newPacket = [theWriteQueue objectAtIndex:0];
- theCurrentWrite = [newPacket retain];
+ theCurrentWrite = newPacket; [theWriteQueue removeObjectAtIndex:0];
@@ -1969,7 +1938,6 @@
[theWriteTimer invalidate];
- [theCurrentWrite release];
[self maybeScheduleDisconnect];
@@ -2080,8 +2048,8 @@
- AsyncSocket *sock = [[(AsyncSocket *)pInfo retain] autorelease];
- [sock doCFSocketCallback:type forSocket:sref withAddress:(NSData *)address withData:pData];
+ AsyncSocket *sock = (__bridge AsyncSocket *)pInfo; + [sock doCFSocketCallback:type forSocket:sref withAddress:(__bridge NSData *)address withData:pData]; @@ -2094,7 +2062,7 @@
- AsyncSocket *sock = [[(AsyncSocket *)pInfo retain] autorelease];
+ AsyncSocket *sock = (__bridge AsyncSocket *)pInfo; [sock doCFReadStreamCallback:type forStream:stream];
@@ -2108,7 +2076,7 @@
- AsyncSocket *sock = [[(AsyncSocket *)pInfo retain] autorelease];
+ AsyncSocket *sock = (__bridge AsyncSocket *)pInfo; [sock doCFWriteStreamCallback:type forStream:stream];
--- a/Plugins/Bonjour/libezv/Simple HTTP Server/HTTPAuthenticationRequest.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Bonjour/libezv/Simple HTTP Server/HTTPAuthenticationRequest.m Sun Sep 09 12:24:39 2012 -0400
@@ -11,13 +11,13 @@
- (id)initWithRequest:(CFHTTPMessageRef)request
if ((self = [super init])) {
- NSString *authInfo = (NSString *)CFHTTPMessageCopyHeaderFieldValue(request, CFSTR("Authorization"));
+ NSString *authInfo = (__bridge_transfer NSString *)CFHTTPMessageCopyHeaderFieldValue(request, CFSTR("Authorization")); - username = [[self quotedSubHeaderFieldValue:@"username" fromHeaderFieldValue:authInfo] retain];
- realm = [[self quotedSubHeaderFieldValue:@"realm" fromHeaderFieldValue:authInfo] retain];
- nonce = [[self quotedSubHeaderFieldValue:@"nonce" fromHeaderFieldValue:authInfo] retain];
- uri = [[self quotedSubHeaderFieldValue:@"uri" fromHeaderFieldValue:authInfo] retain];
+ username = [self quotedSubHeaderFieldValue:@"username" fromHeaderFieldValue:authInfo]; + realm = [self quotedSubHeaderFieldValue:@"realm" fromHeaderFieldValue:authInfo]; + nonce = [self quotedSubHeaderFieldValue:@"nonce" fromHeaderFieldValue:authInfo]; + uri = [self quotedSubHeaderFieldValue:@"uri" fromHeaderFieldValue:authInfo]; // It appears from RFC 2617 that the qop is to be given unquoted
// Tests show that Firefox performs this way, but Safari does not
@@ -26,13 +26,10 @@
if (qop && ([qop characterAtIndex:0] == '"')) {
qop = [self quotedSubHeaderFieldValue:@"qop" fromHeaderFieldValue:authInfo];
- nc = [[self nonquotedSubHeaderFieldValue:@"nc" fromHeaderFieldValue:authInfo] retain];
- cnonce = [[self quotedSubHeaderFieldValue:@"cnonce" fromHeaderFieldValue:authInfo] retain];
- response = [[self quotedSubHeaderFieldValue:@"response" fromHeaderFieldValue:authInfo] retain];
+ nc = [self nonquotedSubHeaderFieldValue:@"nc" fromHeaderFieldValue:authInfo]; + cnonce = [self quotedSubHeaderFieldValue:@"cnonce" fromHeaderFieldValue:authInfo]; + response = [self quotedSubHeaderFieldValue:@"response" fromHeaderFieldValue:authInfo]; // Setup a default value for any non-pointer types
@@ -41,18 +38,6 @@
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
--- a/Plugins/Bonjour/libezv/Simple HTTP Server/HTTPServer.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Bonjour/libezv/Simple HTTP Server/HTTPServer.m Sun Sep 09 12:24:39 2012 -0400
@@ -70,13 +70,6 @@
// Stop the server if it's running
- // Release all instance variables
- [documentRoot release];
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -111,7 +104,6 @@
if (![documentRoot isEqual:value])
- [documentRoot release];
documentRoot = [value copy];
@@ -158,8 +150,7 @@
- (void)setTransfer:(EKEzvOutgoingFileTransfer *)newTransfer{
if (transfer !=newTransfer)
- transfer = [newTransfer retain];
+ transfer = newTransfer; - (EKEzvOutgoingFileTransfer *)transfer{
@@ -222,7 +213,6 @@
id newConnection = [[connectionClass alloc] initWithAsyncSocket:newSocket forServer:self];
[connections addObject:newConnection];
- [newConnection release];
@@ -264,7 +254,7 @@
if ((self = [super init]))
// Take over ownership of the socket
- asyncSocket = [newSocket retain];
+ asyncSocket = newSocket; [asyncSocket setDelegate:self];
// Store reference to server
@@ -288,10 +278,7 @@
if (request) CFRelease(request);
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -311,13 +298,13 @@
// NSString *requestVersion = [(NSString *)CFHTTPMessageCopyVersion(request) autorelease];
// NSURL *requestURI = [(NSURL *)CFHTTPMessageCopyRequestURL(request) autorelease];
- NSString *encoding = [(NSString *)CFHTTPMessageCopyHeaderFieldValue(request, CFSTR("Accept-Encoding")) autorelease];
+ NSString *encoding = (__bridge_transfer NSString *)CFHTTPMessageCopyHeaderFieldValue(request, CFSTR("Accept-Encoding")); if ([encoding isEqualToString:@"AppleSingle"]) {
- NSString *connection = [(NSString *)CFHTTPMessageCopyHeaderFieldValue(request, CFSTR("Connection")) autorelease];
+ NSString *connection = (__bridge_transfer NSString *)CFHTTPMessageCopyHeaderFieldValue(request, CFSTR("Connection")); if ([connection isEqualToString:@"keep-alive"]) {
@@ -327,14 +314,14 @@
// Check the HTTP version
// If it's anything but HTTP version 1.1, we don't support it
- NSString *version = [(NSString *)CFHTTPMessageCopyVersion(request) autorelease];
+ NSString *version = (__bridge_transfer NSString *)CFHTTPMessageCopyVersion(request); if (!version || ![version isEqualToString:(NSString *)kCFHTTPVersion1_1]) {
//NSLog(@"HTTP Server: Error 505 - Version Not Supported");
// Status Code 505 - Version Not Supported
- CFHTTPMessageRef response = CFHTTPMessageCreateResponse(kCFAllocatorDefault, 505, NULL, (CFStringRef)version);
+ CFHTTPMessageRef response = CFHTTPMessageCreateResponse(kCFAllocatorDefault, 505, NULL, (__bridge CFStringRef)version); CFHTTPMessageSetHeaderFieldValue(response, CFSTR("Content-Length"), CFSTR("0"));
- NSData *responseData = [(NSData *)CFHTTPMessageCopySerializedMessage(response) autorelease];
+ NSData *responseData = (__bridge_transfer NSData *)CFHTTPMessageCopySerializedMessage(response); [asyncSocket writeData:responseData withTimeout:WRITE_ERROR_TIMEOUT tag:HTTP_RESPONSE];
[[server transfer] userFailedDownload];
@@ -343,14 +330,14 @@
// If no method was passed, issue a Bad Request response
- NSString *method = [(NSString *)CFHTTPMessageCopyRequestMethod(request) autorelease];
+ NSString *method = (__bridge_transfer NSString *)CFHTTPMessageCopyRequestMethod(request); //NSLog(@"HTTP Server: Error 400 - Bad Request");
// Status Code 400 - Bad Request
CFHTTPMessageRef response = CFHTTPMessageCreateResponse(kCFAllocatorDefault, 400, NULL, kCFHTTPVersion1_1);
CFHTTPMessageSetHeaderFieldValue(response, CFSTR("Content-Length"), CFSTR("0"));
- NSData *responseData = [(NSData *)CFHTTPMessageCopySerializedMessage(response) autorelease];
+ NSData *responseData = (__bridge_transfer NSData *)CFHTTPMessageCopySerializedMessage(response); [asyncSocket writeData:responseData withTimeout:WRITE_ERROR_TIMEOUT tag:HTTP_RESPONSE];
[[server transfer] userFailedDownload];
@@ -358,7 +345,7 @@
- NSURL *uri = [(NSURL *)CFHTTPMessageCopyRequestURL(request) autorelease];
+ NSURL *uri = (__bridge_transfer NSURL *)CFHTTPMessageCopyRequestURL(request); // Respond properly to HTTP 'GET' and 'HEAD' commands
if ([method isEqualToString:@"GET"] || [method isEqualToString:@"HEAD"]) {
@@ -375,8 +362,8 @@
CFHTTPMessageRef response = CFHTTPMessageCreateResponse(kCFAllocatorDefault, 200, NULL, kCFHTTPVersion1_1);
[self setHeaderFields:response forURI:[uri relativeString] appleSingle: isAppleSingle keepAlive:isKeepAlive];
- NSString *contentLength = [NSString stringWithFormat:@"%i", [data length]];
- CFHTTPMessageSetHeaderFieldValue(response, CFSTR("Content-Length"), (CFStringRef)contentLength);
+ NSString *contentLength = [NSString stringWithFormat:@"%li", [data length]]; + CFHTTPMessageSetHeaderFieldValue(response, CFSTR("Content-Length"), (__bridge CFStringRef)contentLength); //NSDictionary *responseHeaders = [(NSDictionary *)CFHTTPMessageCopyAllHeaderFields(response) autorelease];
// NSLog(@"Sending Headers - %@", responseHeaders);
@@ -386,14 +373,14 @@
// If they issue a 'GET' command, we need to include the file
if ([method isEqual:@"HEAD"])
- NSData *responseData = [(NSData *)CFHTTPMessageCopySerializedMessage(response) autorelease];
+ NSData *responseData = (__bridge_transfer NSData *)CFHTTPMessageCopySerializedMessage(response); [asyncSocket writeData:responseData withTimeout:WRITE_HEAD_TIMEOUT tag:HTTP_RESPONSE];
// Previously, we would use the CFHTTPMessageSetBody method here.
// This caused problems, however, if the data was large.
// For example, if the data represented a 500 MB movie on the disk, this method would thrash the OS!
- NSData *responseData = [(NSData *)CFHTTPMessageCopySerializedMessage(response) autorelease];
+ NSData *responseData = (__bridge_transfer NSData *)CFHTTPMessageCopySerializedMessage(response); [asyncSocket writeData:responseData withTimeout:WRITE_HEAD_TIMEOUT tag:HTTP_PARTIAL_RESPONSE];
[asyncSocket writeData:data withTimeout:WRITE_BODY_TIMEOUT tag:HTTP_RESPONSE];
@@ -406,7 +393,7 @@
// Status code 405 - Method Not Allowed
CFHTTPMessageRef response = CFHTTPMessageCreateResponse(kCFAllocatorDefault, 405, NULL, kCFHTTPVersion1_1);
- NSData *responseData = [(NSData *)CFHTTPMessageCopySerializedMessage(response) autorelease];
+ NSData *responseData = (__bridge_transfer NSData *)CFHTTPMessageCopySerializedMessage(response); [asyncSocket writeData:responseData withTimeout:WRITE_ERROR_TIMEOUT tag:HTTP_RESPONSE];
@@ -449,7 +436,6 @@
[data appendData: fileData];
@@ -464,7 +450,7 @@
CFHTTPMessageSetHeaderFieldValue(response,CFSTR("Connection"),CFSTR("close"));
CFHTTPMessageSetHeaderFieldValue(response,CFSTR("Content-Encoding"),CFSTR("AppleSingle"));
- CFHTTPMessageSetHeaderFieldValue(response,CFSTR("Date"),(CFStringRef)[[NSDate date] description]);
+ CFHTTPMessageSetHeaderFieldValue(response,CFSTR("Date"),(__bridge CFStringRef)[[NSDate date] description]); CFHTTPMessageSetHeaderFieldValue(response,CFSTR("Server"),CFSTR("Fez (Mac OS X)"));
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
--- a/Plugins/Dock Icon Badging/AIDockNameOverlay.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Dock Icon Badging/AIDockNameOverlay.m Sun Sep 09 12:24:39 2012 -0400
@@ -43,24 +43,24 @@
if ([group isEqualToString:PREF_GROUP_LIST_THEME]) {
//Grab colors from status coloring plugin's prefs
[self flushPreferenceColorCache];
- signedOffColor = [[[prefDict objectForKey:KEY_SIGNED_OFF_COLOR] representedColor] retain];
- signedOnColor = [[[prefDict objectForKey:KEY_SIGNED_ON_COLOR] representedColor] retain];
- unviewedContentColor = [[[prefDict objectForKey:KEY_UNVIEWED_COLOR] representedColor] retain];
+ signedOffColor = [[prefDict objectForKey:KEY_SIGNED_OFF_COLOR] representedColor]; + signedOnColor = [[prefDict objectForKey:KEY_SIGNED_ON_COLOR] representedColor]; + unviewedContentColor = [[prefDict objectForKey:KEY_UNVIEWED_COLOR] representedColor]; - backSignedOffColor = [[[prefDict objectForKey:KEY_LABEL_SIGNED_OFF_COLOR] representedColor] retain];
- backSignedOnColor = [[[prefDict objectForKey:KEY_LABEL_SIGNED_ON_COLOR] representedColor] retain];
- backUnviewedContentColor = [[[prefDict objectForKey:KEY_LABEL_UNVIEWED_COLOR] representedColor] retain];
+ backSignedOffColor = [[prefDict objectForKey:KEY_LABEL_SIGNED_OFF_COLOR] representedColor]; + backSignedOnColor = [[prefDict objectForKey:KEY_LABEL_SIGNED_ON_COLOR] representedColor]; + backUnviewedContentColor = [[prefDict objectForKey:KEY_LABEL_UNVIEWED_COLOR] representedColor]; - (void)flushPreferenceColorCache
- [signedOffColor release]; signedOffColor = nil;
- [signedOnColor release]; signedOnColor = nil;
- [unviewedContentColor release]; unviewedContentColor = nil;
- [backSignedOffColor release]; backSignedOffColor = nil;
- [backSignedOnColor release]; backSignedOnColor = nil;
- [backUnviewedContentColor release]; backUnviewedContentColor = nil;
+ unviewedContentColor = nil; + backSignedOffColor = nil; + backSignedOnColor = nil; + backUnviewedContentColor = nil; @@ -191,7 +191,7 @@
if ([inModifiedKeys containsObject:@"isOnline"]) {
- for (AIListObject *listObject in [[overlayObjectsArray copy] autorelease]) {
+ for (AIListObject *listObject in [overlayObjectsArray copy]) { if (([listObject respondsToSelector:@selector(account)]) &&
([(id)listObject account] == inObject) &&
([overlayObjectsArray containsObjectIdenticalTo:listObject])) {
@@ -302,7 +302,6 @@
[adium.dockController setOverlay:image];
--- a/Plugins/Dual Window Interface/AIAccountSelectionView.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Dual Window Interface/AIAccountSelectionView.m Sun Sep 09 12:24:39 2012 -0400
@@ -96,22 +96,16 @@
- (void)setLeftColor:(NSColor *)inLeftColor rightColor:(NSColor *)inRightColor
if (leftColor != inLeftColor) {
- leftColor = [inLeftColor retain];
+ leftColor = inLeftColor; if (rightColor != inRightColor) {
- rightColor = [inRightColor retain];
+ rightColor = inRightColor; [self setNeedsDisplay:YES];
@@ -145,12 +139,12 @@
[self _destroyContactMenu];
- [chat release]; chat = nil;
- chat = [inChat retain];
//Observe changes to this chat's source and destination
[[NSNotificationCenter defaultCenter] addObserver:self
@@ -304,7 +298,6 @@
[popUp_accounts setMenu:menu];
@@ -341,11 +334,10 @@
- (void)configureAccountMenu
- [box_accounts removeFromSuperview]; [box_accounts release];
- box_accounts = [[self _boxWithFrame:BOX_RECT] retain];
+ [box_accounts removeFromSuperview]; + box_accounts = [self _boxWithFrame:BOX_RECT]; - [popUp_accounts release];
- popUp_accounts = [[self _popUpButtonWithFrame:POPUP_RECT] retain];
+ popUp_accounts = [self _popUpButtonWithFrame:POPUP_RECT]; [box_accounts addSubview:popUp_accounts];
NSTextField *label_accounts = [self _textFieldLabelWithValue:AILocalizedString(@"From:", "Label in front of the dropdown of accounts from which to send a message")
@@ -360,7 +352,7 @@
[accountMenu rebuildMenu];
- accountMenu = [[AIAccountMenu accountMenuWithDelegate:self submenuType:AIAccountNoSubmenu showTitleVerbs:NO] retain];
+ accountMenu = [AIAccountMenu accountMenuWithDelegate:self submenuType:AIAccountNoSubmenu showTitleVerbs:NO]; @@ -370,9 +362,9 @@
[box_accounts removeFromSuperview];
- [popUp_accounts release]; popUp_accounts = nil;
- [box_accounts release]; box_accounts = nil;
- [accountMenu release]; accountMenu = nil;
@@ -410,11 +402,10 @@
- (void)_createContactMenu
- [box_contacts removeFromSuperview]; [box_contacts release];
- box_contacts = [[self _boxWithFrame:BOX_RECT] retain];
+ [box_contacts removeFromSuperview]; + box_contacts = [self _boxWithFrame:BOX_RECT]; - [popUp_contacts release];
- popUp_contacts = [[self _popUpButtonWithFrame:POPUP_RECT] retain];
+ popUp_contacts = [self _popUpButtonWithFrame:POPUP_RECT]; [box_contacts addSubview:popUp_contacts];
NSTextField *label_contacts = [self _textFieldLabelWithValue:AILocalizedString(@"To:", "Label in front of the dropdown for picking which contact to send a message to in the message window") frame:LABEL_RECT];
@@ -428,7 +419,7 @@
[contactMenu rebuildMenu];
- contactMenu = [[AIContactMenu contactMenuWithDelegate:self forContactsInObject:chat.listObject.parentContact] retain];
+ contactMenu = [AIContactMenu contactMenuWithDelegate:self forContactsInObject:chat.listObject.parentContact]; @@ -438,9 +429,9 @@
[box_contacts removeFromSuperview];
- [box_contacts release]; box_contacts = nil;
- [popUp_contacts release]; popUp_contacts = nil;
- [contactMenu release]; contactMenu = nil;
@@ -462,7 +453,7 @@
[label setFont:[NSFont systemFontOfSize:[NSFont systemFontSize]]];
[label setAlignment:NSRightTextAlignment];
- return [label autorelease];
@@ -483,7 +474,7 @@
[popUp setFont:[NSFont systemFontOfSize:0.0f]];
- return [popUp autorelease];
@@ -495,7 +486,7 @@
[box setAutoresizingMask:(NSViewWidthSizable)];
- return [box autorelease];
- (NSString *)description
--- a/Plugins/Dual Window Interface/AIDualWindowInterfacePlugin.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Dual Window Interface/AIDualWindowInterfacePlugin.m Sun Sep 09 12:24:39 2012 -0400
@@ -67,8 +67,8 @@
[[NSNotificationCenter defaultCenter] removeObserver:self];
- [containers release]; containers = nil;
- [delayedContainerShowArray release]; delayedContainerShowArray = nil;
+ delayedContainerShowArray = nil; @@ -143,7 +143,6 @@
if ([messageTab windowController] == windowController) {
[windowController moveTabViewItem:messageTab toIndex:idx];
[[messageTab windowController] removeTabViewItem:messageTab silent:YES];
//Create the container if necessary
@@ -152,7 +151,6 @@
[windowController addTabViewItem:messageTab atIndex:idx silent:YES];
@@ -319,8 +317,6 @@
NSRect oldMessageWindowFrame = [[oldMessageWindowController window] frame];
//Remove the tab, which will close the containiner if it becomes empty
[oldMessageWindowController removeTabViewItem:tabViewItem silent:YES];
//Spawn a new window (if necessary)
@@ -352,7 +348,6 @@
[(AIMessageWindowController *)newMessageWindowController addTabViewItem:tabViewItem atIndex:idx silent:YES];
[adium.interfaceController chatOrderDidChange];
[tabViewItem makeActive:nil];
--- a/Plugins/Dual Window Interface/AIMessageTabViewItem.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Dual Window Interface/AIMessageTabViewItem.h Sun Sep 09 12:24:39 2012 -0400
@@ -32,13 +32,13 @@
- (void)tabViewItemWillDeselect;
- (void)tabViewDidChangeVisibility;
-@property (readonly, nonatomic) NSString *label;
-@property (readonly, nonatomic) NSImage *icon;
-@property (readonly, nonatomic) NSImage *statusIcon;
-@property (readonly, nonatomic) NSImage *stateIcon;
-@property (readonly, nonatomic) AIChat *chat;
-@property (readonly, nonatomic) NSImage *image;
-@property (readonly, nonatomic) AIMessageViewController *messageViewController;
-@property (readwrite, nonatomic, retain) AIMessageWindowController *windowController;
+@property (weak, readonly, nonatomic) NSString *label; +@property (weak, readonly, nonatomic) NSImage *icon; +@property (weak, readonly, nonatomic) NSImage *statusIcon; +@property (weak, readonly, nonatomic) NSImage *stateIcon; +@property (weak, readonly, nonatomic) AIChat *chat; +@property (weak, readonly, nonatomic) NSImage *image; +@property (weak, readonly, nonatomic) AIMessageViewController *messageViewController; +@property (readwrite, nonatomic) AIMessageWindowController *windowController; --- a/Plugins/Dual Window Interface/AIMessageTabViewItem.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Dual Window Interface/AIMessageTabViewItem.m Sun Sep 09 12:24:39 2012 -0400
@@ -48,7 +48,7 @@
+ (AIMessageTabViewItem *)messageTabWithView:(AIMessageViewController *)inMessageView
- return [[[self alloc] initWithMessageView:inMessageView] autorelease];
+ return [[self alloc] initWithMessageView:inMessageView]; @@ -58,7 +58,7 @@
* break us out of this infinite loop. This happens in -[AIMesageWindowController removeTabViewItem:silent:].
if ((self = [super initWithIdentifier:self])) {
- messageViewController = [inMessageViewController retain];
+ messageViewController = inMessageViewController; //Configure ourself for the message view
@@ -103,16 +103,7 @@
- AILogWithSignature(@"");
[[NSNotificationCenter defaultCenter] removeObserver:self];
- [tabViewItemImage release]; tabViewItemImage = nil;
- [messageViewController release]; messageViewController = nil;
//Access to our message view controller
@@ -328,7 +319,6 @@
- (void)setLargeImage:(NSImage *)inImage
if (largeImage != inImage) {
largeImage = [inImage copy];
--- a/Plugins/Dual Window Interface/AIMessageViewController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Dual Window Interface/AIMessageViewController.m Sun Sep 09 12:24:39 2012 -0400
@@ -32,7 +32,7 @@
#import <AIUtilities/AIAttributedStringAdditions.h>
#import <AIUtilities/AIDictionaryAdditions.h>
-#import <AIUtilities/AIOSCompatibility.h>
#import <PSMTabBarControl/NSBezierPath_AMShading.h>
@@ -85,7 +85,7 @@
+ (AIMessageViewController *)messageDisplayControllerForChat:(AIChat *)inChat
- return [[[self alloc] initForChat:inChat] autorelease];
+ return [[self alloc] initForChat:inChat]; @@ -97,7 +97,7 @@
if ((self = [super init])) {
- chat = [inChat retain];
contact = chat.listObject;
accountSelectionVisible = NO;
userListController = nil;
@@ -186,7 +186,7 @@
if (contact && initialBaseWritingDirection != [textView_outgoing baseWritingDirection])
[contact setBaseWritingDirection:[textView_outgoing baseWritingDirection]];
- [chat release]; chat = nil;
[[NSNotificationCenter defaultCenter] removeObserver:self];
@@ -195,15 +195,10 @@
[self _destroyAccountSelectionView];
[messageDisplayController messageViewIsClosing];
- [messageDisplayController release];
- [userListController release];
- [view_contents release]; view_contents = nil;
- [undoManager release]; undoManager = nil;
- (void)saveUserListMinimumSize
@@ -253,7 +248,7 @@
[userListController contactListWillBeRemovedFromWindow];
- [messageWindowController release]; messageWindowController = nil;
+ messageWindowController = nil; - (void)messageViewAddedToWindowController:(AIMessageWindowController *)inWindowController
@@ -263,8 +258,7 @@
if (inWindowController != messageWindowController) {
- [messageWindowController release];
- messageWindowController = [inWindowController retain];
+ messageWindowController = inWindowController; [self updateGradientColors];
@@ -330,7 +324,7 @@
- (void)_configureMessageDisplay
//Create the message view
- messageDisplayController = [[adium.interfaceController messageDisplayControllerForChat:chat] retain];
+ messageDisplayController = [adium.interfaceController messageDisplayControllerForChat:chat]; [scrollView_messages setDocumentView:[messageDisplayController messageView]];
[[scrollView_messages documentView] setFrame:[scrollView_messages visibleRect]];
@@ -422,7 +416,6 @@
date:nil //created for us by AIContentMessage
message:outgoingAttributedString
- [outgoingAttributedString release];
if ([adium.contentController sendContentObject:message]) {
[[NSNotificationCenter defaultCenter] postNotificationName:Interface_DidSendEnteredMessage
@@ -439,7 +432,7 @@
NSImage *icon = ([listObject userIcon] ? [listObject userIcon] : [AIServiceIcons serviceIconForObject:listObject
direction:AIIconNormal]);
- icon = [[icon copy] autorelease];
[icon setScalesWhenResized:NO];
[alert setAlertStyle:NSInformationalAlertStyle];
@@ -501,10 +494,9 @@
[dontSendButton setKeyEquivalentModifierMask:0];
[alert beginSheetModalForWindow:[view_contents window]
- modalDelegate:[self retain] /* Will release after the sheet ends */
+ modalDelegate:self /* Will release after the sheet ends */ didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:)
- contextInfo:[[NSNumber numberWithInteger:messageSendingAbility] retain] /* Will release after the sheet ends */];
+ contextInfo:(__bridge_retained void *)([NSNumber numberWithInteger:messageSendingAbility]) /* Will release after the sheet ends */]; @@ -514,7 +506,7 @@
- (void)alertDidEnd:(NSAlert *)alert returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo
- AIChatSendingAbilityType messageSendingAbility = [(NSNumber *)contextInfo intValue];
+ AIChatSendingAbilityType messageSendingAbility = [(__bridge NSNumber *)contextInfo intValue]; case NSAlertFirstButtonReturn:
@@ -545,10 +537,6 @@
case NSAlertThirdButtonReturn: /* Don't Send */
- //Retained when the alert was created to guard against a crash if the chat tab being closed while we are open
- [(NSNumber *)contextInfo release];
@@ -592,7 +580,7 @@
[alertDict setObject:listContact forKey:@"TEMP-ListContact"];
- [adium.contentController filterAttributedString:[[[textView_outgoing textStorage] copy] autorelease]
+ [adium.contentController filterAttributedString:[[textView_outgoing textStorage] copy] usingFilterType:AIFilterContent
direction:AIFilterOutgoing
filterContext:listContact
@@ -616,13 +604,12 @@
detailsDict = [alertDict objectForKey:@"ActionDetails"];
[detailsDict setObject:[filteredMessage dataRepresentation] forKey:@"Message"];
- listContact = [[alertDict objectForKey:@"TEMP-ListContact"] retain];
+ listContact = [alertDict objectForKey:@"TEMP-ListContact"]; [alertDict removeObjectForKey:@"TEMP-ListContact"];
[adium.contactAlertsController addAlert:alertDict
//Account Selection ----------------------------------------------------------------------------------------------------
@@ -1026,7 +1013,7 @@
// If we need to add a prefix, insert it into the text, then call [textView complete:] again; return early with no completions.
- [textView.textStorage insertAttributedString:[[[NSAttributedString alloc] initWithString:prefix] autorelease] atIndex:charRange.location];
+ [textView.textStorage insertAttributedString:[[NSAttributedString alloc] initWithString:prefix] atIndex:charRange.location]; @@ -1143,7 +1130,7 @@
- (void)_showUserListView
if (chat.isGroupChat && view_userList.superview == nil) {
- [splitView_verticalSplit addSubview:[view_userList autorelease]];
+ [splitView_verticalSplit addSubview:view_userList]; [userListController reloadData];
@@ -1164,7 +1151,6 @@
NSRect frame = view_userList.frame;
view_userList.frame = frame;
- [view_userList retain];
[view_userList removeFromSuperview];
[view_userList setHidden:YES];
--- a/Plugins/Dual Window Interface/AIMessageWindowController.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Dual Window Interface/AIMessageWindowController.h Sun Sep 09 12:24:39 2012 -0400
@@ -60,11 +60,11 @@
withID:(NSString *)inContainerID
- (IBAction)closeWindow:(id)sender;
-@property (readonly, nonatomic) NSString *containerID;
-@property (readonly, nonatomic) PSMTabBarControl *tabBar;
+@property (weak, readonly, nonatomic) NSString *containerID; +@property (weak, readonly, nonatomic) PSMTabBarControl *tabBar; @property (readonly, nonatomic) AdiumTabPosition tabPosition;
-@property (readonly, nonatomic) NSString *name;
-@property (readonly, nonatomic) AIChat *activeChat;
+@property (weak, readonly, nonatomic) NSString *name; +@property (weak, readonly, nonatomic) AIChat *activeChat; * @brief Get an array of all the chats within this window controller's window.
@@ -74,7 +74,7 @@
-@property (readonly, nonatomic) NSWindow *window;
+@property (weak, readonly, nonatomic) NSWindow *window; - (void)addTabViewItem:(AIMessageTabViewItem *)inTabViewItem;
--- a/Plugins/Dual Window Interface/AIMessageWindowController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Dual Window Interface/AIMessageWindowController.m Sun Sep 09 12:24:39 2012 -0400
@@ -75,10 +75,10 @@
withID:(NSString *)inContainerID
- return [[[self alloc] initWithWindowNibName:MESSAGE_WINDOW_NIB
+ return [[self alloc] initWithWindowNibName:MESSAGE_WINDOW_NIB containerID:inContainerID
- containerName:inName] autorelease];
@@ -90,9 +90,9 @@
if ((self = [super initWithWindowNibName:windowNibName])) {
- interface = [inInterface retain];
- containerName = [inName retain];
- containerID = [inContainerID retain];
+ interface = inInterface; + containerName = inName; + containerID = inContainerID; m_containedChats = [[NSMutableArray alloc] init];
@@ -147,15 +147,8 @@
[tabView_tabBar setDelegate:nil];
- [m_containedChats release];
- [toolbarItems release];
- [containerName release];
[adium.preferenceController unregisterPreferenceObserver:self];
//Human readable container name
@@ -200,7 +193,7 @@
- tabView_tabStyle = [[[PSMAdiumTabStyle alloc] init] autorelease];
+ tabView_tabStyle = [[PSMAdiumTabStyle alloc] init]; [tabView_tabBar setStyle:tabView_tabStyle];
[tabView_tabBar setCanCloseOnlyTab:YES];
[tabView_tabBar setUseOverflowMenu:NO];
@@ -435,15 +428,11 @@
//remove the split view if the last orientation was vertical
if ([tabView_tabBar orientation] == PSMTabBarVerticalOrientation) {
- [tabView_messages retain];
[tabView_messages removeFromSuperview];
- [tabView_tabBar retain];
[tabView_tabBar removeFromSuperview];
[tabView_splitView removeFromSuperview];
[[[self window] contentView] addSubview:tabView_messages];
[[[self window] contentView] addSubview:tabView_tabBar];
- [tabView_messages release];
- [tabView_tabBar release];
[tabView_horzLine removeFromSuperview];
@@ -485,7 +474,7 @@
NSRect horzLineFrame = NSMakeRect(tabBarFrame.origin.x, (tabPosition == AdiumTabPositionBottom)? NSMinY(tabViewMessagesFrame)-1 : NSMaxY(tabViewMessagesFrame)-2, NSWidth(tabViewMessagesFrame), 1);
NSUInteger mask = (tabPosition == AdiumTabPositionBottom)? (NSViewMaxYMargin|NSViewWidthSizable) : (NSViewMinYMargin|NSViewWidthSizable);
- tabView_horzLine = [[[NSBox alloc] initWithFrame:horzLineFrame] autorelease];
+ tabView_horzLine = [[NSBox alloc] initWithFrame:horzLineFrame]; [tabView_horzLine setBorderColor:[NSColor windowFrameColor]];
[tabView_horzLine setBorderWidth:1];
[tabView_horzLine setBorderType:NSLineBorder];
@@ -527,7 +516,7 @@
splitViewRect.size.width += [tabView_tabBar isTabBarHidden] ? 0 : 1;
- tabView_splitView = [[[AIMessageTabSplitView alloc] initWithFrame:splitViewRect] autorelease];
+ tabView_splitView = [[AIMessageTabSplitView alloc] initWithFrame:splitViewRect]; [tabView_splitView setDividerThickness:([tabView_tabBar isTabBarHidden] ? 0 : VERTICAL_DIVIDER_THICKNESS)];
[tabView_splitView setVertical:YES];
[tabView_splitView setDelegate:self];
@@ -702,7 +691,7 @@
- (void)_reloadContainedChats
//Update our contained chats array to mirror the order of the tabs
- [m_containedChats release]; m_containedChats = [[NSMutableArray alloc] init];
+ m_containedChats = [[NSMutableArray alloc] init]; for (AIMessageTabViewItem *tabViewItem in [tabView_messages tabViewItems]) {
[tabViewItem setWindowController:self];
[m_containedChats addObject:[tabViewItem chat]];
@@ -988,17 +977,17 @@
- (NSImage *)tabView:(NSTabView *)tabView imageForTabViewItem:(NSTabViewItem *)tabViewItem offset:(NSSize *)offset styleMask:(NSUInteger *)styleMask
// grabs whole window image
- NSImage *viewImage = [[[NSImage alloc] init] autorelease];
+ NSImage *viewImage = [[NSImage alloc] init]; NSRect contentFrame = [[[self window] contentView] frame];
[[[self window] contentView] lockFocus];
- NSBitmapImageRep *viewRep = [[[NSBitmapImageRep alloc] initWithFocusedViewRect:contentFrame] autorelease];
+ NSBitmapImageRep *viewRep = [[NSBitmapImageRep alloc] initWithFocusedViewRect:contentFrame]; [viewImage addRepresentation:viewRep];
[[[self window] contentView] unlockFocus];
// grabs snapshot of dragged tabViewItem's view (represents content being dragged)
NSView *viewForImage = [tabViewItem view];
NSRect viewRect = [viewForImage frame];
- NSImage *tabViewImage = [[[NSImage alloc] initWithSize:viewRect.size] autorelease];
+ NSImage *tabViewImage = [[NSImage alloc] initWithSize:viewRect.size]; [tabViewImage lockFocus];
[viewForImage drawRect:[viewForImage bounds]];
[tabViewImage unlockFocus];
@@ -1305,7 +1294,7 @@
[toolbar setAutosavesConfiguration:YES];
- toolbarItems = [[adium.toolbarController toolbarItemsForToolbarTypes:[NSArray arrayWithObjects:@"General", @"ListObject", @"TextEntry", @"MessageWindow", nil]] retain];
+ toolbarItems = [adium.toolbarController toolbarItemsForToolbarTypes:[NSArray arrayWithObjects:@"General", @"ListObject", @"TextEntry", @"MessageWindow", nil]]; /* Seemingly randomly, setToolbar: may throw:
* Exception: NSInternalInconsistencyException
@@ -1442,7 +1431,6 @@
[[self window] setMiniwindowImage:miniwindowImage];
- [miniwindowImage release];
- (BOOL)window:(NSWindow *)sender shouldDragDocumentWithEvent:(NSEvent *)mouseEvent from:(NSPoint)startPoint withPasteboard:(NSPasteboard *)pasteboard
--- a/Plugins/Dual Window Interface/AIWindowHandlingPreferences.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Dual Window Interface/AIWindowHandlingPreferences.h Sun Sep 09 12:24:39 2012 -0400
@@ -17,39 +17,23 @@
#import "AIPreferencePane.h"
@interface AIWindowHandlingPreferences : AIPreferencePane {
- AILocalizationTextField *label_statusWindow;
- AILocalizationTextField *label_chatWindows;
- AILocalizationTextField *label_contactList;
- AILocalizationTextField *label_autoHide;
- AILocalizationTextField *label_show;
- AILocalizationTextField *label_order;
- NSPopUpButton *popUp_chatWindowPosition;
- NSPopUpButton *popUp_contactListWindowPosition;
- NSMatrix *matrix_hiding;
- AILocalizationButton *checkBox_hideOnScreenEdgesOnlyInBackground;
- AILocalizationButton *checkBox_showOnAllSpaces;
- AILocalizationButton *checkBox_hideInBackground;
- AILocalizationButton *checkBox_statusWindowHideInBackground;
- AILocalizationButton *checkBox_statusWindowAlwaysOnTop;
-@property (assign) IBOutlet AILocalizationTextField *label_contactList;
-@property (assign) IBOutlet AILocalizationTextField *label_autoHide;
-@property (assign) IBOutlet AILocalizationTextField *label_statusWindow;
-@property (assign) IBOutlet AILocalizationTextField *label_chatWindows;
-@property (assign) IBOutlet AILocalizationTextField *label_show;
-@property (assign) IBOutlet AILocalizationTextField *label_order;
+@property (weak) IBOutlet AILocalizationTextField *label_contactList; +@property (weak) IBOutlet AILocalizationTextField *label_autoHide; +@property (weak) IBOutlet AILocalizationTextField *label_statusWindow; +@property (weak) IBOutlet AILocalizationTextField *label_chatWindows; +@property (weak) IBOutlet AILocalizationTextField *label_show; +@property (weak) IBOutlet AILocalizationTextField *label_order; -@property (assign) IBOutlet NSPopUpButton *popUp_chatWindowPosition;
-@property (assign) IBOutlet NSPopUpButton *popUp_contactListWindowPosition;
-@property (assign) IBOutlet NSMatrix *matrix_hiding;
+@property (weak) IBOutlet NSPopUpButton *popUp_chatWindowPosition; +@property (weak) IBOutlet NSPopUpButton *popUp_contactListWindowPosition; +@property (weak) IBOutlet NSMatrix *matrix_hiding; -@property (assign) IBOutlet AILocalizationButton *checkBox_hideOnScreenEdgesOnlyInBackground;
-@property (assign) IBOutlet AILocalizationButton *checkBox_showOnAllSpaces;
-@property (assign) IBOutlet AILocalizationButton *checkBox_hideInBackground;
-@property (assign) IBOutlet AILocalizationButton *checkBox_statusWindowHideInBackground;
-@property (assign) IBOutlet AILocalizationButton *checkBox_statusWindowAlwaysOnTop;
+@property (weak) IBOutlet AILocalizationButton *checkBox_hideOnScreenEdgesOnlyInBackground; +@property (weak) IBOutlet AILocalizationButton *checkBox_showOnAllSpaces; +@property (weak) IBOutlet AILocalizationButton *checkBox_hideInBackground; +@property (weak) IBOutlet AILocalizationButton *checkBox_statusWindowHideInBackground; +@property (weak) IBOutlet AILocalizationButton *checkBox_statusWindowAlwaysOnTop; --- a/Plugins/Emoticons/AIEmoticonPackPreviewController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Emoticons/AIEmoticonPackPreviewController.m Sun Sep 09 12:24:39 2012 -0400
@@ -28,14 +28,14 @@
+ (id)previewControllerForPack:(AIEmoticonPack *)inPack preferences:(AIEmoticonPreferences *)inPreferences
- return [[[self alloc] initForPack:inPack preferences:inPreferences] autorelease];
+ return [[self alloc] initForPack:inPack preferences:inPreferences]; - (id)initForPack:(AIEmoticonPack *)inPack preferences:(AIEmoticonPreferences *)inPreferences
if ((self = [super init])) {
- emoticonPack = [inPack retain];
- preferences = [inPreferences retain];
+ preferences = inPreferences; [NSBundle loadNibNamed:@"EmoticonPackPreview" owner:self];
@@ -43,18 +43,6 @@
- [emoticonPack release];
- /* It seems like we should be releasing previewView here. Doing so leads to a double release when the view is
- * removed its superview, though.. no idea what's going wrong, but it's not a leak... it's just weird. -eds */
- //[previewView release];
- (IBAction)togglePack:(id)sender
[adium.emoticonController setEmoticonPack:emoticonPack enabled:![emoticonPack isEnabled]];
--- a/Plugins/Emoticons/AIEmoticonPackPreviewTableView.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Emoticons/AIEmoticonPackPreviewTableView.m Sun Sep 09 12:24:39 2012 -0400
@@ -43,8 +43,8 @@
//and then draw the cell into it at the regular size. This way the cell can overflow its bounds as normal and not
//spill outside the drag image.
rowRect = [self rectOfRow:firstRow];
- image = [[[NSImage alloc] initWithSize:NSMakeSize(rowRect.size.width,
- rowRect.size.height*count + [self intercellSpacing].height*(count-1))] autorelease];
+ image = [[NSImage alloc] initWithSize:NSMakeSize(rowRect.size.width, + rowRect.size.height*count + [self intercellSpacing].height*(count-1))]; --- a/Plugins/Emoticons/AIEmoticonPackPreviewView.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Emoticons/AIEmoticonPackPreviewView.m Sun Sep 09 12:24:39 2012 -0400
@@ -32,14 +32,7 @@
- (void)setEmoticonPack:(AIEmoticonPack *)inEmoticonPack
- emoticonPack = [inEmoticonPack retain];
- [emoticonPack release];
+ emoticonPack = inEmoticonPack; - (void)drawRect:(NSRect)rect
--- a/Plugins/Emoticons/AIEmoticonPreferences.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Emoticons/AIEmoticonPreferences.m Sun Sep 09 12:24:39 2012 -0400
@@ -79,8 +79,6 @@
[adium.preferenceController unregisterPreferenceObserver:self];
[adium.emoticonController flushEmoticonImageCache];
//Configure the preference view
@@ -91,7 +89,7 @@
[table_emoticonPacks registerForDraggedTypes:[NSArray arrayWithObject:EMOTICON_PACK_DRAG_TYPE]];
//Configure the outline view
- [[table_emoticonPacks tableColumnWithIdentifier:@"Emoticons"] setDataCell:[[[AIGenericViewCell alloc] init] autorelease]];
+ [[table_emoticonPacks tableColumnWithIdentifier:@"Emoticons"] setDataCell:[[AIGenericViewCell alloc] init]]; [table_emoticonPacks selectRowIndexes:[NSIndexSet indexSetWithIndex:0] byExtendingSelection:NO];
[table_emoticonPacks setToolTip:EMOTICON_PACKS_TOOLTIP];
[table_emoticonPacks setDelegate:self];
@@ -99,7 +97,6 @@
[self configurePreviewControllers];
- [selectedEmoticonPack release];
selectedEmoticonPack = nil;
checkCell = [[NSButtonCell alloc] init];
[checkCell setButtonType:NSSwitchButton];
@@ -111,17 +108,14 @@
NSImageCell *imageCell = [[NSImageCell alloc] initImageCell:nil];
if ([imageCell respondsToSelector:@selector(_setAnimates:)]) [imageCell _setAnimates:NO];
[[table_emoticons tableColumnWithIdentifier:@"Image"] setDataCell:imageCell];
AIVerticallyCenteredTextCell *textCell = [[AIVerticallyCenteredTextCell alloc] init];
[textCell setLineBreakMode:NSLineBreakByTruncatingTail];
[[table_emoticons tableColumnWithIdentifier:@"Name"] setDataCell:textCell];
textCell = [[AIVerticallyCenteredTextCell alloc] init];
[textCell setLineBreakMode:NSLineBreakByTruncatingTail];
[[table_emoticons tableColumnWithIdentifier:@"String"] setDataCell:textCell];
[table_emoticons setUsesAlternatingRowBackgroundColors:YES];
@@ -148,31 +142,30 @@
[adium.preferenceController unregisterPreferenceObserver:self];
[adium.emoticonController flushEmoticonImageCache];
- [checkCell release]; checkCell = nil;
- [selectedEmoticonPack release]; selectedEmoticonPack = nil;
- [emoticonPackPreviewControllers release]; emoticonPackPreviewControllers = nil;
- [emoticonImageCache release]; emoticonImageCache = nil;
+ selectedEmoticonPack = nil; + emoticonPackPreviewControllers = nil; + [adium.preferenceController unregisterPreferenceObserver:self]; + emoticonImageCache = nil; + //Flush all the images we loaded + [adium.emoticonController flushEmoticonImageCache]; - (void)configurePreviewControllers
//First, remove any AIEmoticonPackPreviewView instances from the table
- for (NSView *view in [[[table_emoticonPacks subviews] copy] autorelease]) {
+ for (NSView *view in [[table_emoticonPacks subviews] copy]) { if ([view isKindOfClass:[AIEmoticonPackPreviewView class]]) {
[view removeFromSuperviewWithoutNeedingDisplay];
//Now [re]create the array of emoticon pack preview controlls
- [emoticonPackPreviewControllers release];
emoticonPackPreviewControllers = [[NSMutableArray alloc] init];
for (AIEmoticonPack *pack in [adium.emoticonController availableEmoticonPacks]) {
@@ -194,8 +187,7 @@
//Remember the selected pack
if ([table_emoticonPacks numberOfSelectedRows] == 1 &&
((selectedRow != -1) && (selectedRow < [availableEmoticonPacks count]))) {
- [selectedEmoticonPack release];
- selectedEmoticonPack = [[availableEmoticonPacks objectAtIndex:selectedRow] retain];
+ selectedEmoticonPack = [availableEmoticonPacks objectAtIndex:selectedRow]; selectedEmoticonPack = nil;
@@ -213,7 +205,6 @@
if (rowHeight > EMOTICON_MAX_ROW_HEIGHT) rowHeight = EMOTICON_MAX_ROW_HEIGHT;
- [emoticonImageCache release];
emoticonImageCache = [[NSMutableDictionary alloc] init];
@@ -251,7 +242,7 @@
forKey:NSParagraphStyleAttributeName];
- return [[[NSAttributedString alloc] initWithString:inString attributes:attributes] autorelease];
+ return [[NSAttributedString alloc] initWithString:inString attributes:attributes]; #pragma mark Table view data source
@@ -407,7 +398,7 @@
-(void)moveSelectedPacksToTrash
- NSString *name = [[selectedEmoticonPack.name copy] autorelease];
+ NSString *name = [selectedEmoticonPack.name copy]; NSBeginAlertSheet(AILocalizedString(@"Delete Emoticon Pack",nil),
AILocalizedString(@"Delete",nil),
AILocalizedString(@"Cancel",nil),
--- a/Plugins/Error Message Handler/ErrorMessageHandlerPlugin.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Error Message Handler/ErrorMessageHandlerPlugin.m Sun Sep 09 12:24:39 2012 -0400
@@ -111,9 +111,8 @@
__block NSString *dateString;
[NSDateFormatter withLocalizedDateFormatterShowingSeconds:NO showingAMorPM:YES perform:^(NSDateFormatter *dateFormatter){
- dateString = [[dateFormatter stringFromDate:[NSCalendarDate calendarDate]] retain];
+ dateString = [dateFormatter stringFromDate:[NSCalendarDate calendarDate]]; - [dateString autorelease];
NSString *alertText = [[details objectForKey:KEY_ALERT_TEXT] lastPathComponent];
@@ -207,7 +206,7 @@
- (NSImage *)imageForEventID:(NSString *)eventID
static NSImage *eventImage = nil;
- if (!eventImage) eventImage = [[NSImage imageNamed:@"events-error-alert" forClass:[self class]] retain];
+ if (!eventImage) eventImage = [NSImage imageNamed:@"events-error-alert" forClass:[self class]]; --- a/Plugins/Error Message Handler/ErrorMessageWindowController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Error Message Handler/ErrorMessageWindowController.m Sun Sep 09 12:24:39 2012 -0400
@@ -104,11 +104,9 @@
- [errorTitleArray release]; errorTitleArray = nil;
- [errorDescArray release]; errorDescArray = nil;
- [errorWindowTitleArray release]; errorWindowTitleArray = nil;
+ errorWindowTitleArray = nil; - (void)refreshErrorDialog
@@ -163,7 +161,7 @@
[[self window] makeFirstResponder:button_okay];
[button_dismissAll setHidden:NO];
- [[self window] setTitle:[NSString stringWithFormat:@"%@ (x%i)",[errorWindowTitleArray objectAtIndex:0],[errorTitleArray count]]];
+ [[self window] setTitle:[NSString stringWithFormat:@"%@ (x%li)",[errorWindowTitleArray objectAtIndex:0],[errorTitleArray count]]]; [button_okay setTitle:AILocalizedString(@"Next",nil)];
[button_dismissAll setTitle:AILocalizedString(@"Dismiss All", @"Used in the error window; closes all open errors.")];
[[self window] makeFirstResponder:button_dismissAll];
@@ -197,7 +195,6 @@
// Release the window controller (ourself)
sharedErrorMessageInstance = nil;
--- a/Plugins/General Preferences/AILogByAccountWindowController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/General Preferences/AILogByAccountWindowController.m Sun Sep 09 12:24:39 2012 -0400
@@ -26,17 +26,11 @@
- (id)initWithWindowNibName:(NSString *)windowNibName
if((self = [super initWithWindowNibName:windowNibName])) {
- accounts = [adium.accountController.accounts retain];
+ accounts = adium.accountController.accounts;
- (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView
--- a/Plugins/General Preferences/AIMessagePreferences.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/General Preferences/AIMessagePreferences.m Sun Sep 09 12:24:39 2012 -0400
@@ -202,7 +202,7 @@
- return [menu autorelease];
@@ -227,7 +227,7 @@
- return [menu autorelease];
- (NSMenu *)tabPositionMenu
@@ -258,7 +258,7 @@
tag:AdiumTabPositionRight];
- return [menu autorelease];
- (BOOL)chatHistoryDisplayActive
@@ -276,7 +276,6 @@
- (void)sheetDidEnd:(NSWindow *)sheet returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo
- [sheet.windowController release];
- (IBAction)configureLogCertainAccounts:(id)sender
--- a/Plugins/General Preferences/ESGeneralPreferences.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/General Preferences/ESGeneralPreferences.m Sun Sep 09 12:24:39 2012 -0400
@@ -84,8 +84,8 @@
[checkbox_updatesIncludeBetas setEnabled:[checkbox_updatesAutomatic state]];
- self.shortcutRecorder = [[[SRRecorderControl alloc] initWithFrame:placeholder_shortcutRecorder.frame] autorelease];
+ self.shortcutRecorder = [[SRRecorderControl alloc] initWithFrame:placeholder_shortcutRecorder.frame]; shortcutRecorder.delegate = self;
[[placeholder_shortcutRecorder superview] addSubview:shortcutRecorder];
@@ -93,8 +93,8 @@
TISInputSourceRef currentLayout = TISCopyCurrentKeyboardLayoutInputSource();
if (TISGetInputSourceProperty(currentLayout, kTISPropertyUnicodeKeyLayoutData)) {
- SGKeyCombo *keyCombo = [[[SGKeyCombo alloc] initWithPlistRepresentation:[adium.preferenceController preferenceForKey:KEY_GENERAL_HOTKEY
- group:PREF_GROUP_GENERAL]] autorelease];
+ SGKeyCombo *keyCombo = [[SGKeyCombo alloc] initWithPlistRepresentation:[adium.preferenceController preferenceForKey:KEY_GENERAL_HOTKEY + group:PREF_GROUP_GENERAL]]; [shortcutRecorder setKeyCombo:SRMakeKeyCombo([keyCombo keyCode], [shortcutRecorder carbonToCocoaFlags:[keyCombo modifiers]])];
[shortcutRecorder setAnimates:YES];
[shortcutRecorder setStyle:SRGreyStyle];
@@ -111,39 +111,6 @@
[self configureControlDimming];
- [label_confirmations setLocalizedString:AILocalizedString(@"Confirmations:", nil)];
- [label_globalShortcut setLocalizedString:AILocalizedString(@"Global Shortcut:", nil)];
- [label_IMLinks setLocalizedString:AILocalizedString(@"Open IM links:", nil)];
- [label_status setLocalizedString:AILocalizedString(@"Status:", nil)];
- [label_updates setLocalizedString:AILocalizedString(@"Updates:", nil)];
- [button_defaultApp setLocalizedString:AILocalizedString(@"Make Adium default application", nil)];
- [button_customizeDefaultApp setLocalizedString:AILocalizedString(@"Customize…", nil)];
- [checkbox_showInMenu setLocalizedString:AILocalizedString(@"Show Adium's status in the menu bar", nil)];
- [checkbox_updatesAutomatic setLocalizedString:AILocalizedString(@"Automatically check for updates", nil)];
- [checkbox_updatesIncludeBetas setLocalizedString:AILocalizedString(@"Update to beta versions when available", nil)];
- [checkbox_updatesProfileInfo setLocalizedString:AILocalizedString(@"Include anonymous system profile", nil)];
- [checkbox_confirmBeforeQuitting setLocalizedString:AILocalizedString(@"Confirm before quitting Adium", "Quit Confirmation preference")];
- [checkbox_quitConfirmFT setLocalizedString:AILocalizedString(@"File transfers are in progress", "Quit Confirmation preference")];
- [checkbox_quitConfirmUnread setLocalizedString:AILocalizedString(@"There are unread messages", "Quit Confirmation preference")];
- [checkbox_quitConfirmOpenChats setLocalizedString:AILocalizedString(@"There are open chat windows", "Quit Confirmation preference")];
- [[matrix_quitConfirmType cellWithTag:AIQuitConfirmAlways] setTitle:AILocalizedString(@"Always","Confirmation preference")];
- [[matrix_quitConfirmType cellWithTag:AIQuitConfirmSelective] setTitle:[AILocalizedString(@"Only when","Quit Confirmation preference") stringByAppendingEllipsis]];
- [checkbox_confirmBeforeClosing setLocalizedString:AILocalizedString(@"Confirm before closing multiple chat windows", "Message close confirmation preference")];
- [[matrix_closeConfirmType cellWithTag:AIMessageCloseAlways] setTitle:AILocalizedString(@"Always", "Confirmation preference")];
- [[matrix_closeConfirmType cellWithTag:AIMessageCloseUnread] setTitle:AILocalizedString(@"Only when there are unread messages", "Message close confirmation preference")];
- self.shortcutRecorder = nil;
//Called in response to all preference controls, applies new settings
- (IBAction)changePreference:(id)sender
@@ -194,7 +161,6 @@
- (void)sheetDidEnd:(NSWindow *)sheet returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo
- [sheet.windowController release];
- (IBAction)customizeDefaultApp:(id)sender
@@ -207,4 +173,5 @@
didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:)
--- a/Plugins/General Preferences/ESGeneralPreferencesPlugin.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/General Preferences/ESGeneralPreferencesPlugin.m Sun Sep 09 12:24:39 2012 -0400
@@ -64,7 +64,7 @@
forGroup:PREF_GROUP_CONFIRMATIONS];
//Install our preference view
- preferences = [(ESGeneralPreferences *)[ESGeneralPreferences preferencePaneForPlugin:self] retain];
+ preferences = (ESGeneralPreferences *)[ESGeneralPreferences preferencePaneForPlugin:self]; [adium.preferenceController registerPreferenceObserver:self forGroup:PREF_GROUP_GENERAL];
@@ -95,14 +95,14 @@
//Unregister the old global hot key if it exists
[[SGHotKeyCenter sharedCenter] unregisterHotKey:globalHotKey];
- [globalHotKey release]; globalHotKey = nil;
id plistRepresentation = [prefDict objectForKey:KEY_GENERAL_HOTKEY];
if (plistRepresentation) {
//Register a new one if we want one
globalHotKey = [[SGHotKey alloc] initWithIdentifier:KEY_GENERAL_HOTKEY
- keyCombo:[[[SGKeyCombo alloc] initWithPlistRepresentation:plistRepresentation] autorelease]];
+ keyCombo:[[SGKeyCombo alloc] initWithPlistRepresentation:plistRepresentation]]; [globalHotKey setTarget:self];
[globalHotKey setAction:@selector(hitHotKey:)];
--- a/Plugins/Image Uploading Plugin/AIGenericMultipartImageUploader.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Image Uploading Plugin/AIGenericMultipartImageUploader.h Sun Sep 09 12:24:39 2012 -0400
@@ -26,8 +26,8 @@
@property (readonly, nonatomic) NSUInteger maximumSize;
-@property (readonly, nonatomic) NSString *uploadURL;
-@property (readonly, nonatomic) NSString *fieldName;
+@property (weak, readonly, nonatomic) NSString *uploadURL; +@property (weak, readonly, nonatomic) NSString *fieldName; - (void)parseResponse:(NSData *)data;
--- a/Plugins/Image Uploading Plugin/AIGenericMultipartImageUploader.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Image Uploading Plugin/AIGenericMultipartImageUploader.m Sun Sep 09 12:24:39 2012 -0400
@@ -34,7 +34,7 @@
@implementation AIGenericMultipartImageUploader
+ (id)uploadImage:(NSImage *)image forUploader:(AIImageUploaderPlugin *)uploader inChat:(AIChat *)chat;
- return [[[self alloc] initWithImage:image uploader:uploader chat:chat] autorelease];
+ return [[self alloc] initWithImage:image uploader:uploader chat:chat]; + (NSString *)serviceName
@@ -81,7 +81,7 @@
if ((self = [super init])) {
- image = [inImage retain];
@@ -91,15 +91,6 @@
- [dataUploader release]; dataUploader = nil;
- [image release]; image = nil;
#pragma mark Data uploader delegate
- (void)updateUploadProgress:(NSUInteger)uploaded total:(NSUInteger)total context:(id)context
@@ -163,11 +154,11 @@
NSDictionary *headers = [NSDictionary dictionaryWithObjectsAndKeys:
[NSString stringWithFormat:@"multipart/form-data; boundary=%@", MULTIPART_FORM_BOUNDARY], @"Content-type", nil];
- dataUploader = [[AIProgressDataUploader dataUploaderWithData:body
+ dataUploader = [AIProgressDataUploader dataUploaderWithData:body URL:[NSURL URLWithString:self.uploadURL]
--- a/Plugins/Image Uploading Plugin/AIImageShackImageUploader.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Image Uploading Plugin/AIImageShackImageUploader.m Sun Sep 09 12:24:39 2012 -0400
@@ -38,15 +38,6 @@
- [resultData release]; resultData = nil;
- [links release]; links = nil;
- [responseParser release]; responseParser = nil;
#pragma mark Response parsing
- (void)parseResponse:(NSData *)data
--- a/Plugins/Image Uploading Plugin/AIImageUploaderPlugin.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Image Uploading Plugin/AIImageUploaderPlugin.m Sun Sep 09 12:24:39 2012 -0400
@@ -99,18 +99,6 @@
[adium.preferenceController unregisterPreferenceObserver:self];
- [defaultService release];
- [windowControllers release];
- [uploadInstances release];
- [contextMenuItem release];
- [editMenuItem release];
@synthesize defaultService;
@@ -254,7 +242,7 @@
[attrs setObject:inAddress forKey:NSLinkAttributeName];
[textView.textStorage replaceCharactersInRange:selectedRange
- withAttributedString:[[[NSAttributedString alloc] initWithString:inAddress attributes:attrs] autorelease]];
+ withAttributedString:[[NSAttributedString alloc] initWithString:inAddress attributes:attrs]]; // Select the inserted URL
textView.selectedRange = NSMakeRange(selectedRange.location, inAddress.length);
@@ -281,13 +269,9 @@
- (void)uploadedURL:(NSString *)url forChat:(AIChat *)chat
AIImageUploaderWindowController *windowController = [windowControllers objectForKey:chat.internalObjectID];
- NSObject <AIImageUploader> *imageUploader = [uploadInstances objectForKey:chat.internalObjectID];
[windowController closeWindow:nil];
- [[windowController retain] autorelease];
- [[imageUploader retain] autorelease];
[windowControllers setValue:nil forKey:chat.internalObjectID];
[uploadInstances setValue:nil forKey:chat.internalObjectID];
@@ -321,13 +305,9 @@
- (void)cancelForChat:(AIChat *)chat
- AIImageUploaderWindowController *windowController = [windowControllers objectForKey:chat.internalObjectID];
NSObject <AIImageUploader> *imageUploader = [uploadInstances objectForKey:chat.internalObjectID];
- [[windowController retain] autorelease];
- [[imageUploader retain] autorelease];
[windowControllers setValue:nil forKey:chat.internalObjectID];
[uploadInstances setValue:nil forKey:chat.internalObjectID];
--- a/Plugins/Image Uploading Plugin/AIImageUploaderWindowController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Image Uploading Plugin/AIImageUploaderWindowController.m Sun Sep 09 12:24:39 2012 -0400
@@ -33,9 +33,9 @@
- AIImageUploaderWindowController *newController = [[[self alloc] initWithWindowNibName:@"ImageUploaderProgress"
+ AIImageUploaderWindowController *newController = [[self alloc] initWithWindowNibName:@"ImageUploaderProgress" - chat:inChat] autorelease];
[NSApp beginSheet:newController.window
@@ -58,11 +58,6 @@
--- a/Plugins/Image Uploading Plugin/AIImgurImageUploader.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Image Uploading Plugin/AIImgurImageUploader.m Sun Sep 09 12:24:39 2012 -0400
@@ -43,15 +43,6 @@
- [resultData release]; resultData = nil;
- [response release]; response = nil;
- [responseParser release]; responseParser = nil;
#pragma mark Response parsing
- (void)parseResponse:(NSData *)data
--- a/Plugins/Invite to Chat Plugin/DCInviteToChatPlugin.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Invite to Chat Plugin/DCInviteToChatPlugin.m Sun Sep 09 12:24:39 2012 -0400
@@ -41,17 +41,17 @@
//Invite to Chat menu item
- menuItem_inviteToChat = [[[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:INVITE_CONTACT
+ menuItem_inviteToChat = [[NSMenuItem alloc] initWithTitle:INVITE_CONTACT action:@selector(dummyTarget:)
- keyEquivalent:@""] autorelease];
[adium.menuController addMenuItem:menuItem_inviteToChat toLocation:LOC_Contact_Action];
//Invite to Chat context menu item
- menuItem_inviteToChatContext = [[[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:INVITE_CONTACT
+ menuItem_inviteToChatContext = [[NSMenuItem alloc] initWithTitle:INVITE_CONTACT action:@selector(dummyTarget:)
- keyEquivalent:@""] autorelease];
[adium.menuController addContextualMenuItem:menuItem_inviteToChatContext toLocation:Context_Contact_Action];
@@ -145,7 +145,7 @@
[chat.account.service.serviceClass isEqualToString:serviceClass]) {
- menu_chatMenu = [[[NSMenu allocWithZone:[NSMenu menuZone]] initWithTitle:@""] autorelease];
+ menu_chatMenu = [[NSMenu alloc] initWithTitle:@""]; [menu_chatMenu setMenuChangedMessagesEnabled:NO];
--- a/Plugins/Invite to Chat Plugin/DCInviteToChatWindowController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Invite to Chat Plugin/DCInviteToChatWindowController.m Sun Sep 09 12:24:39 2012 -0400
@@ -71,12 +71,10 @@
- [contact release]; contact = nil;
- [service release]; service = nil;
- [chat release]; chat = nil;
//Setup the window before it is displayed
@@ -111,8 +109,7 @@
//Configure the contact menu (primarily for handling metacontacts)
- contactMenu = [[AIContactMenu contactMenuWithDelegate:self forContactsInObject:contact] retain];
+ contactMenu = [AIContactMenu contactMenuWithDelegate:self forContactsInObject:contact]; if ([contact isKindOfClass:[AIMetaContact class]]) {
[menu_contacts selectItemWithRepresentedObject:[(AIMetaContact *)contact preferredContactWithCompatibleService:service]];
@@ -134,8 +131,8 @@
[self setContact:inContact];
- [chat release]; chat = [inChat retain];
- [service release]; service = [chat.account.service retain];
+ service = chat.account.service; [self configureForChatAndContact];
@@ -144,7 +141,7 @@
- (void)setContact:(AIListContact *)inContact
if (contact != inContact) {
- [contact release]; contact = [inContact retain];
@@ -155,7 +152,6 @@
[super windowWillClose:sender];
sharedInviteToChatInstance = nil;
- [self autorelease]; //Close the shared instance
--- a/Plugins/Link Management/SHAutoValidatingTextView.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Link Management/SHAutoValidatingTextView.m Sun Sep 09 12:24:39 2012 -0400
@@ -32,12 +32,6 @@
return [super initWithFrame:frameRect textContainer:aTextContainer];
//Set Validation Attribs -----------------------------------------------------------------------------------------------
#pragma mark Set Validation Attribs
- (void)setContinuousURLValidationEnabled:(BOOL)flag
@@ -111,13 +105,13 @@
range:NSMakeRange(0, [newLinkURL length])];
- linkURL = [newLinkURL autorelease];
//Replace all existing percent escapes (in case the user actually escaped the URL properly or it was copy/pasted)
preprocessedString = CFURLCreateStringByReplacingPercentEscapesUsingEncoding(kCFAllocatorDefault,
+ (__bridge CFStringRef)linkURL, //Now escape it the way NSURL demands
@@ -132,7 +126,7 @@
- return (escapedURLString ? [(NSString *)escapedURLString autorelease] : linkURL);
+ return (escapedURLString ? (__bridge NSString *)escapedURLString : linkURL); --- a/Plugins/Link Management/SHLinkEditorWindowController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Link Management/SHLinkEditorWindowController.m Sun Sep 09 12:24:39 2012 -0400
@@ -59,8 +59,8 @@
if ((self = [super initWithWindowNibName:LINK_EDITOR_NIB_NAME])) {
- textView = [inTextView retain];
- target = [inTarget retain];
@@ -69,9 +69,6 @@
[[NSNotificationCenter defaultCenter] removeObserver:self];
#pragma mark Window Methods
@@ -132,8 +129,8 @@
[(NSURL *)linkURL absoluteString]);
- tmpString = (NSString *)CFURLCreateStringByReplacingPercentEscapes(kCFAllocatorDefault,
- (CFStringRef)tmpString,
+ tmpString = (__bridge_transfer NSString *)CFURLCreateStringByReplacingPercentEscapes(kCFAllocatorDefault, + (__bridge CFStringRef)tmpString, @@ -142,9 +139,6 @@
initialURL = [[NSAttributedString alloc] initWithString:tmpString];
[[textView_URL textStorage] setAttributedString:initialURL];
[textView_URL setSelectedRange:NSMakeRange(0,[initialURL length])];
} else if ([linkText length]) {
@@ -167,14 +161,12 @@
- (void)windowWillClose:(id)sender
[super windowWillClose:sender];
// Called as the sheet closes, dismisses the sheet
- (void)sheetDidEnd:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo
@@ -216,8 +208,6 @@
// If the URL is invalid enough that we can't create an NSURL, just beep
- (IBAction)removeURL:(id)sender
@@ -242,7 +232,7 @@
// We need to make sure we're getting copies of these, otherwise the fields will change them later, changing the
// copy in our dictionary
NSDictionary *linkDict = [NSDictionary dictionaryWithObjectsAndKeys:
- [[[textField_linkText stringValue] copy] autorelease], KEY_LINK_TITLE,
+ [[textField_linkText stringValue] copy], KEY_LINK_TITLE, [textView_URL linkURL], KEY_LINK_URL,
@@ -259,8 +249,8 @@
NSMutableAttributedString *linkString;
// Create the link string
- linkString = [[[NSMutableAttributedString alloc] initWithString:linkTitle
- attributes:typingAttributes] autorelease];
+ linkString = [[NSMutableAttributedString alloc] initWithString:linkTitle + attributes:typingAttributes]; [linkString addAttribute:NSLinkAttributeName value:linkURL range:NSMakeRange(0,[linkString length])];
// Insert it into the text view, replacing the current selection
@@ -274,12 +264,12 @@
// If this link was inserted at the end of our text view, add a space and set the formatting back to normal
// This prevents the link attribute from bleeding into newly entered text
if (NSMaxRange([inView selectedRange]) == [textStorage length]) {
- NSAttributedString *tmpString = [[[NSAttributedString alloc] initWithString:@" "
- attributes:typingAttributes] autorelease];
+ NSAttributedString *tmpString = [[NSAttributedString alloc] initWithString:@" " + attributes:typingAttributes]; [[[inView undoManager] prepareWithInvocationTarget:textStorage]
replaceCharactersInRange:NSMakeRange(NSMaxRange([inView selectedRange]), 1)
- withAttributedString:[[[NSAttributedString alloc] initWithString:@""
- attributes:typingAttributes] autorelease]];
+ withAttributedString:[[NSAttributedString alloc] initWithString:@"" + attributes:typingAttributes]]; [textStorage appendAttributedString:tmpString];
--- a/Plugins/Link Management/SHLinkManagementPlugin.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Link Management/SHLinkManagementPlugin.m Sun Sep 09 12:24:39 2012 -0400
@@ -43,17 +43,17 @@
//Add/Edit Link... menu item (edit menu)
- menuItem = [[[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:EDIT_LINK_TITLE
+ menuItem = [[NSMenuItem alloc] initWithTitle:EDIT_LINK_TITLE action:@selector(editFormattedLink:)
- keyEquivalent:@"k"] autorelease];
[adium.menuController addMenuItem:menuItem toLocation:LOC_Edit_Links];
- menuItem = [[[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:EDIT_LINK_TITLE
+ menuItem = [[NSMenuItem alloc] initWithTitle:EDIT_LINK_TITLE action:@selector(editFormattedLink:)
- keyEquivalent:@""] autorelease];
[adium.menuController addContextualMenuItem:menuItem toLocation:Context_TextView_LinkEditing];
[self registerToolbarItem];
@@ -141,10 +141,10 @@
//Unregister the existing toolbar item first
[adium.toolbarController unregisterToolbarItem:toolbarItem forToolbarType:@"TextEntry"];
- [toolbarItem release]; toolbarItem = nil;
- toolbarItem = [[AIToolbarUtilities toolbarItemWithIdentifier:@"LinkEditor"
+ toolbarItem = [AIToolbarUtilities toolbarItemWithIdentifier:@"LinkEditor" label:AILocalizedString(@"Link",nil)
paletteLabel:AILocalizedString(@"Insert Link",nil)
toolTip:AILocalizedString(@"Add/Edit Hyperlink",nil)
@@ -152,7 +152,7 @@
settingSelector:@selector(setImage:)
itemContent:[NSImage imageNamed:@"msg-insert-link" forClass:[self class] loadLazily:YES]
action:@selector(editFormattedLink:)
[adium.toolbarController registerToolbarItem:toolbarItem forToolbarType:@"TextEntry"];
--- a/Plugins/Message Alias Support/AIMessageAliasPlugin.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Message Alias Support/AIMessageAliasPlugin.m Sun Sep 09 12:24:39 2012 -0400
@@ -62,10 +62,9 @@
if ([linkURL isKindOfClass:[NSURL class]]) {
- linkURLString = (NSString *)CFURLCreateStringByReplacingPercentEscapes(kCFAllocatorDefault,
- (CFStringRef)[(NSURL *)linkURL absoluteString],
+ linkURLString = (__bridge_transfer NSString *)CFURLCreateStringByReplacingPercentEscapes(kCFAllocatorDefault, + (__bridge CFStringRef)[(NSURL *)linkURL absoluteString], /* characters to leave escaped */ CFSTR(""));
- [linkURLString autorelease];
linkURLString = (NSString *)linkURL;
@@ -81,10 +80,10 @@
NSString *escapedLinkURLString;
NSString *charactersToLeaveUnescaped = @"#";
- if (!filteredMessage) filteredMessage = [[inAttributedString mutableCopy] autorelease];
- escapedLinkURLString = (NSString *)CFURLCreateStringByAddingPercentEscapes(/* allocator */ kCFAllocatorDefault,
- (CFStringRef)charactersToLeaveUnescaped,
+ if (!filteredMessage) filteredMessage = [inAttributedString mutableCopy]; + escapedLinkURLString = (__bridge_transfer NSString *)CFURLCreateStringByAddingPercentEscapes(/* allocator */ kCFAllocatorDefault, + (__bridge CFStringRef)result, + (__bridge CFStringRef)charactersToLeaveUnescaped, /* legal characters to escape */ NULL,
newURL = [NSURL URLWithString:escapedLinkURLString];
@@ -94,7 +93,6 @@
- [escapedLinkURLString release];
@@ -160,7 +158,7 @@
- if (!newAttributedString) newAttributedString = [[attributedString mutableCopy] autorelease];
+ if (!newAttributedString) newAttributedString = [attributedString mutableCopy]; [newAttributedString replaceOccurrencesOfString:@"%n"
@@ -174,11 +172,10 @@
NSCalendarDate *currentDate = [NSCalendarDate calendarDate];
__block NSString *calendarFormat;
[NSDateFormatter withLocalizedShortDateFormatterPerform:^(NSDateFormatter *dateFormatter){
- calendarFormat = [[dateFormatter dateFormat] retain];
+ calendarFormat = [dateFormatter dateFormat]; - [calendarFormat autorelease];
- if (!newAttributedString) newAttributedString = [[attributedString mutableCopy] autorelease];
+ if (!newAttributedString) newAttributedString = [attributedString mutableCopy]; [newAttributedString replaceOccurrencesOfString:@"%d"
withString:[currentDate descriptionWithCalendarFormat:calendarFormat]
@@ -190,7 +187,7 @@
if ([self string:str containsValidKeyword:@"%t"]) {
NSCalendarDate *currentDate = [NSCalendarDate calendarDate];
- if (!newAttributedString) newAttributedString = [[attributedString mutableCopy] autorelease];
+ if (!newAttributedString) newAttributedString = [attributedString mutableCopy]; [NSDateFormatter withLocalizedDateFormatterShowingSeconds:YES showingAMorPM:YES perform:^(NSDateFormatter *localDateFormatter){
[newAttributedString replaceOccurrencesOfString:@"%t"
--- a/Plugins/Nudge and Buzz Handler/AINudgeBuzzHandlerPlugin.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Nudge and Buzz Handler/AINudgeBuzzHandlerPlugin.m Sun Sep 09 12:24:39 2012 -0400
@@ -120,8 +120,6 @@
[[NSNotificationCenter defaultCenter] removeObserver:self];
- [notifyMenuItem release];
- [notifyContextualMenuItem release];
#pragma mark Toolbar Handling
@@ -366,7 +364,7 @@
static NSImage *eventImage = nil;
//Use the message icon from the main bundle
- if (!eventImage) eventImage = [[NSImage imageNamed:@"events-message"] retain];
+ if (!eventImage) eventImage = [NSImage imageNamed:@"events-message"]; --- a/Plugins/Purple Service/AIFacebookXMPPAccount.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/AIFacebookXMPPAccount.h Sun Sep 09 12:24:39 2012 -0400
@@ -34,22 +34,22 @@
- NSURLConnection *connection; // weak
- NSURLResponse *connectionResponse;
- NSMutableData *connectionData;
+ NSURLConnection *__weak connection; + NSURLResponse *__weak connectionResponse; + NSMutableData *__weak connectionData; - NSDictionary *migrationData;
+ NSDictionary *__weak migrationData; + (BOOL)uidIsValidForFacebook:(NSString *)inUID;
-@property (nonatomic, retain) AIFacebookXMPPOAuthWebViewWindowController *oAuthWC;
+@property (nonatomic, strong) AIFacebookXMPPOAuthWebViewWindowController *oAuthWC; - (void)requestFacebookAuthorization;
- (void)oAuthWebViewController:(AIFacebookXMPPOAuthWebViewWindowController *)wc didSucceedWithToken:(NSString *)token;
- (void)oAuthWebViewControllerDidFail:(AIFacebookXMPPOAuthWebViewWindowController *)wc;
-@property (nonatomic, retain) NSDictionary *migrationData;
+@property (weak, nonatomic) NSDictionary *migrationData; @interface AIFacebookXMPPAccount (ForSubclasses)
--- a/Plugins/Purple Service/AIFacebookXMPPAccount.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/AIFacebookXMPPAccount.m Sun Sep 09 12:24:39 2012 -0400
@@ -39,9 +39,9 @@
@property (nonatomic, copy) NSString *oAuthToken;
@property (nonatomic, assign) NSUInteger networkState;
-@property (nonatomic, assign) NSURLConnection *connection; // assign because NSURLConnection retains its delegate.
-@property (nonatomic, retain) NSURLResponse *connectionResponse;
-@property (nonatomic, retain) NSMutableData *connectionData;
+@property (nonatomic, weak) NSURLConnection *connection; // assign because NSURLConnection retains its delegate. +@property (weak, nonatomic) NSURLResponse *connectionResponse; +@property (weak, nonatomic) NSMutableData *connectionData; - (void)meGraphAPIDidFinishLoading:(NSData *)graphAPIData response:(NSURLResponse *)response error:(NSError *)inError;
- (void)promoteSessionDidFinishLoading:(NSData *)secretData response:(NSURLResponse *)response error:(NSError *)inError;
@@ -75,14 +75,7 @@
- [connectionResponse release];
- [connectionData release];
#pragma mark Connectivitiy
@@ -281,7 +274,7 @@
- (void)requestFacebookAuthorization
- self.oAuthWC = [[[AIFacebookXMPPOAuthWebViewWindowController alloc] init] autorelease];
+ self.oAuthWC = [[AIFacebookXMPPOAuthWebViewWindowController alloc] init]; self.oAuthWC.account = self;
[[NSNotificationCenter defaultCenter] postNotificationName:AIFacebookXMPPAuthProgressNotification
@@ -460,8 +453,8 @@
- (void)connectionDidFinishLoading:(NSURLConnection *)inConnection
- NSURLResponse *response = [[[self connectionResponse] retain] autorelease];
- NSMutableData *data = [[[self connectionData] retain] autorelease];
+ NSURLResponse *response = [self connectionResponse]; + NSMutableData *data = [self connectionData]; NSUInteger state = [self networkState];
[self setNetworkState:AINoNetworkState];
--- a/Plugins/Purple Service/AIFacebookXMPPAccountViewController.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/AIFacebookXMPPAccountViewController.h Sun Sep 09 12:24:39 2012 -0400
@@ -11,17 +11,17 @@
@interface AIFacebookXMPPAccountViewController : PurpleAccountViewController {
AILocalizationTextField *label_instructions;
- AILocalizationButton *button_OAuthStart;
- NSTextField *textField_OAuthStatus;
- NSProgressIndicator *spinner;
+ AILocalizationButton *__weak button_OAuthStart; + NSTextField *__weak textField_OAuthStatus; + NSProgressIndicator *__weak spinner;
+ NSButton *__weak button_help; -@property (assign) IBOutlet NSProgressIndicator *spinner;
-@property (assign) IBOutlet NSTextField *textField_OAuthStatus;
-@property (assign) IBOutlet NSButton *button_OAuthStart;
-@property (assign) IBOutlet NSButton *button_help;
+@property (weak) IBOutlet NSProgressIndicator *spinner; +@property (weak) IBOutlet NSTextField *textField_OAuthStatus; +@property (weak) IBOutlet NSButton *button_OAuthStart; +@property (weak) IBOutlet NSButton *button_help; - (IBAction)showHelp:(id)sender;
--- a/Plugins/Purple Service/AIFacebookXMPPAccountViewController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/AIFacebookXMPPAccountViewController.m Sun Sep 09 12:24:39 2012 -0400
@@ -25,7 +25,6 @@
[[NSNotificationCenter defaultCenter] removeObserver:self];
--- a/Plugins/Purple Service/AIFacebookXMPPOAuthWebViewWindowController.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/AIFacebookXMPPOAuthWebViewWindowController.h Sun Sep 09 12:24:39 2012 -0400
@@ -12,27 +12,27 @@
@class AIFacebookXMPPAccount;
@interface AIFacebookXMPPOAuthWebViewWindowController : AIWindowController {
- IBOutlet WebView *webView;
- IBOutlet NSProgressIndicator *spinner;
+ __unsafe_unretained IBOutlet WebView *webView; + __unsafe_unretained IBOutlet NSProgressIndicator *spinner; NSMutableDictionary *cookies;
- AIFacebookXMPPAccount *account;
+ __unsafe_unretained AIFacebookXMPPAccount *account; - NSString *autoFillUsername;
- NSString *autoFillPassword;
+ __unsafe_unretained NSString *autoFillUsername; + __unsafe_unretained NSString *autoFillPassword; -@property (nonatomic, retain) IBOutlet WebView *webView;
-@property (nonatomic, retain) IBOutlet NSProgressIndicator *spinner;
+@property (nonatomic, assign) IBOutlet WebView *webView; +@property (nonatomic, assign) IBOutlet NSProgressIndicator *spinner; -@property (nonatomic, retain) NSMutableDictionary *cookies;
-@property (nonatomic, retain) AIFacebookXMPPAccount *account;
+@property (nonatomic, strong) NSMutableDictionary *cookies; +@property (nonatomic, assign) AIFacebookXMPPAccount *account; -@property (nonatomic, retain) NSString *autoFillUsername;
-@property (nonatomic, retain) NSString *autoFillPassword;
+@property (nonatomic, assign) NSString *autoFillUsername; +@property (nonatomic, assign) NSString *autoFillPassword; @property (nonatomic) BOOL isMigrating;
--- a/Plugins/Purple Service/AIFacebookXMPPOAuthWebViewWindowController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/AIFacebookXMPPOAuthWebViewWindowController.m Sun Sep 09 12:24:39 2012 -0400
@@ -28,21 +28,14 @@
if ((self = [super initWithWindowNibName:@"AIFacebookXMPPOauthWebViewWindow"])) {
- self.cookies = [[[NSMutableDictionary alloc] init] autorelease];
+ self.cookies = [[NSMutableDictionary alloc] init];
- (NSString *)adiumFrameAutosaveName
@@ -77,7 +70,7 @@
- (NSDictionary*)parseURLParams:(NSString *)query {
NSArray *pairs = [query componentsSeparatedByString:@"&"];
- NSMutableDictionary *params = [[[NSMutableDictionary alloc] init] autorelease];
+ NSMutableDictionary *params = [[NSMutableDictionary alloc] init]; for (NSString *pair in pairs) {
NSArray *kv = [pair componentsSeparatedByString:@"="];
NSString *val = [[kv objectAtIndex:1] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
@@ -129,7 +122,7 @@
[self addCookiesFromResponse:(id)redirectResponse];
- NSMutableURLRequest *mutableRequest = [[request mutableCopy] autorelease];
+ NSMutableURLRequest *mutableRequest = [request mutableCopy]; [mutableRequest setHTTPShouldHandleCookies:NO];
[self addCookiesToRequest:mutableRequest];
@@ -214,7 +207,7 @@
[sentCookies addObject:cookie];
- NSMutableDictionary *headers = [[[request allHTTPHeaderFields] mutableCopy] autorelease];
+ NSMutableDictionary *headers = [[request allHTTPHeaderFields] mutableCopy]; [headers setValuesForKeysWithDictionary:[NSHTTPCookie requestHeaderFieldsWithCookies:sentCookies]];
[request setAllHTTPHeaderFields:headers];
--- a/Plugins/Purple Service/AIIRCServicesPasswordPlugin.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/AIIRCServicesPasswordPlugin.m Sun Sep 09 12:24:39 2012 -0400
@@ -46,11 +46,6 @@
[[NSNotificationCenter defaultCenter] removeObserver:self];
#pragma mark Content handling
- (void)willReceiveContent:(NSNotification *)notification
--- a/Plugins/Purple Service/AIPurpleCertificateTrustWarningAlert.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/AIPurpleCertificateTrustWarningAlert.m Sun Sep 09 12:24:39 2012 -0400
@@ -70,7 +70,6 @@
AIPurpleCertificateTrustWarningAlert *alert = [[self alloc] initWithAccount:account hostname:hostname certificates:certs resultCallback:_query_cert_cb userData:ud];
- (id)initWithAccount:(AIAccount*)_account
@@ -92,84 +91,47 @@
- (IBAction)showWindow:(id)sender {
- SecPolicySearchRef searchRef = NULL;
- err = SecCertificateGetData((SecCertificateRef)CFArrayGetValueAtIndex(certificates, 0), &data);
+ CFDataRef data = SecCertificateCopyData((SecCertificateRef)CFArrayGetValueAtIndex(certificates, 0)); // Did we ask the user to confirm this certificate before?
// Note that this information is not stored on the disk, which is on purpose.
NSUInteger oldCertHash = [[acceptedCertificates objectForKey:hostname] unsignedIntegerValue];
- NSData *certData = [[NSData alloc] initWithBytesNoCopy:data.Data length:data.Length freeWhenDone:NO];
- NSUInteger newCertHash = [certData hash];
+ NSUInteger newCertHash = [(__bridge NSData *)data hash]; if (oldCertHash == newCertHash) {
query_cert_cb(true, userdata);
- err = SecPolicySearchCreate(CSSM_CERT_X_509v3, &CSSMOID_APPLE_TP_SSL, NULL, &searchRef);
- err = SecPolicySearchCopyNext(searchRef, &policyRef);
NSAssert( UINT_MAX > [hostname length],
@"More string data than libpurple can handle. Abort." );
- CSSM_APPLE_TP_SSL_OPTIONS ssloptions = {
- .Version = CSSM_APPLE_TP_SSL_OPTS_VERSION,
- .ServerNameLen = (UInt32)([hostname length]+1),
- .ServerName = [hostname cStringUsingEncoding:NSASCIIStringEncoding],
- CSSM_DATA theCssmData = {
- .Length = sizeof(ssloptions),
- .Data = (uint8*)&ssloptions
- SecPolicySetValue(policyRef, &theCssmData); // Don't care about the error
+ policyRef = SecPolicyCreateSSL(YES, (__bridge CFStringRef)hostname); err = SecTrustCreateWithCertificates(certificates, policyRef, &trustRef);
// test whether we aren't already trusting this certificate
SecTrustResultType result;
err = SecTrustEvaluate(trustRef, &result);
@@ -180,7 +142,6 @@
case kSecTrustResultUnspecified: // trust ok, user has no particular opinion about this
#ifndef ALWAYS_SHOW_TRUST_WARNING
query_cert_cb(true, userdata);
case kSecTrustResultConfirm: // trust ok, but user asked (earlier) that you check with him before proceeding
@@ -192,10 +153,10 @@
//Show on an independent window.
#define TRUST_PANEL_WIDTH 535
- NSWindow *fakeWindow = [[[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, TRUST_PANEL_WIDTH, 1)
+ NSWindow *fakeWindow = [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, TRUST_PANEL_WIDTH, 1) styleMask:(NSTitledWindowMask | NSMiniaturizableWindowMask)
backing:NSBackingStoreBuffered
- defer:NO] autorelease];
[fakeWindow setTitle:AILocalizedString(@"Verify Certificate", nil)];
@@ -213,15 +174,12 @@
* kSecTrustResultInvalid -> logic error; fix your program (SecTrust was used incorrectly)
query_cert_cb(false, userdata);
query_cert_cb(false, userdata);
@@ -233,19 +191,7 @@
static SecPolicyRef SSLSecPolicyCopy()
- SecPolicyRef policy = NULL;
- SecPolicySearchRef policy_search;
- status = SecPolicySearchCreate(CSSM_CERT_X_509v3, &CSSMOID_APPLE_TP_SSL, NULL, &policy_search);
- status = SecPolicySearchCopyNext(policy_search, &policy);
- if (status != noErr) policy = NULL;
- CFRelease(policy_search);
+ return SecPolicyCreateSSL(NO, NULL); - (void)runTrustPanelOnWindow:(NSWindow *)window
@@ -274,14 +220,14 @@
SecPolicyRef sslPolicy = SSLSecPolicyCopy();
- [trustPanel setPolicies:(id)sslPolicy];
+ [trustPanel setPolicies:(__bridge id)sslPolicy]; [trustPanel beginSheetForWindow:window
didEndSelector:@selector(certificateTrustSheetDidEnd:returnCode:contextInfo:)
+ contextInfo:(__bridge void *)window @@ -294,27 +240,22 @@
- (void)certificateTrustSheetDidEnd:(SFCertificateTrustPanel *)trustpanel returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo {
BOOL didTrustCerficate = (returnCode == NSOKButton);
- NSWindow *parentWindow = (NSWindow *)contextInfo;
+ NSWindow *parentWindow = (__bridge NSWindow *)contextInfo; query_cert_cb(didTrustCerficate, userdata);
/* If the user confirmed this cert, we store this information until the app is closed so the user doesn't have to re-confirm it every time
* (doing otherwise might be particularily annoying on auto-reconnect)
- OSStatus err = SecCertificateGetData((SecCertificateRef)CFArrayGetValueAtIndex(certificates, 0), &certdata);
- [acceptedCertificates setObject:[NSNumber numberWithUnsignedInteger:[[NSData dataWithBytes:certdata.Data length:certdata.Length] hash]]
+ CFDataRef data = SecCertificateCopyData((SecCertificateRef)CFArrayGetValueAtIndex(certificates, 0)); + [acceptedCertificates setObject:[NSNumber numberWithUnsignedInteger:[(__bridge NSData *)data hash]]
[parentWindow performClose:nil];
--- a/Plugins/Purple Service/AIPurpleCertificateViewer.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/AIPurpleCertificateViewer.m Sun Sep 09 12:24:39 2012 -0400
@@ -31,7 +31,6 @@
+ (void)displayCertificateChain:(CFArrayRef)cc forAccount:(AIAccount*)account {
AIPurpleCertificateViewer *viewer = [[self alloc] initWithCertificateChain:cc forAccount:account];
- (id)initWithCertificateChain:(CFArrayRef)cc forAccount:(AIAccount*)_account {
@@ -40,12 +39,11 @@
CFRetain(certificatechain);
CFRelease(certificatechain);
- (IBAction)showWindow:(id)sender {
@@ -54,12 +52,11 @@
- (void)editAccountWindow:(NSWindow*)window didOpenForAccount:(AIAccount *)inAccount {
SFCertificatePanel *panel = [[SFCertificatePanel alloc] init];
- [panel beginSheetForWindow:window modalDelegate:self didEndSelector:@selector(certificateSheetDidEnd:returnCode:contextInfo:) contextInfo:window certificates:(NSArray*)certificatechain showGroup:YES];
+ [panel beginSheetForWindow:window modalDelegate:self didEndSelector:@selector(certificateSheetDidEnd:returnCode:contextInfo:) contextInfo:(__bridge void *)window certificates:(__bridge NSArray*)certificatechain showGroup:YES]; - (void)certificateSheetDidEnd:(SFCertificatePanel*)panel returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo {
- NSWindow *win = (NSWindow*)contextInfo;
+ NSWindow *win = (__bridge NSWindow*)contextInfo; [win performSelector:@selector(performClose:) withObject:nil afterDelay:0.0];
--- a/Plugins/Purple Service/AIPurpleGTalkAccount.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/AIPurpleGTalkAccount.m Sun Sep 09 12:24:39 2012 -0400
@@ -54,7 +54,7 @@
-- (AIReconnectDelayType)shouldAttemptReconnectAfterDisconnectionError:(NSString **)disconnectionError
+- (AIReconnectDelayType)shouldAttemptReconnectAfterDisconnectionError:(NSString * __strong *)disconnectionError AIReconnectDelayType shouldAttemptReconnect = [super shouldAttemptReconnectAfterDisconnectionError:disconnectionError];
--- a/Plugins/Purple Service/AMPurpleJabberAdHocCommand.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/AMPurpleJabberAdHocCommand.m Sun Sep 09 12:24:39 2012 -0400
@@ -32,17 +32,13 @@
- (AMPurpleJabberFormGenerator*)form {
xmlnode *jabberForm = xmlnode_get_child_with_namespace(command,"x","jabber:x:data");
- return [[[AMPurpleJabberFormGenerator alloc] initWithXML:form] autorelease];
+ return [[AMPurpleJabberFormGenerator alloc] initWithXML:form]; @@ -59,9 +55,7 @@
- (void)setSessionid:(NSString*)_sessionid {
sessionid = [_sessionid copy];
- (AMPurpleJabberAdHocCommand*)generateReplyWithForm:(AMPurpleJabberFormGenerator*)jabberForm actions:(NSArray*)actions defaultAction:(NSUInteger)defaultAction status:(enum AMPurpleJabberAdHocCommandStatus)status {
@@ -98,7 +92,7 @@
AMPurpleJabberAdHocCommand *cmd = [[AMPurpleJabberAdHocCommand alloc] initWithServer:server command:newcmd jid:jid iqid:iqid];
- return [cmd autorelease];
- (AMPurpleJabberAdHocCommand*)generateReplyWithNote:(NSString*)text type:(enum AMPurpleJabberAdHocCommandNoteType)type status:(enum AMPurpleJabberAdHocCommandStatus)status {
@@ -140,7 +134,7 @@
AMPurpleJabberAdHocCommand *cmd = [[AMPurpleJabberAdHocCommand alloc] initWithServer:server command:newcmd jid:jid iqid:iqid];
- return [cmd autorelease];
--- a/Plugins/Purple Service/AMPurpleJabberAdHocServer.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/AMPurpleJabberAdHocServer.m Sun Sep 09 12:24:39 2012 -0400
@@ -27,59 +27,57 @@
@implementation AMPurpleJabberAdHocServer
static void AMPurpleJabberAdHocServer_received_data_cb(PurpleConnection *gc, xmlnode **packet, gpointer this) {
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- AMPurpleJabberAdHocServer *self = this;
- PurpleAccount *account = [self.account purpleAccount];
- if(purple_account_get_connection(account) == gc) {
- if(strcmp((*packet)->name,"iq")) {
- const char *type = xmlnode_get_attrib(*packet,"type");
- if(!type || strcmp(type,"set")) {
- return; // doesn't talk to us, probably the user interacting with some other adhoc node
- const char *from = xmlnode_get_attrib(*packet,"from");
- const char *iqid = xmlnode_get_attrib(*packet,"id");
- xmlnode *command = xmlnode_get_child_with_namespace(*packet,"command","http://jabber.org/protocol/commands");
- BOOL handled = [self receivedCommand:command
- from:from?[NSString stringWithUTF8String:from]:nil
- iqid:iqid?[NSString stringWithUTF8String:iqid]:nil];
+ AMPurpleJabberAdHocServer *self = (__bridge AMPurpleJabberAdHocServer *)this; + PurpleAccount *account = [self.account purpleAccount]; + if(purple_account_get_connection(account) == gc) { + if(strcmp((*packet)->name,"iq")) { + const char *type = xmlnode_get_attrib(*packet,"type"); + if(!type || strcmp(type,"set")) { + return; // doesn't talk to us, probably the user interacting with some other adhoc node + const char *from = xmlnode_get_attrib(*packet,"from"); + const char *iqid = xmlnode_get_attrib(*packet,"id"); + xmlnode *command = xmlnode_get_child_with_namespace(*packet,"command","http://jabber.org/protocol/commands"); + BOOL handled = [self receivedCommand:command + from:from?[NSString stringWithUTF8String:from]:nil + iqid:iqid?[NSString stringWithUTF8String:iqid]:nil];
/* we have to catch the reply to a disco#info for http://jabber.org/protocol/commands and insert our nodes */
static void xmlnode_sent_cb(PurpleConnection *gc, xmlnode **packet, gpointer this) {
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- xmlnode *xml = *packet;
- AMPurpleJabberAdHocServer *self = this;
- PurpleAccount *account = [self.account purpleAccount];
- if(xml && purple_account_get_connection(account) == gc) {
- if(!strcmp(xml->name,"iq")) {
- const char *tostr = xmlnode_get_attrib(xml,"to");
- NSString *to = [NSString stringWithUTF8String:tostr];
- NSRange slash = [to rangeOfString:@"/"];
- if(slash.location != NSNotFound) {
- NSString *barejid = [to substringToIndex:slash.location];
- if([barejid isEqualToString:self.account.UID]) {
- const char *type = xmlnode_get_attrib(xml,"type");
- if(type && !strcmp(type,"result")) {
- xmlnode *query = xmlnode_get_child_with_namespace(xml,"query","http://jabber.org/protocol/disco#items");
- const char *node = xmlnode_get_attrib(query,"node");
- if(node && !strcmp(node,"http://jabber.org/protocol/commands"))
- [self addCommandsToXML:query];
+ xmlnode *xml = *packet; + AMPurpleJabberAdHocServer *self = (__bridge AMPurpleJabberAdHocServer *)this; + PurpleAccount *account = [self.account purpleAccount]; + if(xml && purple_account_get_connection(account) == gc) { + if(!strcmp(xml->name,"iq")) { + const char *tostr = xmlnode_get_attrib(xml,"to"); + NSString *to = [NSString stringWithUTF8String:tostr]; + NSRange slash = [to rangeOfString:@"/"]; + if(slash.location != NSNotFound) { + NSString *barejid = [to substringToIndex:slash.location]; + if([barejid isEqualToString:self.account.UID]) { + const char *type = xmlnode_get_attrib(xml,"type"); + if(type && !strcmp(type,"result")) { + xmlnode *query = xmlnode_get_child_with_namespace(xml,"query","http://jabber.org/protocol/disco#items"); + const char *node = xmlnode_get_attrib(query,"node"); + if(node && !strcmp(node,"http://jabber.org/protocol/commands")) + [self addCommandsToXML:query]; @@ -87,7 +85,6 @@
@@ -103,22 +100,19 @@
PurplePlugin *jabber = purple_find_prpl("prpl-jabber");
AILog(@"Unable to locate jabber prpl");
- purple_signal_connect(jabber, "jabber-receiving-xmlnode", self,
- PURPLE_CALLBACK(AMPurpleJabberAdHocServer_received_data_cb), self);
- purple_signal_connect(jabber, "jabber-sending-xmlnode", self,
- PURPLE_CALLBACK(xmlnode_sent_cb), self);
+ purple_signal_connect(jabber, "jabber-receiving-xmlnode", (__bridge void *)(self), + PURPLE_CALLBACK(AMPurpleJabberAdHocServer_received_data_cb), (__bridge void *)(self)); + purple_signal_connect(jabber, "jabber-sending-xmlnode", (__bridge void *)(self), + PURPLE_CALLBACK(xmlnode_sent_cb), (__bridge void *)(self)); - purple_signals_disconnect_by_handle(self);
+ purple_signals_disconnect_by_handle((__bridge void *)(self)); - (void)addCommand:(NSString*)node delegate:(id<AMPurpleJabberAdHocServerDelegate>)delegate name:(NSString*)name {
@@ -164,7 +158,6 @@
if(delegate && [[delegate nonretainedObjectValue] respondsToSelector:@selector(adHocServer:executeCommand:)]) {
AMPurpleJabberAdHocCommand *cmd = [[AMPurpleJabberAdHocCommand alloc] initWithServer:self command:command jid:jid iqid:iqid];
[[delegate nonretainedObjectValue] adHocServer:self executeCommand:cmd];
--- a/Plugins/Purple Service/AMPurpleJabberFormGenerator.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/AMPurpleJabberFormGenerator.m Sun Sep 09 12:24:39 2012 -0400
@@ -54,7 +54,7 @@
- return [[[class alloc] initWithXML:xml] autorelease];
+ return [[class alloc] initWithXML:xml]; - (id)initWithXML:(xmlnode*)xml {
@@ -86,9 +86,7 @@
- (void)setLabel:(NSString*)_label {
@@ -96,9 +94,7 @@
- (void)setVariable:(NSString*)_var {
@@ -106,22 +102,13 @@
- (void)setDescription:(NSString*)_desc {
xmlnode *xml_result = xmlnode_new("field");
@@ -187,15 +174,8 @@
- (void)setStringValue:(NSString*)_value {
- (NSString*)stringValue {
@@ -228,15 +208,8 @@
- (void)setStringValue:(NSString*)_value {
- (NSString*)stringValue {
@@ -273,15 +246,8 @@
- (void)setJIDs:(NSArray*)_jids {
@@ -317,15 +283,8 @@
- (void)setJID:(NSString*)_jid {
@@ -367,12 +326,10 @@
xmlnode *lvaluenode = xmlnode_get_child(option,"value");
const char *valuestr = xmlnode_get_data(lvaluenode);
[newoptions addObject:[NSDictionary dictionaryWithObjectsAndKeys:
@@ -386,16 +343,8 @@
- (void)setOptions:(NSArray*)_options {
options = [_options copy];
@@ -403,9 +352,7 @@
- (void)setStringValues:(NSArray*)_values {
- (NSArray*)stringValues {
@@ -451,12 +398,10 @@
xmlnode *lvaluenode = xmlnode_get_child(option,"value");
const char *valuestr = xmlnode_get_data(lvaluenode);
[newoptions addObject:[NSDictionary dictionaryWithObjectsAndKeys:
@@ -470,16 +415,8 @@
- (void)setStringValue:(NSString*)_value {
- (NSString*)stringValue {
@@ -487,9 +424,7 @@
- (void)setOptions:(NSArray*)_options {
options = [_options copy];
@@ -534,15 +469,8 @@
- (void)setStringValue:(NSString*)_value {
- (NSString*)stringValue {
@@ -577,15 +505,9 @@
- (void)setStringValue:(NSString*)_value {
- (NSString*)stringValue {
@@ -618,15 +540,8 @@
- (void)setStringValue:(NSString*)_value {
- (NSString*)stringValue {
@@ -659,19 +574,16 @@
if((self = [super init])) {
// verify that this is really a jabber:x:data
if(xml->type != XMLNODE_TYPE_TAG || strcmp(xml->name, "x")) {
const char *xmlns = xmlnode_get_namespace(xml);
if(!xmlns || strcmp(xmlns,"jabber:x:data")) {
const char *typestr = xmlnode_get_attrib(xml,"type");
@@ -684,7 +596,6 @@
else if(!strcmp(typestr, "result"))
else { /* unknown form type */
@@ -715,23 +626,12 @@
- [instructions release];
- (void)setTitle:(NSString*)_title {
- (void)setInstructions:(NSString*)_instructions {
instructions = [_instructions copy];
--- a/Plugins/Purple Service/AMPurpleJabberMoodTooltip.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/AMPurpleJabberMoodTooltip.m Sun Sep 09 12:24:39 2012 -0400
@@ -57,7 +57,7 @@
str = [NSString stringWithUTF8String:mood];
- return [[[NSAttributedString alloc] initWithString:str attributes:nil] autorelease];
+ return [[NSAttributedString alloc] initWithString:str attributes:nil]; --- a/Plugins/Purple Service/AMPurpleJabberNode.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/AMPurpleJabberNode.h Sun Sep 09 12:24:39 2012 -0400
@@ -31,9 +31,9 @@
+ NSSet *__weak features; + NSArray *__weak identities; AMPurpleJabberNode *commands;
@@ -48,10 +48,10 @@
@property (readonly, copy, nonatomic) NSString *name;
@property (readonly, copy, nonatomic) NSString *jid;
@property (readonly, copy, nonatomic) NSString *node;
-@property (readonly, nonatomic) NSArray *items;
-@property (readonly, retain, nonatomic) NSSet *features;
-@property (readonly, retain, nonatomic) NSArray *identities;
-@property (readonly, nonatomic) NSArray *commands;
+@property (weak, readonly, nonatomic) NSArray *items; +@property (weak, readonly, nonatomic) NSSet *features; +@property (weak, readonly, nonatomic) NSArray *identities; +@property (weak, readonly, nonatomic) NSArray *commands; - (void)addDelegate:(id<AMPurpleJabberNodeDelegate>)delegate;
- (void)removeDelegate:(id<AMPurpleJabberNodeDelegate>)delegate;
--- a/Plugins/Purple Service/AMPurpleJabberNode.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/AMPurpleJabberNode.m Sun Sep 09 12:24:39 2012 -0400
@@ -22,12 +22,12 @@
@property (readwrite, copy, nonatomic) NSString *name;
@property (readwrite, copy, nonatomic) NSString *jid;
@property (readwrite, copy, nonatomic) NSString *node;
-@property (readwrite, retain, nonatomic) NSSet *features;
-@property (readwrite, retain, nonatomic) NSArray *identities;
-@property (readwrite, retain, nonatomic) AMPurpleJabberNode *commandsNode;
+@property (weak, readwrite, nonatomic) NSSet *features; +@property (weak, readwrite, nonatomic) NSArray *identities; +@property (readwrite, nonatomic, strong) AMPurpleJabberNode *commandsNode; @property (readwrite, assign, nonatomic) PurpleConnection *gc;
-@property (readwrite, retain, nonatomic) NSMutableArray *delegates;
-@property (readwrite, retain, nonatomic) NSArray *itemsArray;
+@property (readwrite, nonatomic, strong) NSMutableArray *delegates; +@property (weak, readwrite, nonatomic) NSArray *itemsArray; static CFArrayCallBacks nonretainingArrayCallbacks = {
@@ -39,167 +39,152 @@
@implementation AMPurpleJabberNode
static void AMPurpleJabberNode_received_data_cb(PurpleConnection *gc, xmlnode **packet, gpointer this) {
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- AMPurpleJabberNode *self = (AMPurpleJabberNode*)this;
- // we're receiving *all* packets, so let's filter out those that don't concern us
- const char *from = xmlnode_get_attrib(*packet, "from");
- const char *type = xmlnode_get_attrib(*packet, "type");
- if (!type || (strcmp(type, "result") && strcmp(type, "error"))){
- if (strcmp((*packet)->name, "iq")){
- if (![[NSString stringWithUTF8String:from] isEqualToString:self.jid]){
- xmlnode *query = xmlnode_get_child_with_namespace(*packet,"query","http://jabber.org/protocol/disco#info");
- if (self.features || self.identities) {
- return; // we already have that information
+ AMPurpleJabberNode *self = (__bridge AMPurpleJabberNode*)this; + // we're receiving *all* packets, so let's filter out those that don't concern us + const char *from = xmlnode_get_attrib(*packet, "from"); - const char *queryNode = xmlnode_get_attrib(query,"node");
- if ((self.node && !queryNode) || (!self.node && queryNode)){
+ const char *type = xmlnode_get_attrib(*packet, "type"); + if (!type || (strcmp(type, "result") && strcmp(type, "error"))){ + if (strcmp((*packet)->name, "iq")){ + if (![[NSString stringWithUTF8String:from] isEqualToString:self.jid]){ - if (queryNode && ![[NSString stringWithUTF8String:queryNode] isEqualToString:self.node]){
+ xmlnode *query = xmlnode_get_child_with_namespace(*packet,"query","http://jabber.org/protocol/disco#info"); + if (self.features || self.identities) { + return; // we already have that information + const char *queryNode = xmlnode_get_attrib(query,"node"); + if ((self.node && !queryNode) || (!self.node && queryNode)){ + if (queryNode && ![[NSString stringWithUTF8String:queryNode] isEqualToString:self.node]){ + // it's us, fill in features and identities + NSMutableArray *identities = [NSMutableArray array]; + NSMutableSet *features = [NSMutableSet set]; + for(item = query->child; item; item = item->next) { + if (item->type == XMLNODE_TYPE_TAG) { + if (!strcmp(item->name, "identity")) { + const char *category = xmlnode_get_attrib(item,"category"); + const char *ltype = xmlnode_get_attrib(item, "type"); + const char *queryName = xmlnode_get_attrib(item, "name"); + [identities addObject:[NSDictionary dictionaryWithObjectsAndKeys: + category?[NSString stringWithUTF8String:category]:[NSNull null], @"category", + ltype?[NSString stringWithUTF8String:ltype]:[NSNull null], @"type", + queryName?[NSString stringWithUTF8String:queryName]:[NSNull null], @"name", + } else if (!strcmp(item->name, "feature")) { + const char *var = xmlnode_get_attrib(item, "var"); + [features addObject:[NSString stringWithUTF8String:var]]; + self.identities = identities; + self.features = features; + for (id delegate in self.delegates) { + if ([delegate respondsToSelector:@selector(jabberNodeGotInfo:)]) + [delegate jabberNodeGotInfo:self]; + if ([features containsObject:@"http://jabber.org/protocol/commands"]) { + // in order to avoid endless loops, check if the current node isn't a command by itself (which can't contain other commands) + NSDictionary *identity; + for (identity in identities) { + if ([[identity objectForKey:@"type"] isEqualToString:@"command-node"]) { + // commands have to be prefetched to be available when the user tries to access the context menu + self.commandsNode = [[AMPurpleJabberNode alloc] initWithJID:self.jid + node:@"http://jabber.org/protocol/commands" + [self.commandsNode fetchItems]; - // it's us, fill in features and identities
- NSMutableArray *identities = [NSMutableArray array];
- NSMutableSet *features = [NSMutableSet set];
- for(item = query->child; item; item = item->next) {
- if (item->type == XMLNODE_TYPE_TAG) {
- if (!strcmp(item->name, "identity")) {
- const char *category = xmlnode_get_attrib(item,"category");
- const char *ltype = xmlnode_get_attrib(item, "type");
- const char *queryName = xmlnode_get_attrib(item, "name");
- [identities addObject:[NSDictionary dictionaryWithObjectsAndKeys:
- category?[NSString stringWithUTF8String:category]:[NSNull null], @"category",
- ltype?[NSString stringWithUTF8String:ltype]:[NSNull null], @"type",
- queryName?[NSString stringWithUTF8String:queryName]:[NSNull null], @"name",
- } else if (!strcmp(item->name, "feature")) {
- const char *var = xmlnode_get_attrib(item, "var");
- [features addObject:[NSString stringWithUTF8String:var]];
+ query = xmlnode_get_child_with_namespace(*packet,"query","http://jabber.org/protocol/disco#items"); + return; // we already have that info
- self.identities = identities;
- self.features = features;
- for (id delegate in self.delegates) {
- if ([delegate respondsToSelector:@selector(jabberNodeGotInfo:)])
- [delegate jabberNodeGotInfo:self];
- if ([features containsObject:@"http://jabber.org/protocol/commands"]) {
- // in order to avoid endless loops, check if the current node isn't a command by itself (which can't contain other commands)
- NSDictionary *identity;
- for (identity in identities) {
- if ([[identity objectForKey:@"type"] isEqualToString:@"command-node"]) {
+ const char *checkNode = xmlnode_get_attrib(query,"node"); + if ((self.node && !checkNode) || (!self.node && checkNode)) { + if (checkNode && ![[NSString stringWithUTF8String:checkNode] isEqualToString:self.node]){
- // commands have to be prefetched to be available when the user tries to access the context menu
- self.commandsNode = [[AMPurpleJabberNode alloc] initWithJID:self.jid
- node:@"http://jabber.org/protocol/commands"
- [self.commandsNode fetchItems];
- query = xmlnode_get_child_with_namespace(*packet,"query","http://jabber.org/protocol/disco#items");
- return; // we already have that info
- const char *checkNode = xmlnode_get_attrib(query,"node");
- if ((self.node && !checkNode) || (!self.node && checkNode)) {
- if (checkNode && ![[NSString stringWithUTF8String:checkNode] isEqualToString:self.node]){
- // it's us, create the subnodes
- NSMutableArray *newItems = [NSMutableArray array];
- for(xmlnode *item = query->child; item; item = item->next) {
- if (item->type == XMLNODE_TYPE_TAG) {
- if (!strcmp(item->name, "item")) {
- const char *queryJID = xmlnode_get_attrib(item,"jid");
- const char *queryNode = xmlnode_get_attrib(item,"node");
- const char *queryName = xmlnode_get_attrib(item,"name");
- AMPurpleJabberNode *newnode = [[AMPurpleJabberNode alloc] initWithJID:[NSString stringWithUTF8String:queryJID]
- node:queryNode ? [NSString stringWithUTF8String:queryNode] : nil
- name:queryName ? [NSString stringWithUTF8String:queryName] : nil
- newnode.delegates = [NSMakeCollectable(CFArrayCreateMutableCopy(kCFAllocatorDefault, /*capacity*/ 0, (CFArrayRef)self.delegates)) autorelease];
- [newItems addObject:newnode];
- // check if we're a conference service
- if ([[self jid] rangeOfString:@"@"].location == NSNotFound) { // we can't be one when we have an @
- NSDictionary *identity = nil;
- for (identity in self.identities) {
- if ([[identity objectForKey:@"category"] isEqualToString:@"conference"]) {
- // since we're a conference service, assume that our children are conferences
- newnode.identities = [NSArray arrayWithObject:identity];
+ // it's us, create the subnodes + NSMutableArray *newItems = [NSMutableArray array]; + for(xmlnode *item = query->child; item; item = item->next) { + if (item->type == XMLNODE_TYPE_TAG) { + if (!strcmp(item->name, "item")) { + const char *queryJID = xmlnode_get_attrib(item,"jid"); + const char *queryNode = xmlnode_get_attrib(item,"node"); + const char *queryName = xmlnode_get_attrib(item,"name"); + AMPurpleJabberNode *newnode = [[AMPurpleJabberNode alloc] initWithJID:[NSString stringWithUTF8String:queryJID] + node:queryNode ? [NSString stringWithUTF8String:queryNode] : nil + name:queryName ? [NSString stringWithUTF8String:queryName] : nil + newnode.delegates = CFBridgingRelease(CFArrayCreateMutableCopy(kCFAllocatorDefault, /*capacity*/ 0, (__bridge CFArrayRef)self.delegates)); + [newItems addObject:newnode]; + // check if we're a conference service + if ([[self jid] rangeOfString:@"@"].location == NSNotFound) { // we can't be one when we have an @ + NSDictionary *identity = nil; + for (identity in self.identities) { + if ([[identity objectForKey:@"category"] isEqualToString:@"conference"]) { + // since we're a conference service, assume that our children are conferences + newnode.identities = [NSArray arrayWithObject:identity];
- self.itemsArray = newItems;
- for (id delegate in self.delegates) {
- if ([delegate respondsToSelector:@selector(jabberNodeGotItems:)])
- [delegate jabberNodeGotItems:self];
+ self.itemsArray = newItems; + for (id delegate in self.delegates) { + if ([delegate respondsToSelector:@selector(jabberNodeGotItems:)]) + [delegate jabberNodeGotItems:self];
- (id)initWithJID:(NSString*)_jid node:(NSString*)_node name:(NSString*)_name connection:(PurpleConnection*)_gc {
@@ -207,17 +192,16 @@
PurplePlugin *jabber = purple_find_prpl("prpl-jabber");
AILog(@"Unable to locate jabber prpl");
- self.delegates = [NSMakeCollectable(CFArrayCreateMutable(kCFAllocatorDefault, /*capacity*/ 0, &nonretainingArrayCallbacks)) autorelease];
+ self.delegates = CFBridgingRelease(CFArrayCreateMutable(kCFAllocatorDefault, /*capacity*/ 0, &nonretainingArrayCallbacks)); - purple_signal_connect(jabber, "jabber-receiving-xmlnode", self,
- PURPLE_CALLBACK(AMPurpleJabberNode_received_data_cb), self);
+ purple_signal_connect(jabber, "jabber-receiving-xmlnode", (__bridge void *)(self), + PURPLE_CALLBACK(AMPurpleJabberNode_received_data_cb), (__bridge void *)(self)); @@ -226,7 +210,6 @@
PurplePlugin *jabber = purple_find_prpl("prpl-jabber");
AILog(@"Unable to locate jabber prpl");
AMPurpleJabberNode *copy = [[AMPurpleJabberNode alloc] init];
@@ -238,28 +221,19 @@
- copy.delegates = [NSMakeCollectable(CFArrayCreateMutable(kCFAllocatorDefault, /*capacity*/ 0, &nonretainingArrayCallbacks)) autorelease];
+ copy.delegates = CFBridgingRelease(CFArrayCreateMutable(kCFAllocatorDefault, /*capacity*/ 0, &nonretainingArrayCallbacks)); copy.features = self.features;
copy.identities = self.identities;
copy.itemsArray = self.itemsArray;
- purple_signal_connect(jabber, "jabber-receiving-xmlnode", copy,
- PURPLE_CALLBACK(AMPurpleJabberNode_received_data_cb), copy);
+ purple_signal_connect(jabber, "jabber-receiving-xmlnode", (__bridge void *)copy, + PURPLE_CALLBACK(AMPurpleJabberNode_received_data_cb), (__bridge void *)copy); - purple_signals_disconnect_by_handle(self);
+ purple_signals_disconnect_by_handle((__bridge void *)(self)); --- a/Plugins/Purple Service/AMPurpleJabberServiceDiscoveryBrowserController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/AMPurpleJabberServiceDiscoveryBrowserController.m Sun Sep 09 12:24:39 2012 -0400
@@ -38,7 +38,7 @@
//Load the window immediately
@@ -47,7 +47,6 @@
[[self window] makeKeyAndOrderFront:nil];
[outlineview setTarget:self];
[outlineview setDoubleAction:@selector(openService:)];
@@ -58,8 +57,6 @@
[[NSNotificationCenter defaultCenter] removeObserver:self];
- (NSString *)adiumFrameAutosaveName
@@ -148,7 +145,7 @@
NSArray *commands = [(AMPurpleJabberNode*)item commands];
- menu = [[[NSMenu alloc] initWithTitle:@""] autorelease];
+ menu = [[NSMenu alloc] initWithTitle:@""]; AMPurpleJabberNode *command;
for (command in commands) {
@@ -158,7 +155,6 @@
[mitem setRepresentedObject:command];
@@ -167,7 +163,6 @@
- (IBAction)changeServiceName:(id)sender {
node = [[AMPurpleJabberNode alloc] initWithJID:[servicename stringValue] node:([[nodename stringValue] length]>0)?[nodename stringValue]:nil name:nil connection:gc];
@@ -176,7 +171,6 @@
- (void)windowWillClose:(NSNotification *)notification
[super windowWillClose:notification];
@@ -243,32 +237,32 @@
NSString *identifier = [tableColumn identifier];
if ([identifier isEqualToString:@"jid"])
- return [[[NSAttributedString alloc] initWithString:[item jid] attributes:style] autorelease];
+ return [[NSAttributedString alloc] initWithString:[item jid] attributes:style]; else if ([identifier isEqualToString:@"name"]) {
- return [[[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@ (%@)",[item name],[item node]] attributes:style] autorelease];
- return [[[NSAttributedString alloc] initWithString:[item node] attributes:style] autorelease];
+ return [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@ (%@)",[item name],[item node]] attributes:style]; + return [[NSAttributedString alloc] initWithString:[item node] attributes:style]; - return [[[NSAttributedString alloc] initWithString:[item name] attributes:style] autorelease];
+ return [[NSAttributedString alloc] initWithString:[item name] attributes:style]; // try to guess a name when there's none supplied
NSRange slashsign = [[item jid] rangeOfString:@"/"];
if (slashsign.location != NSNotFound)
- return [[[NSAttributedString alloc] initWithString:[[item jid] substringFromIndex:slashsign.location+1] attributes:style] autorelease];
+ return [[NSAttributedString alloc] initWithString:[[item jid] substringFromIndex:slashsign.location+1] attributes:style]; NSRange atsign = [[item jid] rangeOfString:@"@"];
if (atsign.location != NSNotFound)
- return [[[NSAttributedString alloc] initWithString:[[item jid] substringToIndex:atsign.location] attributes:style] autorelease];
+ return [[NSAttributedString alloc] initWithString:[[item jid] substringToIndex:atsign.location] attributes:style]; if ([[item identities] count] > 0) {
NSDictionary *identity = [[item identities] objectAtIndex:0];
id name = [identity objectForKey:@"name"];
if (name != [NSNull null] && [name length] > 0)
- return [[[NSAttributedString alloc] initWithString:[identity objectForKey:@"name"] attributes:style] autorelease];
+ return [[NSAttributedString alloc] initWithString:[identity objectForKey:@"name"] attributes:style]; - return [[[NSAttributedString alloc] initWithString:AILocalizedString(@"(unknown)",nil) attributes:style] autorelease];
+ return [[NSAttributedString alloc] initWithString:AILocalizedString(@"(unknown)",nil) attributes:style]; } else if ([identifier isEqualToString:@"category"]) {
- [[[NSAttributedString alloc] initWithString:AILocalizedString(@"Fetching...",nil) attributes:style] autorelease];
+ return [[NSAttributedString alloc] initWithString:AILocalizedString(@"Fetching...",nil) attributes:style]; NSMutableArray *identities = [[NSMutableArray alloc] init];
@@ -277,8 +271,7 @@
NSString *result = [identities componentsJoinedByString:@", "];
- return [[[NSAttributedString alloc] initWithString:result attributes:style] autorelease];
+ return [[NSAttributedString alloc] initWithString:result attributes:style]; @@ -330,8 +323,7 @@
[[NSAffineTransform transform] set];
- NSInvocation *inv = [[NSInvocation invocationWithMethodSignature:[outlineView methodSignatureForSelector:@selector(setNeedsDisplayInRect:)]] retain];
+ NSInvocation *inv = [NSInvocation invocationWithMethodSignature:[outlineView methodSignatureForSelector:@selector(setNeedsDisplayInRect:)]]; [inv setSelector:@selector(setNeedsDisplayInRect:)];
NSRect rect = [outlineView rectOfRow:[outlineView rowForItem:item]];
[inv setArgument:&rect atIndex:2];
@@ -350,7 +342,6 @@
[triangleCell drawWithFrame:NSMakeRect(0.0f,0.0f,13.0f,13.0f) inView:outlineView];
[det_triangle_opened unlockFocus];
- [triangleCell release];
[cell setImage:det_triangle_opened];
@@ -366,7 +357,6 @@
[triangleCell drawWithFrame:NSMakeRect(0.0f,0.0f,13.0f,13.0f) inView:outlineView];
[det_triangle_closed unlockFocus];
- [triangleCell release];
[cell setImage:det_triangle_closed];
--- a/Plugins/Purple Service/AMPurpleJabberServiceDiscoveryBrowsing.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/AMPurpleJabberServiceDiscoveryBrowsing.m Sun Sep 09 12:24:39 2012 -0400
@@ -38,9 +38,6 @@
[browsers makeObjectsPerformSelector:@selector(close)];
- (IBAction)browse:(id)sender
@@ -59,7 +56,6 @@
[browsers addObject:browser];
--- a/Plugins/Purple Service/AMPurpleRequestFieldsController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/AMPurpleRequestFieldsController.m Sun Sep 09 12:24:39 2012 -0400
@@ -364,7 +364,6 @@
data = [bitmapRep representationUsingType:NSPNGFileType properties:nil];
NSString *filename = [[[NSString stringWithFormat:@"TEMP-Image_%@",[self key]] stringByAppendingPathExtension:extension] safeFilenameString];
@@ -607,7 +606,6 @@
//Insert the field into the XHTML document
[fieldset addChild:[fieldobject xhtml]];
@@ -653,13 +651,7 @@
- return [self retain]; // keep us as long as the form is open
- [fieldobjects release];
- (void)loadForm:(NSXMLDocument*)doc {
@@ -695,8 +687,6 @@
((PurpleRequestFieldsCb)cancelcb)(userData, fields);
- [self autorelease]; // no we don't need us no longer, commit suicide
- (void)webView:(WebView *)webView decidePolicyForNavigationAction:(NSDictionary *)actionInformation
@@ -711,7 +701,6 @@
if ([[[request URL] absoluteString] isEqualToString:@"http://www.adium.im/XMPP/form"]) {
NSString *info = [[NSString alloc] initWithData:[request HTTPBody] encoding:NSUTF8StringEncoding];
NSArray *formfields = [info componentsSeparatedByString:@"&"];
for (field in formfields) {
@@ -719,30 +708,28 @@
if ([keyvalue count] != 2)
- NSString *key = [[[keyvalue objectAtIndex:0] mutableCopy] autorelease];
+ NSString *key = [[keyvalue objectAtIndex:0] mutableCopy]; [(NSMutableString *)key replaceOccurrencesOfString:@"+"
range:NSMakeRange(0,[key length])];
- key = (NSString *)CFURLCreateStringByReplacingPercentEscapesUsingEncoding(kCFAllocatorDefault,
+ key = (__bridge_transfer NSString *)CFURLCreateStringByReplacingPercentEscapesUsingEncoding(kCFAllocatorDefault, + (__bridge CFStringRef)key, (CFStringRef)@"", kCFStringEncodingUTF8);
- NSString *value = [[[keyvalue objectAtIndex:1] mutableCopy] autorelease];
+ NSString *value = [[keyvalue objectAtIndex:1] mutableCopy]; [(NSMutableString *)value replaceOccurrencesOfString:@"+"
range:NSMakeRange(0,[value length])];
- value = (NSString *)CFURLCreateStringByReplacingPercentEscapesUsingEncoding(kCFAllocatorDefault,
+ value = (__bridge_transfer NSString *)CFURLCreateStringByReplacingPercentEscapesUsingEncoding(kCFAllocatorDefault, + (__bridge CFStringRef)value, (CFStringRef)@"", kCFStringEncodingUTF8);
[[fieldobjects objectForKey:key] applyValue:value];
--- a/Plugins/Purple Service/AMPurpleSearchResultsController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/AMPurpleSearchResultsController.m Sun Sep 09 12:24:39 2012 -0400
@@ -81,7 +81,6 @@
[searchButtons setObject:[NSValue valueWithPointer:button] forKey:[NSValue valueWithNonretainedObject:newbutton]];
@@ -94,12 +93,11 @@
for(column = results->columns; column; column = g_list_next(column)) {
PurpleNotifySearchColumn *scol = column->data;
- NSTableColumn *tcol = [[NSTableColumn alloc] initWithIdentifier:[NSNumber numberWithUnsignedInteger:idx++]];
+ NSTableColumn *tcol = [[NSTableColumn alloc] initWithIdentifier:[NSString stringWithFormat:@"%ld", idx++]]; [[tcol headerCell] setStringValue:[NSString stringWithUTF8String:scol->title]];
[tableview addTableColumn:tcol];
@@ -116,7 +114,6 @@
[dict setObject:[NSString stringWithUTF8String:text] forKey:[NSNumber numberWithUnsignedInteger:col++]];
@@ -124,13 +121,7 @@
[self tableViewSelectionDidChange:nil];
- return [self retain]; // will be released in -purpleRequestClose when we're done
- [searchButtons release];
- [searchResults release];
- (void)addResults:(PurpleNotifySearchResults*)results {
@@ -145,7 +136,6 @@
[dict setObject:[NSString stringWithUTF8String:text] forKey:[NSNumber numberWithUnsignedInteger:col++]];
@@ -172,7 +162,7 @@
- (BOOL)windowShouldClose:(id)sender {
- purple_notify_close(PURPLE_NOTIFY_SEARCHRESULTS, self);
+ purple_notify_close(PURPLE_NOTIFY_SEARCHRESULTS, (__bridge void *)(self)); --- a/Plugins/Purple Service/AMPurpleTuneTooltip.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/AMPurpleTuneTooltip.m Sun Sep 09 12:24:39 2012 -0400
@@ -81,7 +81,7 @@
[text appendFormat:@" (%@)", [NSString stringWithUTF8String:albumstr]];
- [text appendFormat:@" - [%d:%02d]", timeval / 60, timeval % 60];
+ [text appendFormat:@" - [%ld:%02ld]", timeval / 60, timeval % 60]; return [AIHTMLDecoder decodeHTML:text];
--- a/Plugins/Purple Service/AMXMLConsoleController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/AMXMLConsoleController.m Sun Sep 09 12:24:39 2012 -0400
@@ -28,75 +28,67 @@
xmlnode_received_cb(PurpleConnection *gc, xmlnode **packet, gpointer this)
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- AMXMLConsoleController *self = (AMXMLConsoleController *)this;
- if (!this || [self gc] != gc) {
+ AMXMLConsoleController *self = (__bridge AMXMLConsoleController *)this; + if (!this || [self gc] != gc) { + char *str = xmlnode_to_formatted_str(*packet, NULL); + NSString *sstr = [NSString stringWithUTF8String:str]; + if ([sstr hasPrefix:XML_PREFIX]) + sstr = [sstr substringFromIndex:[XML_PREFIX length]]; + NSAttributedString *astr = [[NSAttributedString alloc] initWithString:sstr + [self appendToLog:astr];
- char *str = xmlnode_to_formatted_str(*packet, NULL);
- NSString *sstr = [NSString stringWithUTF8String:str];
- if ([sstr hasPrefix:XML_PREFIX])
- sstr = [sstr substringFromIndex:[XML_PREFIX length]];
- NSAttributedString *astr = [[NSAttributedString alloc] initWithString:sstr
- [self appendToLog:astr];
xmlnode_sent_cb(PurpleConnection *gc, char **packet, gpointer this)
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- AMXMLConsoleController *self = (AMXMLConsoleController *)this;
- if (!this || [self gc] != gc) {
- node = ((*packet && strlen(*packet) && ((*packet)[0] == '<')) ?
- xmlnode_from_str(*packet, -1) :
+ AMXMLConsoleController *self = (__bridge AMXMLConsoleController *)this; + if (!this || [self gc] != gc) { + node = ((*packet && strlen(*packet) && ((*packet)[0] == '<')) ? + xmlnode_from_str(*packet, -1) : + char *str = xmlnode_to_formatted_str(node, NULL); + NSString *sstr = [NSString stringWithUTF8String:str]; + if ([sstr hasPrefix:XML_PREFIX]) + sstr = [sstr substringFromIndex:[XML_PREFIX length]]; + NSAttributedString *astr = [[NSAttributedString alloc] initWithString:sstr + attributes:[NSDictionary dictionaryWithObject:[NSColor blueColor] forKey:NSForegroundColorAttributeName]]; + [self appendToLog:astr];
- char *str = xmlnode_to_formatted_str(node, NULL);
- NSString *sstr = [NSString stringWithUTF8String:str];
- if ([sstr hasPrefix:XML_PREFIX])
- sstr = [sstr substringFromIndex:[XML_PREFIX length]];
- NSAttributedString *astr = [[NSAttributedString alloc] initWithString:sstr
- attributes:[NSDictionary dictionaryWithObject:[NSColor blueColor] forKey:NSForegroundColorAttributeName]];
- [self appendToLog:astr];
@implementation AMXMLConsoleController
- purple_signals_disconnect_by_handle(self);
+ purple_signals_disconnect_by_handle((__bridge void *)(self)); - (IBAction)sendXML:(id)sender {
@@ -124,10 +116,10 @@
PurplePlugin *jabber = purple_find_prpl("prpl-jabber");
if (!jabber) AILog(@"Unable to locate jabber prpl");
- purple_signal_connect(jabber, "jabber-receiving-xmlnode", self,
- PURPLE_CALLBACK(xmlnode_received_cb), self);
- purple_signal_connect(jabber, "jabber-sending-text", self,
- PURPLE_CALLBACK(xmlnode_sent_cb), self);
+ purple_signal_connect(jabber, "jabber-receiving-xmlnode", (__bridge void *)(self), + PURPLE_CALLBACK(xmlnode_received_cb), (__bridge void *)(self)); + purple_signal_connect(jabber, "jabber-sending-text", (__bridge void *)(self), + PURPLE_CALLBACK(xmlnode_sent_cb), (__bridge void *)(self)); [xmlConsoleWindow makeKeyAndOrderFront:sender];
@@ -139,7 +131,7 @@
//We don't need to watch the signals with the window closed
- purple_signals_disconnect_by_handle(self);
+ purple_signals_disconnect_by_handle((__bridge void *)(self)); --- a/Plugins/Purple Service/CBPurpleAccount.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/CBPurpleAccount.h Sun Sep 09 12:24:39 2012 -0400
@@ -48,9 +48,8 @@
- (const char*)protocolPlugin;
-- (PurpleAccount*)purpleAccount;
+@property (assign, readwrite) PurpleAccount *purpleAccount; - (PurplePluginProtocolInfo *)protocolInfo;
-- (void)setPurpleAccount:(PurpleAccount *)inAccount;
- (const char *)purpleAccountName;
- (void)createNewPurpleAccount;
--- a/Plugins/Purple Service/CBPurpleAccount.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/CBPurpleAccount.m Sun Sep 09 12:24:39 2012 -0400
@@ -51,7 +51,7 @@
#import <AIUtilities/AIMenuAdditions.h>
#import <AIUtilities/AIMutableOwnerArray.h>
#import <AIUtilities/AIStringAdditions.h>
-#import <AIUtilities/AIObjectAdditions.h>
#import <AIUtilities/AIImageAdditions.h>
#import <AIUtilities/AIImageDrawingAdditions.h>
#import <AIUtilities/AIMutableStringAdditions.h>
@@ -97,15 +97,13 @@
@implementation CBPurpleAccount
-static SLPurpleCocoaAdapter *purpleAdapter = nil;
// The PurpleAccount currently associated with this Adium account
- (PurpleAccount*)purpleAccount
//Create a purple account if one does not already exist
[self createNewPurpleAccount];
- AILog(@"Created PurpleAccount 0x%x with UID %@, protocolPlugin %s", account, self.UID, [self protocolPlugin]);
+ AILog(@"Created PurpleAccount %p with UID %@, protocolPlugin %s", account, self.UID, [self protocolPlugin]); @@ -113,10 +111,7 @@
- (SLPurpleCocoaAdapter *)purpleAdapter
- purpleAdapter = [[SLPurpleCocoaAdapter sharedInstance] retain];
+ return [SLPurpleCocoaAdapter sharedInstance]; // Subclasses must override this
@@ -369,7 +364,7 @@
NSMutableString *returnString = nil;
if ([inString rangeOfString:@"Purple could not find any information in the user's profile. The user most likely does not exist."].location != NSNotFound) {
- returnString = [[inString mutableCopy] autorelease];
+ returnString = [inString mutableCopy]; [returnString replaceOccurrencesOfString:@"Purple could not find any information in the user's profile. The user most likely does not exist."
withString:AILocalizedString(@"Adium could not find any information in the user's profile. This may not be a registered name.", "Message shown when a contact's profile can't be found")
@@ -441,7 +436,6 @@
@@ -457,7 +451,7 @@
NSString *value = [dict objectForKey:KEY_VALUE];
[value rangeOfString:webProfileValue options:(NSBackwardsSearch | NSAnchoredSearch | NSLiteralSearch)].location != NSNotFound) {
- NSMutableString *newValue = [[value mutableCopy] autorelease];
+ NSMutableString *newValue = [value mutableCopy]; [newValue replaceOccurrencesOfString:webProfileValue
withString:[self webProfileStringForContact:contact]
options:(NSBackwardsSearch | NSAnchoredSearch | NSLiteralSearch)];
@@ -465,7 +459,6 @@
NSMutableDictionary *replacementDict = [dict mutableCopy];
[replacementDict setObject:newValue forKey:KEY_VALUE];
[array replaceObjectAtIndex:i withObject:replacementDict];
- [replacementDict release];
/* There will only be 1 (at most) web profile link */
@@ -537,7 +530,7 @@
- (void)delayedUpdateContactStatus:(AIListContact *)inContact
- [purpleAdapter getInfoFor:inContact.UID onAccount:self];
+ [self.purpleAdapter getInfoFor:inContact.UID onAccount:self]; - (void)requestAddContactWithUID:(NSString *)contactUID
@@ -618,7 +611,7 @@
for (AIListContact *object in objects) {
//Have the purple thread perform the serverside actions
- [purpleAdapter removeUID:object.UID onAccount:self fromGroup:groupName];
+ [self.purpleAdapter removeUID:object.UID onAccount:self fromGroup:groupName]; //Remove it from Adium's list
[object removeRemoteGroupName:groupName];
@@ -636,7 +629,7 @@
NSString *alias = [contact.parentContact preferenceForKey:@"Alias"
group:PREF_GROUP_ALIASES];
- [purpleAdapter addUID:[self _UIDForAddingObject:contact] onAccount:self toGroup:groupName withAlias:alias];
+ [self.purpleAdapter addUID:[self _UIDForAddingObject:contact] onAccount:self toGroup:groupName withAlias:alias]; [contact addRemoteGroupName:group.UID]; //Use the non-mapped group name locally
@@ -674,7 +667,7 @@
group:PREF_GROUP_ALIASES];
//Tell the purple thread to perform the serverside operation
- [purpleAdapter moveUID:contact.UID onAccount:self fromGroups:sourceMappedNames toGroups:destinationMappedNames withAlias:alias];
+ [self.purpleAdapter moveUID:contact.UID onAccount:self fromGroups:sourceMappedNames toGroups:destinationMappedNames withAlias:alias]; for (AIListGroup *group in oldGroups) {
[contact removeRemoteGroupName:group.UID];
@@ -691,7 +684,7 @@
NSString *groupName = [self _mapOutgoingGroupName:inGroup.UID];
//Tell the purple thread to perform the serverside operation
- [purpleAdapter renameGroup:groupName onAccount:self to:newName];
+ [self.purpleAdapter renameGroup:groupName onAccount:self to:newName]; //We must also update the remote grouping of all our contacts in that group
for (AIListContact *contact in [adium.contactController allContactsInObject:inGroup onAccount:self]) {
@@ -703,9 +696,7 @@
- (void)deleteGroup:(AIListGroup *)inGroup
- NSString *groupName = [self _mapOutgoingGroupName:inGroup.UID];
- [purpleAdapter deleteGroup:groupName onAccount:self];
+ [self.purpleAdapter deleteGroup:[self _mapOutgoingGroupName:inGroup.UID] onAccount:self]; // Return YES if the contact list is editable
@@ -717,7 +708,7 @@
- (id)authorizationRequestWithDict:(NSDictionary*)dict
// We retain this in case libpurple wants to close the request early. It is freed below.
- return [[AdiumAuthorization showAuthorizationRequestWithDict:dict forAccount:self] retain];
+ return [AdiumAuthorization showAuthorizationRequestWithDict:dict forAccount:self]; - (void)authorizationWithDict:(NSDictionary *)infoDict response:(AIAuthorizationResponse)authorizationResponse
@@ -727,10 +718,10 @@
switch (authorizationResponse) {
case AIAuthorizationAllowed:
- callback = [[[infoDict objectForKey:@"authorizeCB"] retain] autorelease];
+ callback = [infoDict objectForKey:@"authorizeCB"]; case AIAuthorizationDenied:
- callback = [[[infoDict objectForKey:@"denyCB"] retain] autorelease];
+ callback = [infoDict objectForKey:@"denyCB"]; case AIAuthorizationNoResponse:
@@ -739,14 +730,9 @@
//libpurple will remove its reference to the handle for this request, which is inDict, in response to this callback invocation
- [purpleAdapter doAuthRequestCbValue:callback withUserDataValue:[[[infoDict objectForKey:@"userData"] retain] autorelease]];
- /* Retained in -[self authorizationRequestWithDict:]. We kept it around before now in case libpurle wanted us to close it early, such as because the
- * account disconnected.
+ [self.purpleAdapter doAuthRequestCbValue:callback withUserDataValue:[infoDict objectForKey:@"userData"]]; - [purpleAdapter closeAuthRequestWithHandle:infoDict];
+ [self.purpleAdapter closeAuthRequestWithHandle:infoDict]; @@ -761,7 +747,7 @@
- (BOOL)contact:(AIListContact *)inContact isIgnoredInChat:(AIChat *)chat
if (self.online && chat.isGroupChat) {
- return [purpleAdapter contact:inContact isIgnoredInChat:chat];
+ return [self.purpleAdapter contact:inContact isIgnoredInChat:chat]; @@ -770,7 +756,7 @@
- (void)setContact:(AIListContact *)inContact ignored:(BOOL)inIgnored inChat:(AIChat *)chat
if (self.online && chat.isGroupChat) {
- [purpleAdapter setContact:inContact ignored:inIgnored inChat:chat];
+ [self.purpleAdapter setContact:inContact ignored:inIgnored inChat:chat]; @@ -998,7 +984,7 @@
AILog(@"purple openChat:%@ for %@",chat,chat.uniqueChatID);
//Inform purple that we have opened this chat
- [purpleAdapter openChat:chat onAccount:self];
+ [self.purpleAdapter openChat:chat onAccount:self]; //Created the chat successfully
@@ -1006,7 +992,7 @@
- (BOOL)closeChat:(AIChat*)chat
- [purpleAdapter closeChat:chat];
+ [self.purpleAdapter closeChat:chat]; //Be sure any remaining typing flag is cleared as the chat closes
@@ -1033,11 +1019,8 @@
- (BOOL)rejoinChat:(AIChat *)chat
PurpleConversation *conv = [[chat identifier] pointerValue];
if (conv && conv->ui_data) {
- [(AIChat *)(conv->ui_data) release];
@@ -1048,9 +1031,7 @@
[chat setValue:[NSNumber numberWithBool:YES] forProperty:@"Rejoining Chat" notify:NotifyNever];
- [purpleAdapter openChat:chat onAccount:self];
+ [self.purpleAdapter openChat:chat onAccount:self]; //We don't get any immediate feedback as to our success; just return YES.
@@ -1272,7 +1253,7 @@
AIChat *chat = inContentTyping.chat;
- [purpleAdapter sendTyping:inContentTyping.typingState inChat:chat];
+ [self.purpleAdapter sendTyping:inContentTyping.typingState inChat:chat]; @@ -1288,11 +1269,11 @@
inContentMessage.displayContent = NO;
- [purpleAdapter sendEncodedMessage:[inContentMessage encodedMessage]
- inChat:inContentMessage.chat
+ [self.purpleAdapter sendEncodedMessage:[inContentMessage encodedMessage] + inChat:inContentMessage.chat @@ -1303,9 +1284,9 @@
- (BOOL)sendNotificationObject:(AIContentNotification *)inContentNotification
- [purpleAdapter sendNotificationOfType:[inContentNotification notificationType]
- inChat:inContentNotification.chat];
+ [self.purpleAdapter sendNotificationOfType:[inContentNotification notificationType] + inChat:inContentNotification.chat]; @@ -1317,9 +1298,9 @@
- (NSString *)encodedAttributedStringForSendingContentMessage:(AIContentMessage *)inContentMessage
- BOOL didCommand = [purpleAdapter attemptPurpleCommandOnMessage:[inContentMessage.message string]
- fromAccount:(AIAccount *)[inContentMessage source]
- inChat:inContentMessage.chat];
+ BOOL didCommand = [self.purpleAdapter attemptPurpleCommandOnMessage:[inContentMessage.message string] + fromAccount:(AIAccount *)[inContentMessage source] + inChat:inContentMessage.chat]; return (didCommand ? nil : [super encodedAttributedStringForSendingContentMessage:inContentMessage]);
@@ -1597,7 +1578,7 @@
if (account->perm_deny != privacyType) {
account->perm_deny = privacyType;
serv_set_permit_deny(purple_account_get_connection(account));
- AILog(@"Set privacy options for %@ (%x %x) to %i",
+ AILog(@"Set privacy options for %@ (%p %p) to %i", self,account,purple_account_get_connection(account),account->perm_deny);
[self setPreference:[NSNumber numberWithInteger:option]
@@ -1605,7 +1586,7 @@
group:GROUP_ACCOUNT_STATUS];
- AILog(@"Couldn't set privacy options for %@ (%x %x)",self,account,purple_account_get_connection(account));
+ AILog(@"Couldn't set privacy options for %@ (%p %p)",self,account,purple_account_get_connection(account)); @@ -1656,7 +1637,7 @@
//Associate the fileTransfer and the xfer with each other
[fileTransfer setAccountData:[NSValue valueWithPointer:xfer]];
- xfer->ui_data = [fileTransfer retain];
+ xfer->ui_data = (__bridge_retained void *)(fileTransfer); purple_xfer_set_local_filename(xfer, [[fileTransfer localFilename] UTF8String]);
@@ -1668,7 +1649,7 @@
- (void)acceptFileTransferRequest:(ESFileTransfer *)fileTransfer
- [purpleAdapter xferRequest:xfer];
+ [self.purpleAdapter xferRequest:xfer]; [fileTransfer setStatus: Waiting_on_Remote_User_FileTransfer];
@@ -1744,7 +1725,6 @@
- (void)destroyFileTransfer:(ESFileTransfer *)fileTransfer
AILog(@"Destroy file transfer %@",fileTransfer);
- [fileTransfer release];
//Accept a send or receive ESFileTransfer object, beginning the transfer.
@@ -1768,7 +1748,7 @@
- [purpleAdapter xferRequestAccepted:xfer withFileName:[fileTransfer localFilename]];
+ [self.purpleAdapter xferRequestAccepted:xfer withFileName:[fileTransfer localFilename]]; [fileTransfer setStatus:Accepted_FileTransfer];
@@ -1780,7 +1760,7 @@
PurpleXfer *xfer = [[fileTransfer accountData] pointerValue];
- [purpleAdapter xferRequestRejected:xfer];
+ [self.purpleAdapter xferRequestRejected:xfer]; @@ -1791,7 +1771,7 @@
PurpleXfer *xfer = [[fileTransfer accountData] pointerValue];
- [purpleAdapter xferCancel:xfer];
+ [self.purpleAdapter xferCancel:xfer]; @@ -1824,7 +1804,7 @@
finishedConnectProcess = NO;
- [purpleAdapter unregisterAccount:self];
+ [self.purpleAdapter unregisterAccount:self]; static void prompt_host_cancel_cb(CBPurpleAccount *self) {
@@ -1855,7 +1835,7 @@
[AILocalizedString(@"Connect", "Button title to connect; this is a verb") UTF8String], G_CALLBACK(prompt_host_ok_cb),
[AILocalizedString(@"Cancel", nil) UTF8String], G_CALLBACK(prompt_host_cancel_cb),
/* account */ NULL, /* who */ NULL, /* conv */ NULL,
+ (__bridge void *)(self)); @@ -2061,6 +2041,7 @@
- (void)accountConnectionProgressStep:(NSNumber *)step percentDone:(NSNumber *)connectionProgressPrecent
+ assert([[NSThread currentThread] isMainThread]); NSString *progressString = [self connectionStringForStep:[step integerValue]];
[self setValue:progressString forProperty:@"connectionProgressString" notify:NO];
@@ -2069,7 +2050,7 @@
[self notifyOfChangedPropertiesSilently:NO];
- AILog(@"************ %@ --step-- %i",self.UID,[step integerValue]);
+ AILog(@"************ %@ --step-- %li",self.UID,[step integerValue]); @@ -2099,7 +2080,7 @@
//-[SLPurpleCocoaAdapter addAdiumAccount:] should have immediately called back on setPurpleAccount. It's bad if it didn't.
- AILog(@"Created PurpleAccount 0x%x with UID %@ and protocolPlugin %s", account, self.UID, [self protocolPlugin]);
+ AILog(@"Created PurpleAccount %p with UID %@ and protocolPlugin %s", account, self.UID, [self protocolPlugin]); AILog(@"Unable to create Libpurple account with name %s and protocol plugin %s",
self.purpleAccountName, [self protocolPlugin]);
@@ -2130,7 +2111,7 @@
[[AIContactObserverManager sharedManager] delayListObjectNotificationsUntilInactivity];
//Tell libpurple to disconnect
- [purpleAdapter disconnectAccount:self];
+ [self.purpleAdapter disconnectAccount:self]; @@ -2185,7 +2166,6 @@
[[NSNotificationCenter defaultCenter] removeObserver:self
name:Adium_iTunesTrackChangedNotification
if (deletePurpleAccountAfterDisconnecting) {
@@ -2208,7 +2188,7 @@
-- (AIReconnectDelayType)shouldAttemptReconnectAfterDisconnectionError:(NSString **)disconnectionError
+- (AIReconnectDelayType)shouldAttemptReconnectAfterDisconnectionError:(NSString * __strong *)disconnectionError AIReconnectDelayType reconnectDelayType;
@@ -2242,7 +2222,7 @@
if (inPassword && ![password isEqualToString:inPassword]) {
- [password release]; password = [inPassword retain];
//Ensure we have a purple account if one does not already exist
@@ -2262,7 +2242,7 @@
AILog(@"Adium: Register: %@ initiating connection.",self.UID);
- [purpleAdapter registerAccount:self];
+ [self.purpleAdapter registerAccount:self]; - (void)continueRegisterWithConfiguredPurpleAccount
@@ -2332,7 +2312,7 @@
} else if ([key isEqualToString:KEY_ACCOUNT_CHECK_MAIL]) {
//Update the mail checking setting if the account is already made (if it isn't, we'll set it when it is made)
- [purpleAdapter setCheckMail:[self shouldCheckMail]
+ [self.purpleAdapter setCheckMail:[self shouldCheckMail] @@ -2416,15 +2396,14 @@
- (void)iTunesDidUpdate:(NSNotification*)notification {
- tuneinfo = [[notification object] retain];
+ tuneinfo = [notification object]; /* Only if we're including the information in all statuses do we need to do an update;
* if we just have a 'now playing' status, the dynamic stats update will call
* -[self setStatusState:usingStatusMessage:] in a moment.
/* XXX Need to rate limit this on MSN, at least */
- [purpleAdapter setSongInformation:(shouldIncludeNowPlayingInformationInAllStatuses ? [self purpleSongInfoDictionary] : nil) onAccount:self];
+ [self.purpleAdapter setSongInformation:(shouldIncludeNowPlayingInformationInAllStatuses ? [self purpleSongInfoDictionary] : nil) onAccount:self]; @@ -2471,7 +2450,7 @@
if ([self shouldAddMusicalNoteToNowPlayingStatus]) {
#define MUSICAL_NOTE_AND_SPACE [NSString stringWithUTF8String:"\xe2\x99\xab "]
NSMutableAttributedString *temporaryStatusMessage;
- temporaryStatusMessage = [[[NSMutableAttributedString alloc] initWithString:MUSICAL_NOTE_AND_SPACE] autorelease];
+ temporaryStatusMessage = [[NSMutableAttributedString alloc] initWithString:MUSICAL_NOTE_AND_SPACE]; [temporaryStatusMessage appendAttributedString:inStatusMessage];
inStatusMessage = temporaryStatusMessage;
@@ -2505,8 +2484,6 @@
isActive:[NSNumber numberWithBool:YES] /* We're only using exclusive states for now... I hope. */
@@ -2523,7 +2500,7 @@
- (void)setStatusState:(AIStatus *)statusState statusID:(const char *)statusID isActive:(NSNumber *)isActive arguments:(NSMutableDictionary *)arguments
- [purpleAdapter setStatusID:statusID
+ [self.purpleAdapter setStatusID:statusID @@ -2532,7 +2509,7 @@
//Set our idle (Pass nil for no idle)
- (void)setAccountIdleSinceTo:(NSDate *)idleSince
- [purpleAdapter setIdleSinceTo:idleSince onAccount:self];
+ [self.purpleAdapter setIdleSinceTo:idleSince onAccount:self]; //We now should update our idle property
[self setValue:([idleSince timeIntervalSinceNow] ? idleSince : nil)
@@ -2560,7 +2537,7 @@
profileHTML = [self encodedAttributedString:profile forListObject:nil];
- [purpleAdapter setInfo:profileHTML onAccount:self];
+ [self.purpleAdapter setInfo:profileHTML onAccount:self]; [self setValue:profile forProperty:@"textProfile" notify:NotifyNow];
@@ -2630,7 +2607,7 @@
* to nil and we'll continue below to convert the image. */
buddyIconData = imageData;
- AILog(@"%@: Trying to use original GIF data, %i bytes", self, [buddyIconData length]);
+ AILog(@"%@: Trying to use original GIF data, %li bytes", self, [buddyIconData length]); AILog(@"%@: Failed to use original GIF", self);
@@ -2652,9 +2629,9 @@
if ([buddyIconData length] > maxFileSize) {
buddyIconData = [image JPEGRepresentationWithMaximumByteSize:maxFileSize];
- AILog(@"%@: GIF too large, use a still JPEG of %i bytes", self, [buddyIconData length]);
+ AILog(@"%@: GIF too large, use a still JPEG of %li bytes", self, [buddyIconData length]); - AILog(@"%@: Resized GIF, new file size %i!", self, [buddyIconData length]);
+ AILog(@"%@: Resized GIF, new file size %li!", self, [buddyIconData length]); @@ -2699,7 +2676,7 @@
size_t maxFileSize = prpl_info->icon_spec.max_filesize;
if (maxFileSize > 0 && ([buddyIconData length] > maxFileSize)) {
- AILog(@"%@: Image %i is larger than %i!", self, [buddyIconData length], maxFileSize);
+ AILog(@"%@: Image %li is larger than %zi!", self, [buddyIconData length], maxFileSize); for (i = 0; prpl_formats[i]; i++) {
if ((strcmp(prpl_formats[i],"jpeg") == 0) || (strcmp(prpl_formats[i],"jpg") == 0)) {
@@ -2714,8 +2691,8 @@
- AILogWithSignature(@"%@: Setting icon data of length %i", self, [buddyIconData length]);
- [purpleAdapter setBuddyIcon:buddyIconData onAccount:self];
+ AILogWithSignature(@"%@: Setting icon data of length %li", self, [buddyIconData length]); + [self.purpleAdapter setBuddyIcon:buddyIconData onAccount:self]; [super setAccountUserImage:image withData:originalData];
@@ -2724,7 +2701,7 @@
- (BOOL)inviteContact:(AIListContact *)inContact toChat:(AIChat *)inChat withMessage:(NSString *)inviteMessage
- [purpleAdapter inviteContact:inContact toChat:inChat withMessage:inviteMessage];
+ [self.purpleAdapter inviteContact:inContact toChat:inChat withMessage:inviteMessage]; @@ -2735,7 +2712,7 @@
NSDictionary *dict = [sender representedObject];
- [purpleAdapter performContactMenuActionFromDict:dict forAccount:self];
+ [self.purpleAdapter performContactMenuActionFromDict:dict forAccount:self]; @@ -2755,7 +2732,7 @@
(title = [self titleForContactMenuLabel:act->label
forContact:inContact])) {
- menuItem = [[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:title
+ menuItem = [[NSMenuItem alloc] initWithTitle:title action:@selector(performContactMenuAction:)
@@ -2799,12 +2776,10 @@
[menuItem setSubmenu:submenu];
[menuItemArray addObject:menuItem];
purple_menu_action_free(act);
@@ -2899,10 +2874,10 @@
action->context = purple_account_get_connection(account);
- menuItem = [[[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:title
+ menuItem = [[NSMenuItem alloc] initWithTitle:title action:@selector(performAccountMenuAction:)
- keyEquivalent:@""] autorelease];
dict = [NSDictionary dictionaryWithObjectsAndKeys:
[NSValue valueWithPointer:action->callback], @"PurplePluginActionCallback",
[NSValue valueWithPointer:action->user_data], @"PurplePluginActionCallbackUserData",
@@ -2936,10 +2911,10 @@
[menuItemArray addObject:[NSMenuItem separatorItem]];
- NSMenuItem *showCertificateMenuItem = [[[NSMenuItem alloc] initWithTitle:AILocalizedString(@"Show Server Certificate",nil)
+ NSMenuItem *showCertificateMenuItem = [[NSMenuItem alloc] initWithTitle:AILocalizedString(@"Show Server Certificate",nil) action:@selector(showServerCertificate)
- keyEquivalent:@""] autorelease];
[menuItemArray addObject:showCertificateMenuItem];
@@ -2967,7 +2942,7 @@
NSDictionary *dict = [sender representedObject];
- [purpleAdapter performAccountMenuActionFromDict:dict forAccount:self];
+ [self.purpleAdapter performAccountMenuActionFromDict:dict forAccount:self]; //Subclasses may override to provide a localized label and/or prevent a specified label from being shown
@@ -3084,9 +3059,6 @@
- //Release dialog as required by AIAccount's documentation since we didn't call super's implementation.
- (void)unregisteredAccount:(BOOL)success {
@@ -3136,11 +3108,6 @@
[adium.preferenceController unregisterPreferenceObserver:self];
- [permittedContactsArray release];
- [deniedContactsArray release];
- (NSString *)unknownGroupName {
@@ -3172,13 +3139,13 @@
if ([object isKindOfClass:[AIMetaContact class]]) {
for(AIListContact *containedListContact in (AIMetaContact *)object) {
if (containedListContact.account == self) {
- [purpleAdapter setAlias:alias forUID:containedListContact.UID onAccount:self];
+ [self.purpleAdapter setAlias:alias forUID:containedListContact.UID onAccount:self]; } else if ([object isKindOfClass:[AIListContact class]]) {
if ([(AIListContact *)object account] == self) {
- [purpleAdapter setAlias:alias forUID:object.UID onAccount:self];
+ [self.purpleAdapter setAlias:alias forUID:object.UID onAccount:self]; @@ -3192,7 +3159,7 @@
if (oldNowPlaying && !shouldIncludeNowPlayingInformationInAllStatuses) {
/* Clear any existing song info immediately if we're no longer supposed to broadcast it */
- [purpleAdapter setSongInformation:nil onAccount:self];
+ [self.purpleAdapter setSongInformation:nil onAccount:self]; @@ -3243,8 +3210,6 @@
// Don't log the psychic message.
newStatusMessage.postProcessContent = NO;
[adium.contentController receiveContentObject:newStatusMessage];
--- a/Plugins/Purple Service/CBPurpleOscarAccount.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/CBPurpleOscarAccount.m Sun Sep 09 12:24:39 2012 -0400
@@ -32,7 +32,7 @@
#import <AIUtilities/AIDateFormatterAdditions.h>
#import <AIUtilities/NSCalendarDate+ISO8601Parsing.h>
#import <AIUtilities/AIImageAdditions.h>
-#import <AIUtilities/AIObjectAdditions.h>
#import <AIUtilities/AIStringAdditions.h>
#import <libkern/OSAtomic.h>
@@ -180,7 +180,7 @@
#pragma mark Account Connection
-- (AIReconnectDelayType)shouldAttemptReconnectAfterDisconnectionError:(NSString **)disconnectionError
+- (AIReconnectDelayType)shouldAttemptReconnectAfterDisconnectionError:(NSString * __strong *)disconnectionError AIReconnectDelayType shouldAttemptReconnect = [super shouldAttemptReconnectAfterDisconnectionError:disconnectionError];
@@ -328,8 +328,8 @@
[arrayOfContactsForDelayedUpdates removeObjectAtIndex:0];
- [arrayOfContactsForDelayedUpdates release]; arrayOfContactsForDelayedUpdates = nil;
- [delayedSignonUpdateTimer invalidate]; [delayedSignonUpdateTimer release]; delayedSignonUpdateTimer = nil;
+ arrayOfContactsForDelayedUpdates = nil; + [delayedSignonUpdateTimer invalidate]; delayedSignonUpdateTimer = nil; @@ -340,11 +340,11 @@
[arrayOfContactsForDelayedUpdates addObject:theContact];
if (!delayedSignonUpdateTimer) {
- delayedSignonUpdateTimer = [[NSTimer scheduledTimerWithTimeInterval:DELAYED_UPDATE_INTERVAL
+ delayedSignonUpdateTimer = [NSTimer scheduledTimerWithTimeInterval:DELAYED_UPDATE_INTERVAL selector:@selector(_performDelayedUpdates:)
@@ -442,8 +442,7 @@
allowJavascriptURLs:YES];
- if(!OSAtomicCompareAndSwapPtrBarrier(nil, newEncoder, (void *)&encoderCloseFontTagsAttachmentsAsText))
+ OSAtomicCompareAndSwapPtrBarrier(nil, (__bridge void*)newEncoder, (void *)&encoderCloseFontTagsAttachmentsAsText); [encoderCloseFontTagsAttachmentsAsText setAllowAIMsubprofileLinks:YES];
@@ -472,8 +471,7 @@
allowJavascriptURLs:YES];
- if(!OSAtomicCompareAndSwapPtrBarrier(nil, newEncoder, (void *)&encoderCloseFontTags))
+ OSAtomicCompareAndSwapPtrBarrier(nil, (__bridge void*)newEncoder, (void *)&encoderCloseFontTags); newEncoder = [[AIHTMLDecoder alloc] initWithHeaders:NO
@@ -487,8 +485,7 @@
allowJavascriptURLs:YES];
- if(!OSAtomicCompareAndSwapPtrBarrier(nil, newEncoder, (void *)&encoderGroupChat))
+ OSAtomicCompareAndSwapPtrBarrier(nil, (__bridge void*)newEncoder, (void *)&encoderGroupChat); [encoderCloseFontTags setAllowAIMsubprofileLinks:YES];
[encoderGroupChat setAllowAIMsubprofileLinks:YES];
@@ -589,7 +586,7 @@
purple_imgstore_unref_by_id([imgstoreNumber intValue]);
- [purpleImagesToUnref release]; purpleImagesToUnref = nil;
+ purpleImagesToUnref = nil; @@ -623,7 +620,7 @@
[directIMQueue removeObjectForKey:theContact.internalObjectID];
if (![directIMQueue count]) {
- [directIMQueue release]; directIMQueue = nil;
@@ -643,7 +640,7 @@
static NSCharacterSet *elementEndCharacters = nil;
if (!elementEndCharacters)
- elementEndCharacters = [[NSCharacterSet characterSetWithCharactersInString:@" >"] retain];
+ elementEndCharacters = [NSCharacterSet characterSetWithCharactersInString:@" >"]; static NSString *tagStart = @"<", *tagEnd = @">";
NSMutableString *processedString;
@@ -709,17 +706,15 @@
if (requiresConversionToJPEG) {
NSImage *image = [[NSImage alloc] initWithData:imageData];
- imageData = [[[image JPEGRepresentationWithCompressionFactor:1.0f] retain] autorelease];
+ imageData = [image JPEGRepresentationWithCompressionFactor:1.0f];
} else if (![extension length]) {
//We don't know what we're working with. Try to produce a PNG so we know the format.
NSImage *image = [[NSImage alloc] initWithData:imageData];
- imageData = [[[image PNGRepresentation] retain] autorelease];
+ imageData = [image PNGRepresentation];
//Delete any existing wrong extension
@@ -736,9 +731,9 @@
/* purple_imgstore_add_with_id() will take ownership of imgBytes and free it when done*/
NSInteger imgstore = purple_imgstore_add_with_id(imgBytes, imgBytesLength, [filename UTF8String]);
- AILog(@"Adding image id %i with name %s", imgstore, (filename ? [filename UTF8String] : "(null)"));
+ AILog(@"Adding image id %li with name %s", imgstore, (filename ? [filename UTF8String] : "(null)")); - NSString *newTag = [NSString stringWithFormat:@"<IMG ID=\"%i\" CLASS=\"scaledToFitImage\">",imgstore];
+ NSString *newTag = [NSString stringWithFormat:@"<IMG ID=\"%li\" CLASS=\"scaledToFitImage\">",imgstore]; [processedString appendString:newTag];
if (!purpleImagesToUnref) purpleImagesToUnref = [[NSMutableSet alloc] init];
@@ -753,7 +748,7 @@
- return ([processedString autorelease]);
+ return (processedString); @@ -833,10 +828,10 @@
[NSDateFormatter withLocalizedDateFormatterPerform:^(NSDateFormatter *dayFormatter){
- valueDay = [[dayFormatter stringForObjectValue:date] retain];
+ valueDay = [dayFormatter stringForObjectValue:date]; [NSDateFormatter withLocalizedDateFormatterShowingSeconds:NO showingAMorPM:YES perform:^(NSDateFormatter *timeFormatter) {
- valueTime = [[timeFormatter stringForObjectValue:date] retain];
+ valueTime = [timeFormatter stringForObjectValue:date]; if (valueDay && valueTime) {
@@ -852,9 +847,6 @@
replacementString = (includeTimeWithDay ? [NSString stringWithFormat:@"%@, %@", valueDay, valueTime] : valueDay);
return replacementString;
@@ -878,7 +870,6 @@
NSMutableDictionary *replacementDict = [dict mutableCopy];
[replacementDict setObject:replacementString forKey:KEY_VALUE];
[array replaceObjectAtIndex:i withObject:replacementDict];
- [replacementDict release];
} else if ([key isEqualToString:memberSinceKey]) {
[array removeObjectAtIndex:i];
--- a/Plugins/Purple Service/CBPurpleServicePlugin.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/CBPurpleServicePlugin.m Sun Sep 09 12:24:39 2012 -0400
@@ -80,14 +80,11 @@
[adium.interfaceController unregisterContactListTooltipEntry:tunetooltip secondaryEntry:YES];
[ircPasswordPlugin uninstallPlugin];
- [ircPasswordPlugin release];
[messageHiderPlugin uninstallPlugin];
- [messageHiderPlugin release];
--- a/Plugins/Purple Service/ESIRCAccount.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/ESIRCAccount.h Sun Sep 09 12:24:39 2012 -0400
@@ -33,8 +33,8 @@
-@property (readonly, nonatomic) NSString *defaultUsername;
-@property (readonly, nonatomic) NSString *defaultRealname;
+@property (weak, readonly, nonatomic) NSString *defaultUsername; +@property (weak, readonly, nonatomic) NSString *defaultRealname; - (void)identifyForName:(NSString *)name password:(NSString *)inPassword;
- (AIGroupChatFlags)flagsInChat:(AIChat *)chat;
--- a/Plugins/Purple Service/ESIRCAccount.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/ESIRCAccount.m Sun Sep 09 12:24:39 2012 -0400
@@ -113,7 +113,7 @@
PurpleConversation *conv = fakeConversation(self.purpleAccount);
- for (NSString *command in [[self preferenceForKey:KEY_IRC_COMMANDS
+ for (__strong NSString *command in [[self preferenceForKey:KEY_IRC_COMMANDS group:GROUP_ACCOUNT_STATUS] componentsSeparatedByCharactersInSet:[NSCharacterSet newlineCharacterSet]]) {
if ([command hasPrefix:@"/"]) {
command = [command substringFromIndex:1];
--- a/Plugins/Purple Service/ESIRCService.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/ESIRCService.m Sun Sep 09 12:24:39 2012 -0400
@@ -67,9 +67,8 @@
[allowedCharacters addCharactersInString:@"[]\\`_^{|}-"];
returnSet = [allowedCharacters immutableCopy];
- [allowedCharacters release];
- return [returnSet autorelease];
--- a/Plugins/Purple Service/ESJabberService.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/ESJabberService.m Sun Sep 09 12:24:39 2012 -0400
@@ -47,12 +47,6 @@
[adium.interfaceController unregisterContactListTooltipEntry:moodTooltip secondaryEntry:YES];
- [moodTooltip release]; moodTooltip = nil;
- [charactersInNode release]; charactersInNode = nil;
- [charactersInDomain release]; charactersInDomain = nil;
- [charactersInResource release]; charactersInResource = nil;
@@ -176,7 +170,6 @@
charactersInNode = [allowedCharactersInNode immutableCopy];
- [allowedCharactersInNode release];
@@ -213,7 +206,6 @@
[allowedCharactersInDomain addCharactersInString:@"-."];
charactersInDomain = [allowedCharactersInDomain immutableCopy];
- [allowedCharactersInDomain release];
return charactersInDomain;
@@ -253,7 +245,6 @@
[allowedCharactersInResource addCharactersInRange:x10000_10FFFF];
charactersInResource = [allowedCharactersInResource immutableCopy];
- [allowedCharactersInResource release];
return charactersInResource;
@@ -278,9 +269,8 @@
[allowedCharacters addCharactersInString:@"@"];
[allowedCharacters formUnionWithCharacterSet:domainSet];
returnSet = [allowedCharacters immutableCopy];
- [allowedCharacters release];
- return [returnSet autorelease];
@@ -297,9 +287,8 @@
[allowedCharacters addCharactersInString:@"/"];
[allowedCharacters formUnionWithCharacterSet:resourceSet];
returnSet = [allowedCharacters immutableCopy];
- [allowedCharacters release];
- return [returnSet autorelease];
- (NSUInteger)allowedLength{
--- a/Plugins/Purple Service/ESMeanwhileService.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/ESMeanwhileService.m Sun Sep 09 12:24:39 2012 -0400
@@ -69,9 +69,8 @@
[allowedCharacters addCharactersInString:@" "];
returnSet = [allowedCharacters immutableCopy];
- [allowedCharacters release];
- return [returnSet autorelease];
- (NSUInteger)allowedLength{
--- a/Plugins/Purple Service/ESPurpleAIMAccount.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/ESPurpleAIMAccount.m Sun Sep 09 12:24:39 2012 -0400
@@ -24,7 +24,7 @@
#import <Adium/AIContentMessage.h>
#import <AIUtilities/AIAttributedStringAdditions.h>
#import <AIUtilities/AIStringAdditions.h>
-#import <AIUtilities/AIObjectAdditions.h>
#define MAX_AVAILABLE_MESSAGE_LENGTH 249
@@ -67,8 +67,6 @@
[adium.preferenceController unregisterPreferenceObserver:self];
#pragma mark Connectivity
@@ -95,10 +93,11 @@
//Remove trailing and leading whitespace
formattedUID = [formattedUID stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
- [[self purpleAdapter] performSelector:@selector(OSCARSetFormatTo:onAccount:)
- withObject:formattedUID
+ double delayInSeconds = 5.0; + dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC); + dispatch_after(popTime, dispatch_get_main_queue(), ^(void){ + [[self purpleAdapter] OSCARSetFormatTo:formattedUID onAccount:self]; --- a/Plugins/Purple Service/ESPurpleFileReceiveRequestController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/ESPurpleFileReceiveRequestController.m Sun Sep 09 12:24:39 2012 -0400
@@ -53,8 +53,6 @@
[[NSNotificationCenter defaultCenter] removeObserver:self];
@@ -64,7 +62,6 @@
- (void)purpleRequestClose
--- a/Plugins/Purple Service/ESPurpleJabberAccount.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/ESPurpleJabberAccount.m Sun Sep 09 12:24:39 2012 -0400
@@ -105,11 +105,6 @@
[xmlConsoleController close];
- [xmlConsoleController release];
- (NSSet *)supportedPropertyKeys
@@ -216,7 +211,7 @@
NSString *resource = [self preferenceForKey:KEY_JABBER_RESOURCE group:GROUP_ACCOUNT_STATUS];
if(resource == nil || [resource length] == 0)
- resource = [(NSString*)SCDynamicStoreCopyLocalHostName(NULL) autorelease];
+ resource = (__bridge_transfer NSString*)SCDynamicStoreCopyLocalHostName(NULL); @@ -337,10 +332,10 @@
- [[self purpleAdapter] doAuthRequestCbValue:[[[dict objectForKey:@"authorizeCB"] retain] autorelease] withUserDataValue:[[[dict objectForKey:@"userData"] retain] autorelease]];
+ [[self purpleAdapter] doAuthRequestCbValue:[dict objectForKey:@"authorizeCB"] withUserDataValue:[dict objectForKey:@"userData"]]; - [[self purpleAdapter] doAuthRequestCbValue:[[[dict objectForKey:@"denyCB"] retain] autorelease] withUserDataValue:[[[dict objectForKey:@"userData"] retain] autorelease]];
+ [[self purpleAdapter] doAuthRequestCbValue:[dict objectForKey:@"denyCB"] withUserDataValue:[dict objectForKey:@"userData"]]; default: // ask (should be 0)
return [super authorizationRequestWithDict:dict];
@@ -470,7 +465,7 @@
-- (AIReconnectDelayType)shouldAttemptReconnectAfterDisconnectionError:(NSString **)disconnectionError
+- (AIReconnectDelayType)shouldAttemptReconnectAfterDisconnectionError:(NSString * __strong *)disconnectionError AIReconnectDelayType shouldAttemptReconnect = [super shouldAttemptReconnectAfterDisconnectionError:disconnectionError];
@@ -611,7 +606,7 @@
- (NSDictionary *)willJoinChatUsingDictionary:(NSDictionary *)chatCreationDictionary
if (![[chatCreationDictionary objectForKey:@"handle"] length]) {
- NSMutableDictionary *dict = [[chatCreationDictionary mutableCopy] autorelease];
+ NSMutableDictionary *dict = [chatCreationDictionary mutableCopy]; [dict setObject:self.displayName
@@ -794,7 +789,7 @@
if(atsign.location != NSNotFound)
[super removeContact:theContact];
- for (NSDictionary *gatewaydict in [[gateways copy] autorelease]) {
+ for (NSDictionary *gatewaydict in [gateways copy]) { if([[[gatewaydict objectForKey:@"contact"] UID] isEqualToString:theContact.UID]) {
[[self purpleAdapter] removeUID:theContact.UID onAccount:self fromGroup:[gatewaydict objectForKey:@"remoteGroup"]];
@@ -816,7 +811,6 @@
gateways = [[NSMutableArray alloc] init];
[adhocServer addCommand:@"ping" delegate:(id<AMPurpleJabberAdHocServerDelegate>)[AMPurpleJabberAdHocPing class] name:@"Ping"];
@@ -835,12 +829,12 @@
[xmlConsoleController setPurpleConnection:NULL];
- [discoveryBrowserController release]; discoveryBrowserController = nil;
- [adhocServer release]; adhocServer = nil;
+ discoveryBrowserController = nil; - [gateways release]; gateways = nil;
- (IBAction)showXMLConsole:(id)sender {
@@ -905,17 +899,14 @@
[removeItem setTarget:self];
[removeItem setRepresentedObject:gateway];
[submenu addItem:removeItem];
[mitem setSubmenu:submenu];
[mitem setRepresentedObject:gateway];
[mitem setImage:[AIStatusIcons statusIconForListObject:gateway
direction:AIIconNormal]];
[menu addObject:[NSMenuItem separatorItem]];
@@ -932,7 +923,6 @@
[xmlConsoleMenuItem setTarget:self];
[menu addObject:xmlConsoleMenuItem];
- [xmlConsoleMenuItem release];
NSMenuItem *discoveryBrowserMenuItem = [[NSMenuItem alloc] initWithTitle:AILocalizedString(@"Discovery Browser",nil)
@@ -940,9 +930,8 @@
[discoveryBrowserMenuItem setTarget:self];
[menu addObject:discoveryBrowserMenuItem];
- [discoveryBrowserMenuItem release];
- return [menu autorelease];
- (void)registerGateway:(NSMenuItem*)mitem {
@@ -977,8 +966,6 @@
[self removeContacts:gatewayContacts
fromGroups:removeGroups.allObjects];
- [gatewayContacts release];
// finally, remove the gateway itself
[self removeContact:gateway];
--- a/Plugins/Purple Service/ESPurpleJabberAccountViewController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/ESPurpleJabberAccountViewController.m Sun Sep 09 12:24:39 2012 -0400
@@ -61,7 +61,7 @@
NSString *resource = [account preferenceForKey:KEY_JABBER_RESOURCE group:GROUP_ACCOUNT_STATUS];
- resource = [(NSString*)SCDynamicStoreCopyLocalHostName(NULL) autorelease];
+ resource = (__bridge_transfer NSString*)SCDynamicStoreCopyLocalHostName(NULL); [textField_resource setStringValue:resource];
@@ -154,10 +154,6 @@
[[NSNotificationCenter defaultCenter] removeObserver:self];
- [window_registerServer release];
#pragma mark group combobox datasource
@@ -221,9 +217,9 @@
- (IBAction)registerNewAccount:(id)sender {
- NSXMLDocument *serverfeed = [[[NSXMLDocument alloc] initWithContentsOfURL:[NSURL URLWithString:SERVERFEEDRSSURL]
+ NSXMLDocument *serverfeed = [[NSXMLDocument alloc] initWithContentsOfURL:[NSURL URLWithString:SERVERFEEDRSSURL] - error:&err] autorelease];
[[NSAlert alertWithError:err] runModal];
--- a/Plugins/Purple Service/ESPurpleMSNAccount.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/ESPurpleMSNAccount.m Sun Sep 09 12:24:39 2012 -0400
@@ -72,13 +72,6 @@
lastFriendlyNameChange = nil;
- [lastFriendlyNameChange release];
- [queuedFriendlyName release];
- (const char*)protocolPlugin
@@ -312,7 +305,6 @@
[self setPreference:[newPreference dataRepresentation]
forKey:KEY_ACCOUNT_DISPLAY_NAME
group:GROUP_ACCOUNT_STATUS];
- [newPreference release];
[self updateStatusForKey:KEY_ACCOUNT_DISPLAY_NAME];
@@ -325,7 +317,7 @@
- (void)doQueuedSetServersideDisplayName
[self setServersideDisplayName:queuedFriendlyName];
- [queuedFriendlyName release]; queuedFriendlyName = nil;
+ queuedFriendlyName = nil; - (void)setServersideDisplayName:(NSString *)friendlyName
@@ -337,7 +329,7 @@
[now timeIntervalSinceDate:lastFriendlyNameChange] > SECONDS_BETWEEN_FRIENDLY_NAME_CHANGES) {
//Don't allow newlines in the friendly name; convert them to slashes.
- NSMutableString *noNewlinesFriendlyName = [[friendlyName mutableCopy] autorelease];
+ NSMutableString *noNewlinesFriendlyName = [friendlyName mutableCopy]; [noNewlinesFriendlyName convertNewlinesToSlashes];
friendlyName = noNewlinesFriendlyName;
@@ -352,7 +344,7 @@
while (friendlyNameUTF8String &&
strlen(purple_url_encode(friendlyNameUTF8String)) > BUDDY_ALIAS_MAXLEN) {
- AILog(@"Shortening because %s (max len %i) [%s] len (%i) > %i",
+ AILog(@"Shortening because %s (max len %li) [%s] len (%zi) > %i", friendlyNameUTF8String, currentMaxNumberOfPreEncodedCharacters,
purple_url_encode(friendlyNameUTF8String),strlen(purple_url_encode(friendlyNameUTF8String)),
@@ -364,16 +356,14 @@
purple_account_set_alias(account, friendlyNameUTF8String);
purple_account_set_public_alias(account, friendlyNameUTF8String, NULL, NULL);
- [lastFriendlyNameChange release];
- lastFriendlyNameChange = [now retain];
+ lastFriendlyNameChange = now; [NSObject cancelPreviousPerformRequestsWithTarget:self
selector:@selector(doQueuedSetServersideDisplayName)
if (queuedFriendlyName != friendlyName) {
- [queuedFriendlyName release];
- queuedFriendlyName = [friendlyName retain];
+ queuedFriendlyName = friendlyName; [self performSelector:@selector(doQueuedSetServersideDisplayName)
--- a/Plugins/Purple Service/ESPurpleMeanwhileAccount.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/ESPurpleMeanwhileAccount.m Sun Sep 09 12:24:39 2012 -0400
@@ -89,8 +89,8 @@
statusMessageString = (statusMessageText ? [NSString stringWithUTF8String:statusMessageText] : nil);
if (statusMessageString && [statusMessageString length]) {
- buddyStatusMessage = [[[NSAttributedString alloc] initWithString:statusMessageString
- attributes:nil] autorelease];
+ buddyStatusMessage = [[NSAttributedString alloc] initWithString:statusMessageString return buddyStatusMessage;
--- a/Plugins/Purple Service/ESPurpleNotifyEmailController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/ESPurpleNotifyEmailController.m Sun Sep 09 12:24:39 2012 -0400
@@ -20,7 +20,7 @@
#import <Adium/ESTextAndButtonsWindowController.h>
#import <Adium/AIContactAlertsControllerProtocol.h>
#import <Adium/AIAccount.h>
-#import <AIUtilities/AIObjectAdditions.h>
@interface ESPurpleNotifyEmailController ()
+ (void)openURLString:(NSString *)urlString;
@@ -58,8 +58,8 @@
titleAttributes = [NSDictionary dictionaryWithObjectsAndKeys:titleFont,NSFontAttributeName,
centeredParagraphStyle,NSParagraphStyleAttributeName,nil];
- [message appendAttributedString:[[[NSAttributedString alloc] initWithString:title
- attributes:titleAttributes] autorelease]];
+ [message appendAttributedString:[[NSAttributedString alloc] initWithString:title + attributes:titleAttributes]]; @@ -88,8 +88,8 @@
numberMessageAttributes = [NSDictionary dictionaryWithObjectsAndKeys:messageFont,NSFontAttributeName,
centeredParagraphStyle,NSParagraphStyleAttributeName,nil];
- [message appendAttributedString:[[[NSAttributedString alloc] initWithString:numberMessage
- attributes:numberMessageAttributes] autorelease]];
+ [message appendAttributedString:[[NSAttributedString alloc] initWithString:numberMessage + attributes:numberMessageAttributes]]; BOOL haveFroms = (froms != NULL);
@@ -110,10 +110,10 @@
NSString *fromString = [NSString stringWithUTF8String:(*froms)];
if (fromString && [fromString length]) {
- [message appendAttributedString:[[[NSAttributedString alloc] initWithString:AILocalizedString(@"From: ",nil)
- attributes:fieldAttributed] autorelease]];
- [message appendAttributedString:[[[NSAttributedString alloc] initWithString:fromString
- attributes:infoAttributed] autorelease]];
+ [message appendAttributedString:[[NSAttributedString alloc] initWithString:AILocalizedString(@"From: ",nil) + attributes:fieldAttributed]]; + [message appendAttributedString:[[NSAttributedString alloc] initWithString:fromString + attributes:infoAttributed]]; @@ -124,11 +124,11 @@
NSString *subjectString = [NSString stringWithUTF8String:(*subjects)];
if (subjectString && [subjectString length]) {
- [message appendAttributedString:[[[NSAttributedString alloc] initWithString:AILocalizedString(@"Subject: ",nil)
- attributes:fieldAttributed] autorelease]];
+ [message appendAttributedString:[[NSAttributedString alloc] initWithString:AILocalizedString(@"Subject: ",nil) + attributes:fieldAttributed]]; AILog(@"%@: %@ appending %@",self,message,subjectString);
- [message appendAttributedString:[[[NSAttributedString alloc] initWithString:subjectString
- attributes:infoAttributed] autorelease]];
+ [message appendAttributedString:[[NSAttributedString alloc] initWithString:subjectString + attributes:infoAttributed]]; AILog(@"Got an invalid subjectString from %s",*subjects);
@@ -145,14 +145,9 @@
[infoDict setObject:urlString forKey:@"URL"];
- [self mainPerformSelector:@selector(showNotifyEmailWindowForAccount:withMessage:URLString:)
- withObject:(urlString ? urlString : nil)];
+ assert([[NSThread currentThread] isMainThread]); + [self showNotifyEmailWindowForAccount:account withMessage:message URLString:(urlString ? urlString : nil)]; - [centeredParagraphStyle release];
@@ -246,13 +241,13 @@
* nor what normally happens when the user opens a .html file since that is, on many systems, an HTML editor.
* Instead, we want to know what application to use for viewing web pages... and then open this file in it.
- err = LSGetApplicationForURL((CFURLRef)[NSURL URLWithString:@"http://www.adium.im"],
+ err = LSGetApplicationForURL((__bridge CFURLRef)[NSURL URLWithString:@"http://www.adium.im"], [[NSWorkspace sharedWorkspace] openFile:[urlString stringByExpandingTildeInPath]
- withApplication:[(NSURL *)appURL path]];
+ withApplication:[(__bridge NSURL *)appURL path]]; @@ -285,15 +280,17 @@
- LSGetApplicationForURL((CFURLRef)[NSURL URLWithString:@"mailto://"], kLSRolesAll, &myAppRef, NULL);
- LSCopyDisplayNameForRef(&myAppRef, (CFStringRef *)&appName);
+ LSGetApplicationForURL((__bridge CFURLRef)[NSURL URLWithString:@"mailto://"], kLSRolesAll, &myAppRef, NULL); + CFStringRef boop = NULL; + LSCopyDisplayNameForRef(&myAppRef, &boop); + appName = (__bridge NSString *)boop; if ((appRange = [appName rangeOfString:@".app" options:(NSCaseInsensitiveSearch | NSBackwardsSearch | NSAnchoredSearch)]).location != NSNotFound) {
- appName = [[appName substringToIndex:appRange.location] retain];
+ appName = [appName substringToIndex:appRange.location]; - return [appName autorelease];
--- a/Plugins/Purple Service/ESPurpleRequestAbstractWindowController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/ESPurpleRequestAbstractWindowController.m Sun Sep 09 12:24:39 2012 -0400
@@ -60,8 +60,6 @@
--- a/Plugins/Purple Service/ESPurpleRequestActionController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/ESPurpleRequestActionController.m Sun Sep 09 12:24:39 2012 -0400
@@ -54,7 +54,7 @@
infoDict = [self translatedInfoDict:infoDict];
- theInfoDict = [infoDict retain];
+ theInfoDict = infoDict; title = [infoDict objectForKey:@"TitleString"];
@@ -100,10 +100,8 @@
andMessage:attributedMessage
- // We retain it once more, as showOnWindow will (eventually) do a release.
- [requestController retain];
[requestController showOnWindow:nil];
if ([infoDict objectForKey:@"Image"])
[requestController setImage:[infoDict objectForKey:@"Image"]];
@@ -113,14 +111,6 @@
- [requestController release]; requestController = nil;
- (BOOL)textAndButtonsWindowDidEnd:(NSWindow *)window returnCode:(AITextAndButtonsReturnCode)returnCode suppression:(BOOL)suppression userInfo:(id)userInfo
@@ -159,7 +149,7 @@
//We won't need to try to close it ourselves later
- [requestController release]; requestController = nil;
+ requestController = nil; //Inform libpurple that the request window closed
[ESPurpleRequestAdapter requestCloseWithHandle:self];
@@ -192,8 +182,6 @@
[[requestController window] orderOut:self];
[requestController close];
@@ -266,7 +254,7 @@
[translatedDict setObject:buttonNamesArray
- return [translatedDict autorelease];
- (NSString *)description
--- a/Plugins/Purple Service/ESPurpleRequestWindowController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/ESPurpleRequestWindowController.m Sun Sep 09 12:24:39 2012 -0400
@@ -67,7 +67,7 @@
//If masked, replace our textField_input with a secure one
if ([[infoDict objectForKey:@"Masked"] boolValue]) {
NSRect inputFrame = [textField_input frame];
- NSSecureTextField *secureTextField = [[[NSSecureTextField alloc] initWithFrame:inputFrame] autorelease];
+ NSSecureTextField *secureTextField = [[NSSecureTextField alloc] initWithFrame:inputFrame]; [[textField_input superview] addSubview:secureTextField];
[secureTextField setNeedsDisplay:YES];
@@ -158,9 +158,9 @@
[textField_input selectText:nil];
- okayCallbackValue = [[infoDict objectForKey:@"OK Callback"] retain];
- cancelCallbackValue = [[infoDict objectForKey:@"Cancel Callback"] retain];
- userDataValue = [[infoDict objectForKey:@"userData"] retain];
+ okayCallbackValue = [infoDict objectForKey:@"OK Callback"]; + cancelCallbackValue = [infoDict objectForKey:@"Cancel Callback"]; + userDataValue = [infoDict objectForKey:@"userData"]; @@ -180,9 +180,9 @@
if (sender == button_okay) {
[self doRequestInputCbValue:okayCallbackValue
withUserDataValue:userDataValue
- inputString:[[[textField_input stringValue] copy] autorelease]];
+ inputString:[[textField_input stringValue] copy]]; - [cancelCallbackValue release]; cancelCallbackValue = nil;
+ cancelCallbackValue = nil; } else if (sender == button_cancel) {
@@ -190,21 +190,12 @@
- [okayCallbackValue release]; okayCallbackValue = nil;
- [cancelCallbackValue release]; cancelCallbackValue = nil;
- [userDataValue release]; userDataValue = nil;
- (void)doWindowWillClose
if (cancelCallbackValue) {
[self doRequestInputCbValue:cancelCallbackValue
withUserDataValue:userDataValue
- inputString:[[[textField_input stringValue] copy] autorelease]];
+ inputString:[[textField_input stringValue] copy]]; @@ -247,7 +238,7 @@
- return [translatedDict autorelease];
--- a/Plugins/Purple Service/ESPurpleYahooAccountViewController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/ESPurpleYahooAccountViewController.m Sun Sep 09 12:24:39 2012 -0400
@@ -67,7 +67,7 @@
- (NSMenu *)chatServerMenu
- NSMenu *chatServerMenu = [[NSMenu allocWithZone:[NSMenu zone]] init];
+ NSMenu *chatServerMenu = [[NSMenu alloc] init]; NSMutableArray *menuItems = [NSMutableArray array];
NSDictionary *roomListServersDict;
@@ -96,18 +96,18 @@
@"United Kingdom", @"uk",
- menuItem = [[[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:AILocalizedString(@"United States",nil)
+ menuItem = [[NSMenuItem alloc] initWithTitle:AILocalizedString(@"United States",nil) - keyEquivalent:@""] autorelease];
[menuItem setRepresentedObject:@"us"];
[menuItems addObject:menuItem];
for (NSString *prefix in roomListServersDict) {
- menuItem = [[[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:[roomListServersDict objectForKey:prefix]
+ menuItem = [[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:[roomListServersDict objectForKey:prefix] - keyEquivalent:@""] autorelease];
[menuItem setRepresentedObject:prefix];
[menuItems addObject:menuItem];
@@ -118,7 +118,7 @@
[chatServerMenu addItem:menuItem];
- return [chatServerMenu autorelease];
--- a/Plugins/Purple Service/ESPurpleZephyrAccount.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/ESPurpleZephyrAccount.m Sun Sep 09 12:24:39 2012 -0400
@@ -17,6 +17,7 @@
#import "ESPurpleZephyrAccountViewController.h"
#import "ESPurpleZephyrAccount.h"
#import <Adium/AIStatus.h>
+#import <Adium/AIListContact.h> @@ -162,10 +163,8 @@
AILocalizedString(@"The Zephyr Host Manager reported an error #%d: %@", "Be careful to keep the % parts the same in this string. %@ will be replaced by an error message."),
AILocalizedString(@"OK", nil), nil, nil, status, tempString);
//Should we stop here, or keep going, knowing we'll get another error message when we try to connect via libpurple?
--- a/Plugins/Purple Service/ESPurpleZephyrAccountViewController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/ESPurpleZephyrAccountViewController.m Sun Sep 09 12:24:39 2012 -0400
@@ -103,7 +103,6 @@
[account setPreference:ray
forKey:KEY_ZEPHYR_SERVERS
group:GROUP_ACCOUNT_STATUS];
- (NSInteger)numberOfRowsInTableView:(NSTableView *)aTableView
@@ -128,7 +127,7 @@
* @brief Add a new server to the list of servers.
- (void)addRowToServerList {
- NSArray *ray = [[account preferenceForKey:KEY_ZEPHYR_SERVERS group:GROUP_ACCOUNT_STATUS] retain];
+ NSArray *ray = [account preferenceForKey:KEY_ZEPHYR_SERVERS group:GROUP_ACCOUNT_STATUS]; [account setPreference:[ray arrayByAddingObject:@""]
forKey:KEY_ZEPHYR_SERVERS
@@ -137,8 +136,6 @@
[tableView_servers reloadData];
[tableView_servers selectRowIndexes:[NSIndexSet indexSetWithIndex:[ray count]] byExtendingSelection:NO];
[tableView_servers editColumn:0 row:[ray count] withEvent:nil select:YES];
@@ -154,7 +151,6 @@
[account setPreference:ray
forKey:KEY_ZEPHYR_SERVERS
group:GROUP_ACCOUNT_STATUS];
[tableView_servers reloadData];
--- a/Plugins/Purple Service/PurpleAccountViewController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/PurpleAccountViewController.m Sun Sep 09 12:24:39 2012 -0400
@@ -60,16 +60,15 @@
BOOL canIndent = [NSMenuItem instancesRespondToSelector:@selector(setIndentationLevel:)];
- menuItem = [[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:inTitle
+ menuItem = [[NSMenuItem alloc] initWithTitle:inTitle [menuItem setEnabled:NO];
- menuItem = [[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:name
+ menuItem = [[NSMenuItem alloc] initWithTitle:name @@ -77,7 +76,6 @@
if (canIndent) [menuItem setIndentationLevel:1];
@@ -228,7 +226,7 @@
- return [menu autorelease];
--- a/Plugins/Purple Service/PurpleFacebookAccount.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/PurpleFacebookAccount.m Sun Sep 09 12:24:39 2012 -0400
@@ -56,7 +56,7 @@
NSString *basePath = [[logsDir stringByAppendingPathComponent:oldFolder] stringByExpandingTildeInPath];
NSString *newPath = [[logsDir stringByAppendingPathComponent:newFolder] stringByExpandingTildeInPath];
- NSFileManager *fileManager = [[[NSFileManager alloc] init] autorelease];
+ NSFileManager *fileManager = [[NSFileManager alloc] init]; for (NSString *file in [fileManager enumeratorAtPath:basePath]) {
--- a/Plugins/Purple Service/SLPurpleCocoaAdapter.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/SLPurpleCocoaAdapter.m Sun Sep 09 12:24:39 2012 -0400
@@ -23,7 +23,7 @@
#import <Adium/AIAccountControllerProtocol.h>
#import <Adium/AIInterfaceControllerProtocol.h>
#import <Adium/AILoginControllerProtocol.h>
-#import <AIUtilities/AIObjectAdditions.h>
#import <Adium/AIAccount.h>
#import <Adium/AICorePluginLoader.h>
#import <Adium/AIService.h>
@@ -112,10 +112,9 @@
PurpleAccount *account = purple_account_new([adiumAccount purpleAccountName], [adiumAccount protocolPlugin]);
- [(CBPurpleAccount *)account->ui_data autorelease];
- [(CBPurpleAccount *)account->ui_data setPurpleAccount:nil];
+ [(__bridge CBPurpleAccount *)account->ui_data setPurpleAccount:nil]; - account->ui_data = [adiumAccount retain];
+ account->ui_data = (__bridge_retained void *)(adiumAccount); [adiumAccount setPurpleAccount:account];
@@ -129,7 +128,6 @@
PurpleAccount *account = accountLookupFromAdiumAccount(adiumAccount);
- [(CBPurpleAccount *)account->ui_data release];
purple_accounts_remove(account);
@@ -168,16 +166,16 @@
void adium_glib_print(const char *string)
AILog(@"(GLib): %s", string);
void adium_glib_log(const gchar *log_domain, GLogLevelFlags flags, const gchar *message, gpointer user_data)
if (!AIDebugLoggingIsEnabled()) return;
@@ -200,7 +198,7 @@
AILog(@"(GLib : %s): %@: %s", log_domain, level, message);
@@ -335,7 +333,7 @@
CBPurpleAccount* accountLookup(PurpleAccount *account)
- CBPurpleAccount *adiumPurpleAccount = (account ? (CBPurpleAccount *)account->ui_data : nil);
+ CBPurpleAccount *adiumPurpleAccount = (account ? (__bridge CBPurpleAccount *)account->ui_data : nil); /* If the account doesn't have its ui_data associated yet (we haven't tried to connect) but we want this
* lookup data, we have to do some manual parsing. This is used for example from the OTR preferences.
@@ -362,7 +360,7 @@
AIListContact* contactLookupFromBuddy(PurpleBuddy *buddy)
- AIListContact *theContact = (buddy ? (AIListContact *)buddy->node.ui_data : nil);
+ AIListContact *theContact = (buddy ? (__bridge AIListContact *)buddy->node.ui_data : nil); //If the node does not have ui_data yet, we need to create a contact and associate it
if (!theContact && buddy) {
@@ -373,7 +371,7 @@
theContact = [accountLookup(purple_buddy_get_account(buddy)) contactWithUID:UID];
//Associate the handle with ui_data and the buddy with our statusDictionary
- buddy->node.ui_data = [theContact retain];
+ buddy->node.ui_data = (__bridge_retained void *)(theContact); //This is the first time the contact has been accessed from the buddy; reset the icon cache for it
[AIUserIcons flushCacheForObject:theContact];
@@ -391,7 +389,7 @@
- chat = (AIChat *)conv->ui_data;
+ chat = (__bridge AIChat *)conv->ui_data; NSString *name = [NSString stringWithUTF8String:purple_conversation_get_name(conv)];
@@ -415,9 +413,8 @@
// If we don't have a chat creation dictionary (i.e., we didn't initiate the join), create one.
chat.chatCreationDictionary = [account extractChatCreationDictionaryFromConversation: conv];
- if (conv->ui_data != chat) {
- [(AIChat *)(conv->ui_data) release];
- conv->ui_data = [chat retain];
+ if (conv->ui_data != (__bridge void*)chat) { + conv->ui_data = (__bridge_retained void *)(chat); AILog(@"group chat lookup assigned %@ to %p (%s)",chat,conv, purple_conversation_get_name(conv));
@@ -427,7 +424,7 @@
AIChat* existingChatLookupFromConv(PurpleConversation *conv)
- return (conv ? conv->ui_data : nil);
+ return (__bridge AIChat*)(conv ? conv->ui_data : nil); AIChat* chatLookupFromConv(PurpleConversation *conv)
@@ -449,7 +446,7 @@
- chat = (AIChat *)conv->ui_data;
+ chat = (__bridge AIChat *)conv->ui_data; //No chat is associated with the IM conversation
@@ -488,7 +485,7 @@
- errorString = [NSString stringWithFormat:@"conv %x: Got nil chat in lookup for sourceContact %@ (%x ; \"%s\" ; \"%s\") on adiumAccount %@ (%x ; \"%s\")",
+ errorString = [NSString stringWithFormat:@"conv %p: Got nil chat in lookup for sourceContact %@ (%p ; \"%s\" ; \"%s\") on adiumAccount %@ (%p ; \"%s\")", @@ -502,9 +499,8 @@
//Associate the PurpleConversation with the AIChat
- if (conv->ui_data != chat) {
- [(AIChat *)(conv->ui_data) release];
- conv->ui_data = [chat retain];
+ if (conv->ui_data != (__bridge void*)chat) { + conv->ui_data = (__bridge_retained void *)(chat); @@ -743,7 +739,6 @@
data = [bitmapRep representationUsingType:NSPNGFileType properties:nil];
filename = [filename stringByAppendingPathExtension:extension];
@@ -757,12 +752,12 @@
//If we didn't get a purpleImage, just leave the tag for now.. maybe it was important?
- [newString appendFormat:@"<IMG ID=\"%ld\">",chunkString];
+ [newString appendFormat:@"<IMG ID=\"%@\">",chunkString]; - return ([newString autorelease]);
@@ -870,7 +865,7 @@
static AIHTMLDecoder *notifyFormattedHTMLDecoder = nil;
- if (!notifyFormattedHTMLDecoder) notifyFormattedHTMLDecoder = [[AIHTMLDecoder decoder] retain];
+ if (!notifyFormattedHTMLDecoder) notifyFormattedHTMLDecoder = [AIHTMLDecoder decoder]; NSString *textString = (text ? [NSString stringWithUTF8String:text] : nil);
if (textString) textString = [[notifyFormattedHTMLDecoder decodeHTML:textString] string];
@@ -909,7 +904,7 @@
- (void)disconnectAccount:(id)adiumAccount
PurpleAccount *account = accountLookupFromAdiumAccount(adiumAccount);
- AILog(@"Setting %x disabled and offline (%s)...",account,
+ AILog(@"Setting %p disabled and offline (%s)...",account, purple_status_type_get_id(purple_account_get_status_type_with_primitive(account, PURPLE_STATUS_OFFLINE)));
purple_account_set_enabled(account, "Adium", NO);
@@ -917,17 +912,17 @@
- (void)registerAccount:(id)adiumAccount
- purple_account_set_register_callback(accountLookupFromAdiumAccount(adiumAccount), adiumPurpleAccountRegisterCb, adiumAccount);
+ purple_account_set_register_callback(accountLookupFromAdiumAccount(adiumAccount), adiumPurpleAccountRegisterCb, (__bridge void*)adiumAccount); purple_account_register(accountLookupFromAdiumAccount(adiumAccount));
static void purpleUnregisterCb(PurpleAccount *account, gboolean success, void *user_data) {
- [(CBPurpleAccount*)user_data unregisteredAccount:success?YES:NO];
+ [(__bridge CBPurpleAccount*)user_data unregisteredAccount:success?YES:NO]; - (void)unregisterAccount:(id)adiumAccount
- purple_account_unregister(accountLookupFromAdiumAccount(adiumAccount), purpleUnregisterCb, adiumAccount);
+ purple_account_unregister(accountLookupFromAdiumAccount(adiumAccount), purpleUnregisterCb, (__bridge void*)adiumAccount); //Called on the purple thread, actually performs the specified command (it should have already been tested by
@@ -1280,7 +1275,6 @@
AILogWithSignature(@"Destroying %p (and releasing chat %p)", conv, conv->ui_data);
- [(AIChat *)conv->ui_data release];
//Tell purple to destroy the conversation.
@@ -1400,7 +1394,7 @@
PurpleAccount *account = accountLookupFromAdiumAccount(adiumAccount);
GList *attrs = createListFromDictionary(arguments);
- AILog(@"Setting status on %x (%s): ID %s, isActive %i, attributes %@",account, purple_account_get_username(account),
+ AILog(@"Setting status on %p (%s): ID %s, isActive %i, attributes %@",account, purple_account_get_username(account), statusID, [isActive boolValue], arguments);
purple_account_set_status_list(account, statusID, [isActive boolValue], attrs);
@@ -1616,7 +1610,7 @@
- (void)closeAuthRequestWithHandle:(id)authRequestHandle
- purple_account_request_close(authRequestHandle);
+ purple_account_request_close((__bridge void*)authRequestHandle); #pragma mark Secure messaging
@@ -1633,8 +1627,6 @@
purple_signals_disconnect_by_handle(adium_purple_get_handle());
--- a/Plugins/Purple Service/adiumPurpleAccounts.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/adiumPurpleAccounts.m Sun Sep 09 12:24:39 2012 -0400
@@ -69,19 +69,19 @@
if (alias && strlen(alias)) [infoDict setObject:[NSString stringWithUTF8String:alias] forKey:@"Alias"];
//Note that CBPurpleAccount will retain ownership of this object to keep it around for us in case adiumPurpleAccountRequestClose() is called.
- return [accountLookup(account) authorizationRequestWithDict:infoDict];
+ return (__bridge_retained void *)([accountLookup(account) authorizationRequestWithDict:infoDict]); static void adiumPurpleAccountRequestClose(void *ui_handle)
- id ourHandle = (id)ui_handle;
+ id ourHandle = (__bridge id)ui_handle; // Remove the request; we're passing the pointer to it.
[AdiumAuthorization closeAuthorizationForUIHandle:ourHandle];
void adiumPurpleAccountRegisterCb(PurpleAccount *account, gboolean succeeded, void *user_data) {
- id ourHandle = user_data;
+ id ourHandle = (__bridge id)user_data; if([ourHandle respondsToSelector:@selector(purpleAccountRegistered:)])
[ourHandle purpleAccountRegistered:(succeeded ? YES : NO)];
--- a/Plugins/Purple Service/adiumPurpleBlist.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/adiumPurpleBlist.m Sun Sep 09 12:24:39 2012 -0400
@@ -15,7 +15,7 @@
#import "adiumPurpleBlist.h"
-#import <AIUtilities/AIObjectAdditions.h>
#import <Adium/AIListContact.h>
static void adiumPurpleBlistNewList(PurpleBuddyList *list)
@@ -44,7 +44,7 @@
[accountLookup(purple_buddy_get_account(buddy)) removeContact:contactLookupFromBuddy(buddy)];
- [(id)buddy->node.ui_data release]; buddy->node.ui_data = NULL;
+ buddy->node.ui_data = NULL; --- a/Plugins/Purple Service/adiumPurpleCertificateTrustWarning.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/adiumPurpleCertificateTrustWarning.m Sun Sep 09 12:24:39 2012 -0400
@@ -22,25 +22,24 @@
#import "ESPurpleJabberAccount.h"
void adium_query_cert_chain(PurpleSslConnection *gsc, const char *hostname, CFArrayRef certs, void (*query_cert_cb)(gboolean trusted, void *userdata), void *userdata) {
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- // only the jabber service supports this right now
- for (ESPurpleJabberAccount *account in [adium.accountController accountsCompatibleWithService:[adium.accountController firstServiceWithServiceID:@"Jabber"]]) {
- if([account secureConnection] == gsc) {
- if([account shouldVerifyCertificates])
- [AIPurpleCertificateTrustWarningAlert displayTrustWarningAlertWithAccount:account
- hostname:[NSString stringWithUTF8String:hostname]
- resultCallback:query_cert_cb
- query_cert_cb(true, userdata);
+ // only the jabber service supports this right now + for (ESPurpleJabberAccount *account in [adium.accountController accountsCompatibleWithService:[adium.accountController firstServiceWithServiceID:@"Jabber"]]) { + if([account secureConnection] == gsc) { + if([account shouldVerifyCertificates]) + [AIPurpleCertificateTrustWarningAlert displayTrustWarningAlertWithAccount:account + hostname:[NSString stringWithUTF8String:hostname] + resultCallback:query_cert_cb + query_cert_cb(true, userdata); + query_cert_cb(true, userdata);
- query_cert_cb(true, userdata);
--- a/Plugins/Purple Service/adiumPurpleConnection.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/adiumPurpleConnection.m Sun Sep 09 12:24:39 2012 -0400
@@ -15,26 +15,23 @@
#import "adiumPurpleConnection.h"
-#import <AIUtilities/AIObjectAdditions.h>
static void adiumPurpleConnConnectProgress(PurpleConnection *gc, const char *text, size_t step, size_t step_count)
if (!PURPLE_CONNECTION_IS_VALID(gc)) return;
- AILog(@"Connecting: gc=0x%x (%s) %i / %i", gc, text, step, step_count);
+ AILog(@"Connecting: gc=0x%p (%s) %zul / %zul", gc, text, step, step_count); NSNumber *connectionProgressPrecent = [NSNumber numberWithDouble:((CGFloat)step / (CGFloat)(step_count-1))];
- [accountLookup(purple_connection_get_account(gc)) mainPerformSelector:@selector(accountConnectionProgressStep:percentDone:)
- withObject:[NSNumber numberWithInteger:step]
- withObject:connectionProgressPrecent];
+ [accountLookup(purple_connection_get_account(gc)) accountConnectionProgressStep:[NSNumber numberWithInteger:step] percentDone:connectionProgressPrecent]; static void adiumPurpleConnConnected(PurpleConnection *gc)
- AILog(@"Connected: gc=%x", gc);
+ AILog(@"Connected: gc=%p", gc); [accountLookup(purple_connection_get_account(gc)) accountConnectionConnected];
@@ -43,21 +40,21 @@
static void adiumPurpleConnDisconnected(PurpleConnection *gc)
- AILog(@"Disconnected: gc=%x", gc);
+ AILog(@"Disconnected: gc=%p", gc); // if (_accountDict == nil) // if this has been destroyed, unloadPlugin has already been called
[accountLookup(purple_connection_get_account(gc)) accountConnectionDisconnected];
static void adiumPurpleConnNotice(PurpleConnection *gc, const char *text)
- AILog(@"Connection Notice: gc=%x (%s)", gc, text);
+ AILog(@"Connection Notice: gc=%p (%s)", gc, text); NSString *connectionNotice = [NSString stringWithUTF8String:text];
[accountLookup(purple_connection_get_account(gc)) accountConnectionNotice:connectionNotice];
/** Called when an error causes a connection to be disconnected.
@@ -71,15 +68,15 @@
* in more detail to the user.
static void adiumPurpleConnReportDisconnectReason(PurpleConnection *gc,
- PurpleConnectionError reason,
+ PurpleConnectionError reason,
- AILog(@"Connection Disconnected: gc=%x (%s)", gc, text);
+ AILog(@"Connection Disconnected: gc=%p (%s)", gc, text); NSString *disconnectError = (text ? [NSString stringWithUTF8String:text] : @"");
[accountLookup(purple_connection_get_account(gc)) accountConnectionReportDisconnect:disconnectError withReason:reason];
static PurpleConnectionUiOps adiumPurpleConnectionOps = {
--- a/Plugins/Purple Service/adiumPurpleConversation.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/adiumPurpleConversation.m Sun Sep 09 12:24:39 2012 -0400
@@ -15,7 +15,7 @@
#import "adiumPurpleConversation.h"
-#import <AIUtilities/AIObjectAdditions.h>
#import <AIUtilities/AIAttributedStringAdditions.h>
#import <Adium/AIContentTyping.h>
@@ -29,7 +29,7 @@
#pragma mark Conversations
static void adiumPurpleConvCreate(PurpleConversation *conv)
//Pass chats along to the account
if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) {
@@ -37,25 +37,25 @@
[accountLookup(purple_conversation_get_account(conv)) addChat:chat];
static void adiumPurpleConvDestroy(PurpleConversation *conv)
/* Purple is telling us a conv was destroyed. We've probably already cleaned up, but be sure in case purple calls this
* when we don't ask it to (for example if we are summarily kicked from a chat room and purple closes the 'window').
- AIChat *chat = (AIChat *)conv->ui_data;
+ AIChat *chat = (__bridge AIChat *)conv->ui_data; AILogWithSignature(@"%p: %@", conv, chat);
//Chat will be nil if we've already cleaned up, at which point no further action is needed.
[accountLookup(purple_conversation_get_account(conv)) chatWasDestroyed:chat];
[chat setIdentifier:nil];
@@ -117,14 +117,14 @@
const char *message, PurpleMessageFlags flags,
//We only care about this if it does not have the PURPLE_MESSAGE_SEND flag, which is set if Purple is sending a sent message back to us
if ((flags & PURPLE_MESSAGE_SEND) == 0) {
if (flags & PURPLE_MESSAGE_NOTIFY) {
// We received a notification (nudge or buzz). Send a notification of such.
NSString *type, *messageString = [NSString stringWithUTF8String:message];
// Determine what we're actually notifying about.
if ([messageString rangeOfString:@"nudge" options:(NSCaseInsensitiveSearch | NSLiteralSearch)].location != NSNotFound) {
@@ -134,12 +134,12 @@
// Just call an unknown type a "notification"
[[NSNotificationCenter defaultCenter] postNotificationName:Chat_NudgeBuzzOccured
- object:chatLookupFromConv(conv)
- userInfo:[NSDictionary dictionaryWithObjectsAndKeys:
+ object:chatLookupFromConv(conv) + userInfo:[NSDictionary dictionaryWithObjectsAndKeys: NSDictionary *messageDict;
CBPurpleAccount *adiumAccount = accountLookup(purple_conversation_get_account(conv));
@@ -169,11 +169,11 @@
const char *message, PurpleMessageFlags flags,
AILog(@"adiumPurpleConvWriteConv: Received %s from %s [%i]",message,who,flags);
AIChat *chat = chatLookupFromConv(conv);
@@ -185,7 +185,7 @@
- if (flags & PURPLE_MESSAGE_ERROR) {
+ if (flags & PURPLE_MESSAGE_ERROR) { if ([messageString rangeOfString:@"User information not available"].location != NSNotFound) {
//Ignore user information errors; they are irrelevent
//XXX The user info check only works in English; libpurple should be modified to be better about this useless information spamming
@@ -222,16 +222,13 @@
if (errorType != AIChatUnknownError) {
- [accountLookup(purple_conversation_get_account(conv)) performSelector:@selector(errorForChat:type:)
- withObject:[NSNumber numberWithInteger:errorType]
+ dispatch_async(dispatch_get_main_queue(), ^{ + [accountLookup(purple_conversation_get_account(conv)) errorForChat:chat type:[NSNumber numberWithInteger:errorType]]; - [adium.contentController performSelector:@selector(displayEvent:ofType:inChat:)
- withObject:messageString
- withObject:@"libpurpleMessage"
+ dispatch_async(dispatch_get_main_queue(), ^{ + [adium.contentController displayEvent:messageString ofType:@"libpurpleMessage" inChat:chat]; AILog(@"*** Conversation error %@: %@", chat, messageString);
@@ -239,7 +236,7 @@
BOOL shouldDisplayMessage = TRUE;
if (strcmp(message, _("Direct IM established")) == 0) {
[accountLookup(purple_conversation_get_account(conv)) updateContact:chat.listObject
- forEvent:[NSNumber numberWithInteger:PURPLE_BUDDY_DIRECTIM_CONNECTED]];
+ forEvent:[NSNumber numberWithInteger:PURPLE_BUDDY_DIRECTIM_CONNECTED]]; shouldDisplayMessage = FALSE;
@@ -270,16 +267,13 @@
shouldDisplayMessage = FALSE;
if (shouldDisplayMessage) {
CBPurpleAccount *account = accountLookup(purple_conversation_get_account(conv));
- [account performSelector:@selector(receivedEventForChat:message:date:flags:)
- withObject:messageString
- withObject:[NSDate dateWithTimeIntervalSince1970:mtime]
- withObject:[NSNumber numberWithInteger:flags]
+ dispatch_async(dispatch_get_main_queue(), ^{ + [account receivedEventForChat:chat message:messageString date:[NSDate dateWithTimeIntervalSince1970:mtime] flags:[NSNumber numberWithInteger:flags]]; @@ -319,10 +313,10 @@
static void adiumPurpleConvChatAddUsers(PurpleConversation *conv, GList *cbuddies, gboolean new_arrivals)
if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) {
PurpleAccount *account = purple_conversation_get_account(conv);
NSMutableArray *users = [NSMutableArray array];
for (GList *l = cbuddies; l; l = l->next) {
@@ -336,22 +330,22 @@
[accountLookup(account) updateUserListForChat:groupChatLookupFromConv(conv)
newlyAdded:new_arrivals];
AILog(@"adiumPurpleConvChatAddUsers: IM");
static void adiumPurpleConvChatRenameUser(PurpleConversation *conv, const char *oldName,
const char *newName, const char *newAlias)
AILog(@"adiumPurpleConvChatRenameUser: %s: oldName %s, newName %s, newAlias %s",
- purple_conversation_get_name(conv),
- oldName, newName, newAlias);
+ purple_conversation_get_name(conv), + oldName, newName, newAlias); if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) {
PurpleConvChat *convChat = purple_conversation_get_chat_data(conv);
@@ -372,20 +366,20 @@
static void adiumPurpleConvChatRemoveUsers(PurpleConversation *conv, GList *users)
if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) {
NSMutableArray *usersArray = [NSMutableArray array];
PurpleAccount *account = purple_conversation_get_account(conv);
for (l = users; l != NULL; l = l->next) {
NSString *normalizedUID = get_real_name_for_account_conv_buddy(account, conv, (char *)l->data);
[usersArray addObject:normalizedUID];
[accountLookup(account) removeUsersArray:usersArray
fromChat:groupChatLookupFromConv(conv)];
AILog(@"adiumPurpleConvChatRemoveUser: IM");
@@ -394,7 +388,7 @@
static void adiumPurpleConvUpdateUser(PurpleConversation *conv, const char *user)
PurpleAccount *account = purple_conversation_get_account(conv);
CBPurpleAccount *adiumAccount = accountLookup(account);
@@ -419,7 +413,7 @@
static void adiumPurpleConvPresent(PurpleConversation *conv)
@@ -435,8 +429,8 @@
static void adiumPurpleConvUpdated(PurpleConversation *conv, PurpleConvUpdateType type)
if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) {
PurpleConvChat *chat = purple_conversation_get_chat_data(conv);
@@ -458,9 +452,9 @@
case PURPLE_CONV_UPDATE_TITLE:
[accountLookup(purple_conversation_get_account(conv)) updateTitle:(purple_conversation_get_title(conv) ?
- [NSString stringWithUTF8String:purple_conversation_get_title(conv)] :
- forChat:groupChatLookupFromConv(conv)];
+ [NSString stringWithUTF8String:purple_conversation_get_title(conv)] : + forChat:groupChatLookupFromConv(conv)]; AILog(@"Update to title: %s",purple_conversation_get_title(conv));
@@ -478,23 +472,23 @@
case PURPLE_CONV_UPDATE_AWAY:
case PURPLE_CONV_UPDATE_ICON:
case PURPLE_CONV_UPDATE_FEATURES:
- [accountLookup(purple_conversation_get_account(conv)) mainPerformSelector:@selector(convUpdateForChat:type:)
- withObject:groupChatLookupFromConv(conv)
- withObject:[NSNumber numberWithInt:type]];
+ [accountLookup(purple_conversation_get_account(conv)) mainPerformSelector:@selector(convUpdateForChat:type:) + withObject:groupChatLookupFromConv(conv) + withObject:[NSNumber numberWithInt:type]];
} else if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM) {
PurpleConvIm *im = purple_conversation_get_im_data(conv);
case PURPLE_CONV_UPDATE_TYPING: {
AITypingState typingState;
switch (purple_conv_im_get_typing_state(im)) {
@@ -507,11 +501,11 @@
typingState = AINotTyping;
NSNumber *typingStateNumber = [NSNumber numberWithInteger:typingState];
[accountLookup(purple_conversation_get_account(conv)) typingUpdateForIMChat:imChatLookupFromConv(conv)
- typing:typingStateNumber];
+ typing:typingStateNumber]; case PURPLE_CONV_UPDATE_AWAY: {
@@ -531,45 +525,45 @@
#pragma mark Custom smileys
static gboolean adiumPurpleConvCustomSmileyAdd(PurpleConversation *conv, const char *smile, gboolean remote)
AILog(@"%s: Added Custom Smiley %s",purple_conversation_get_name(conv),smile);
[accountLookup(purple_conversation_get_account(conv)) chat:chatLookupFromConv(conv)
- isWaitingOnCustomEmoticon:[NSString stringWithUTF8String:smile]];
+ isWaitingOnCustomEmoticon:[NSString stringWithUTF8String:smile]]; static void adiumPurpleConvCustomSmileyWrite(PurpleConversation *conv, const char *smile,
const guchar *data, gsize size)
- AILog(@"%s: Write Custom Smiley %s (%x %i)",purple_conversation_get_name(conv),smile,data,size);
+ AILog(@"%s: Write Custom Smiley %s (%p %li)",purple_conversation_get_name(conv),smile,data,size); [accountLookup(purple_conversation_get_account(conv)) chat:chatLookupFromConv(conv)
- setCustomEmoticon:[NSString stringWithUTF8String:smile]
- withImageData:[NSData dataWithBytes:data
+ setCustomEmoticon:[NSString stringWithUTF8String:smile] + withImageData:[NSData dataWithBytes:data static void adiumPurpleConvCustomSmileyClose(PurpleConversation *conv, const char *smile)
AILog(@"%s: Close Custom Smiley %s",purple_conversation_get_name(conv),smile);
[accountLookup(purple_conversation_get_account(conv)) chat:chatLookupFromConv(conv)
- closedCustomEmoticon:[NSString stringWithUTF8String:smile]];
+ closedCustomEmoticon:[NSString stringWithUTF8String:smile]]; static gboolean adiumPurpleConvJoin(PurpleConversation *conv, const char *name,
PurpleConvChatBuddyFlags flags,
AIChat *chat = groupChatLookupFromConv(conv);
// We return TRUE if we want to hide it.
return !chat.showJoinLeave;
@@ -578,7 +572,7 @@
static gboolean adiumPurpleConvLeave(PurpleConversation *conv, const char *name,
const char *reason, GHashTable *users)
AIChat *chat = groupChatLookupFromConv(conv);
// We return TRUE if we want to hide it.
--- a/Plugins/Purple Service/adiumPurpleCore.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/adiumPurpleCore.m Sun Sep 09 12:24:39 2012 -0400
@@ -46,7 +46,7 @@
static void adiumPurpleDebugPrint(PurpleDebugLevel level, const char *category, const char *debug_msg)
if (!category) category = "general"; //Category can be nil
AILog(@"(Libpurple: %s) %s",category, debug_msg);
@@ -95,9 +95,9 @@
for (id <AILibpurplePlugin> plugin in [SLPurpleCocoaAdapter libpurplePluginArray]) {
if ([plugin respondsToSelector:@selector(installLibpurplePlugin)]) {
[plugin installLibpurplePlugin];
@@ -116,9 +116,9 @@
for (id <AILibpurplePlugin> plugin in [SLPurpleCocoaAdapter libpurplePluginArray]) {
if ([plugin respondsToSelector:@selector(loadLibpurplePlugin)]) {
[plugin loadLibpurplePlugin];
@@ -155,12 +155,12 @@
static void adiumPurpleCoreDebugInit(void)
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- AILogWithSignature(@"");
- configurePurpleDebugLogging();
+ AILogWithSignature(@""); + configurePurpleDebugLogging(); static void associateLibpurpleAccounts(void)
@@ -169,8 +169,7 @@
if ([adiumAccount isKindOfClass:[CBPurpleAccount class]]) {
PurpleAccount *account = purple_accounts_find(adiumAccount.purpleAccountName, adiumAccount.protocolPlugin);
- [(CBPurpleAccount *)account->ui_data autorelease];
- account->ui_data = [adiumAccount retain];
+ account->ui_data = (__bridge_retained void *)(adiumAccount); [adiumAccount setPurpleAccount:account];
@@ -181,7 +180,8 @@
/* The core is ready... finish configuring libpurple and its plugins */
static void adiumPurpleCoreUiInit(void)
bindtextdomain("pidgin", [[[NSBundle bundleWithIdentifier:@"im.pidgin.libpurple"] resourcePath] fileSystemRepresentation]);
bind_textdomain_codeset("pidgin", "UTF-8");
@@ -205,36 +205,36 @@
//So we'll set the environment variable for this process, which does work
setenv("LC_ALL", preferredLocaleString, /* overwrite? */ 1);
setenv("LC_MESSAGES", preferredLocaleString, /* overwrite? */ 1);
//Initialize all external plugins.
AILog(@"adiumPurpleCoreUiInit");
//Initialize the core UI ops
purple_blist_set_ui_ops(adium_purple_blist_get_ui_ops());
purple_connections_set_ui_ops(adium_purple_connection_get_ui_ops());
- purple_privacy_set_ui_ops (adium_purple_privacy_get_ui_ops());
+ purple_privacy_set_ui_ops (adium_purple_privacy_get_ui_ops()); purple_accounts_set_ui_ops(adium_purple_accounts_get_ui_ops());
//Configure signals for receiving purple events
configureAdiumPurpleSignals();
//Associate each libpurple account with the appropriate Adium AIAccount.
associateLibpurpleAccounts();
/* Why use Purple's accounts and blist list when we have the information locally?
- * - Faster account connection: Purple doesn't have to recreate the local list
- * - Privacy/blocking support depends on the accounts and blist files existing
- * Another possible advantage:
- * - Using Purple's own buddy icon caching (which depends on both files) allows us to avoid
- * re-requesting icons we already have locally on some protocols such as AIM.
+ * - Faster account connection: Purple doesn't have to recreate the local list + * - Privacy/blocking support depends on the accounts and blist files existing + * Another possible advantage: + * - Using Purple's own buddy icon caching (which depends on both files) allows us to avoid + * re-requesting icons we already have locally on some protocols such as AIM. //Setup the buddy list; then load the blist.
purple_set_blist(purple_blist_new());
AILog(@"adiumPurpleCore: purple_blist_load()...");
//Configure the GUI-related UI ops last
purple_roomlist_set_ui_ops (adium_purple_roomlist_get_ui_ops());
purple_notify_set_ui_ops(adium_purple_notify_get_ui_ops());
@@ -259,38 +259,37 @@
static GHashTable *adiumPurpleCoreGetUiInfo(void)
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- static GHashTable *ui_info = NULL;
- ui_info = g_hash_table_new(g_str_hash, g_str_equal);
- g_hash_table_insert(ui_info, "name", "Adium");
- /* I have a vague recollection of a crash if we didn't g_strdup() this, but it really shouldn't be necessary.
- * The ui_info stays in memory forever, anyways, so it hardly matters. -evands
- g_hash_table_insert(ui_info, "version", g_strdup([[NSApp applicationVersion] UTF8String]));
- g_hash_table_insert(ui_info, "website", "http://www.adium.im");
- g_hash_table_insert(ui_info, "dev_website", "http://trac.adium.im");
- g_hash_table_insert(ui_info, "client_type", "mac");
- /* AOL wants us to use the distid 1551 (0x060f) */
- g_hash_table_insert(ui_info, "prpl-aim-distid", GINT_TO_POINTER(1551));
- g_hash_table_insert(ui_info, "prpl-icq-distid", GINT_TO_POINTER(1551));
- /* This is Adium's clientKey registered under Zachary West's account, fuark.
- * Key management occurs at: http://developer.aim.com/manageKeys.jsp */
- g_hash_table_insert(ui_info, "prpl-aim-clientkey", "fu13Le5Ibonik3Sv");
+ static GHashTable *ui_info = NULL; + ui_info = g_hash_table_new(g_str_hash, g_str_equal); + g_hash_table_insert(ui_info, "name", "Adium"); + /* I have a vague recollection of a crash if we didn't g_strdup() this, but it really shouldn't be necessary. + * The ui_info stays in memory forever, anyways, so it hardly matters. -evands + g_hash_table_insert(ui_info, "version", g_strdup([[NSApp applicationVersion] UTF8String])); + g_hash_table_insert(ui_info, "website", "http://www.adium.im"); + g_hash_table_insert(ui_info, "dev_website", "http://trac.adium.im"); + g_hash_table_insert(ui_info, "client_type", "mac"); + /* AOL wants us to use the distid 1551 (0x060f) */ + g_hash_table_insert(ui_info, "prpl-aim-distid", GINT_TO_POINTER(1551)); + g_hash_table_insert(ui_info, "prpl-icq-distid", GINT_TO_POINTER(1551)); + /* This is Adium's clientKey registered under Zachary West's account, fuark. + * Key management occurs at: http://developer.aim.com/manageKeys.jsp */ + g_hash_table_insert(ui_info, "prpl-aim-clientkey", "fu13Le5Ibonik3Sv"); + /* As our previous key doesn't work with ICQ anymore, and registering for a + * new one requires signing an agreement which contradicts the GPL on various + * points, we now use the key used by the offical AIR (Mac/Linux) client. */ + g_hash_table_insert(ui_info, "prpl-icq-clientkey", "ic1-IIcaJnnNV5xA"); - /* As our previous key doesn't work with ICQ anymore, and registering for a
- * new one requires signing an agreement which contradicts the GPL on various
- * points, we now use the key used by the offical AIR (Mac/Linux) client. */
- g_hash_table_insert(ui_info, "prpl-icq-clientkey", "ic1-IIcaJnnNV5xA");
static PurpleCoreUiOps adiumPurpleCoreOps = {
--- a/Plugins/Purple Service/adiumPurpleDnsRequest.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/adiumPurpleDnsRequest.m Sun Sep 09 12:24:39 2012 -0400
@@ -60,7 +60,7 @@
+ (BOOL)performDnsRequestWithData:(PurpleDnsQueryData *)inData resolvedCB:(PurpleDnsQueryResolvedCallback)inResolved failedCB:(PurpleDnsQueryFailedCallback)inFailed
- return [[[[self alloc] initWithData:inData resolvedCB:inResolved failedCB:inFailed] autorelease] startLookup];
+ return [[[self alloc] initWithData:inData resolvedCB:inResolved failedCB:inFailed] startLookup]; - (id)initWithData:(PurpleDnsQueryData *)data resolvedCB:(PurpleDnsQueryResolvedCallback)resolved failedCB:(PurpleDnsQueryFailedCallback)failed
@@ -76,9 +76,6 @@
[lookupRequestsByQueryData setObject:self forKey:[NSValue valueWithPointer:query_data]];
- //Released in finishDnsRequest
@@ -86,8 +83,6 @@
- (PurpleDnsQueryData *)queryData
@@ -102,27 +97,26 @@
const CFStreamError *streamError,
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- AdiumPurpleDnsRequest *self = (AdiumPurpleDnsRequest *)info;
- if (streamError && (streamError->error != 0)) {
- [self lookupFailedWithError:streamError];
- Boolean hasBeenResolved;
- /* CFHostGetAddressing retrieves the known addresses from the given host. Returns a
- CFArrayRef of addresses. Each address is a CFDataRef wrapping a struct sockaddr. */
- CFArrayRef addresses = CFHostGetAddressing(theHost, &hasBeenResolved);
- [self lookupSucceededWithAddresses:(NSArray *)addresses];
+ AdiumPurpleDnsRequest *self = (__bridge AdiumPurpleDnsRequest *)info; + if (streamError && (streamError->error != 0)) { + [self lookupFailedWithError:streamError]; - [self lookupFailedWithError:NULL];
+ Boolean hasBeenResolved; + /* CFHostGetAddressing retrieves the known addresses from the given host. Returns a + CFArrayRef of addresses. Each address is a CFDataRef wrapping a struct sockaddr. */ + CFArrayRef addresses = CFHostGetAddressing(theHost, &hasBeenResolved); + [self lookupSucceededWithAddresses:(__bridge NSArray *)addresses]; + [self lookupFailedWithError:NULL];
@@ -135,7 +129,7 @@
- (void)lookupSucceededWithAddresses:(NSArray *)addresses
//Success! Build a list of our results and pass it to the resolved callback
- AILog(@"DNS resolve complete for %s:%d; %d addresses returned",
+ AILog(@"DNS resolve complete for %s:%d; %ld addresses returned", purple_dnsquery_get_host(query_data),
purple_dnsquery_get_port(query_data),
@@ -167,7 +161,7 @@
- (void)lookupFailedWithError:(const CFStreamError *)streamError
- AILogWithSignature(@"Failed lookup for %s. Error domain %i, error %i",
+ AILogWithSignature(@"Failed lookup for %s. Error domain %li, error %i", purple_dnsquery_get_host([self queryData]),
(streamError ? streamError->domain : 0),
(streamError ? streamError->error : 0));
@@ -191,14 +185,14 @@
CFStreamError streamError;
- CFHostClientContext context = { /* Version */ 0, /* info */ self, CFRetain, CFRelease, NULL};
+ CFHostClientContext context = { /* Version */ 0, /* info */ (__bridge void *)(self), CFRetain, CFRelease, NULL}; AILogWithSignature(@"Performing DNS resolve: %s:%d",
purple_dnsquery_get_host(query_data),
purple_dnsquery_get_port(query_data));
host = CFHostCreateWithName(kCFAllocatorDefault,
- (CFStringRef)[NSString stringWithUTF8String:purple_dnsquery_get_host(query_data)]);
+ (__bridge CFStringRef)[NSString stringWithUTF8String:purple_dnsquery_get_host(query_data)]); success = CFHostSetClient(host, host_client_cb, &context);
@@ -233,9 +227,6 @@
[lookupRequestsByQueryData removeObjectForKey:[NSValue valueWithPointer:query_data]];
- //Release our retain in init...
--- a/Plugins/Purple Service/adiumPurpleEventloop.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/adiumPurpleEventloop.m Sun Sep 09 12:24:39 2012 -0400
@@ -94,8 +94,8 @@
setSourceForTag(src, tag);
dispatch_source_set_event_handler(src, ^{
if (!function || !function(data)) {
adium_timeout_remove(tag);
@@ -146,7 +146,7 @@
src = dispatch_source_create(type, fd, 0, dispatch_get_main_queue());
dispatch_source_set_event_handler(src, ^{
if (func) func(user_data, fd, condition);
--- a/Plugins/Purple Service/adiumPurpleFt.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/adiumPurpleFt.m Sun Sep 09 12:24:39 2012 -0400
@@ -15,7 +15,7 @@
#import "adiumPurpleFt.h"
-#import <AIUtilities/AIObjectAdditions.h>
static void adiumPurpleNewXfer(PurpleXfer *xfer)
@@ -24,12 +24,12 @@
static void adiumPurpleDestroy(PurpleXfer *xfer)
- ESFileTransfer *fileTransfer = (ESFileTransfer *)xfer->ui_data;
+ ESFileTransfer *fileTransfer = (__bridge ESFileTransfer *)xfer->ui_data; [accountLookup(xfer->account) destroyFileTransfer:fileTransfer];
static void adiumPurpleAddXfer(PurpleXfer *xfer)
@@ -39,33 +39,33 @@
static void adiumPurpleUpdateProgress(PurpleXfer *xfer, double percent)
- ESFileTransfer *fileTransfer = (ESFileTransfer *)xfer->ui_data;
+ ESFileTransfer *fileTransfer = (__bridge ESFileTransfer *)xfer->ui_data; [accountLookup(xfer->account) updateProgressForFileTransfer:fileTransfer
percent:[NSNumber numberWithDouble:percent]
bytesSent:[NSNumber numberWithUnsignedLong:xfer->bytes_sent]];
static void adiumPurpleCancelLocal(PurpleXfer *xfer)
AILog(@"adiumPurpleCancelLocal");
- ESFileTransfer *fileTransfer = (ESFileTransfer *)xfer->ui_data;
+ ESFileTransfer *fileTransfer = (__bridge ESFileTransfer *)xfer->ui_data; [accountLookup(xfer->account) fileTransferCancelledLocally:fileTransfer];
static void adiumPurpleCancelRemote(PurpleXfer *xfer)
AILog(@"adiumPurpleCancelRemote");
- ESFileTransfer *fileTransfer = (ESFileTransfer *)xfer->ui_data;
+ ESFileTransfer *fileTransfer = (__bridge ESFileTransfer *)xfer->ui_data; [accountLookup(xfer->account) fileTransferCancelledRemotely:fileTransfer];
static PurpleXferUiOps adiumPurpleFileTransferOps = {
--- a/Plugins/Purple Service/adiumPurpleNotify.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/adiumPurpleNotify.m Sun Sep 09 12:24:39 2012 -0400
@@ -17,25 +17,25 @@
#import "ESPurpleNotifyEmailController.h"
#import "adiumPurpleNotify.h"
#import <AdiumLibpurple/SLPurpleCocoaAdapter.h>
-#import <AIUtilities/AIObjectAdditions.h>
#import "AMPurpleSearchResultsController.h"
static void *adiumPurpleNotifyMessage(PurpleNotifyMsgType type, const char *title, const char *primary, const char *secondary)
AILog(@"adiumPurpleNotifyMessage: type: %i\n%s\n%s\n%s ",
- (primary ? primary : ""),
- (secondary ? secondary : ""));
+ (primary ? primary : ""), + (secondary ? secondary : "")); void *res = ([[SLPurpleCocoaAdapter sharedInstance] handleNotifyMessageOfType:type
static void *adiumPurpleNotifyEmails(PurpleConnection *gc, size_t count, gboolean detailed, const char **subjects, const char **froms, const char **tos, const char **urls)
@@ -44,21 +44,21 @@
//Values passed can be null
AIAccount *account = (PURPLE_CONNECTION_IS_VALID(gc) ?
accountLookup(purple_connection_get_account(gc)) :
void *res = [ESPurpleNotifyEmailController handleNotifyEmailsForAccount:account
static void *adiumPurpleNotifyEmail(PurpleConnection *gc, const char *subject, const char *from, const char *to, const char *url)
@@ -75,19 +75,19 @@
static void *adiumPurpleNotifyFormatted(const char *title, const char *primary, const char *secondary, const char *text)
AILog(@"adiumPurpleNotifyFormatted: %s\n%s\n%s\n%s ",
- (primary ? primary : ""),
- (secondary ? secondary : ""),
+ (primary ? primary : ""), + (secondary ? secondary : ""), void * res = ([[SLPurpleCocoaAdapter sharedInstance] handleNotifyFormattedWithTitle:title
static void *adiumPurpleNotifySearchResults(PurpleConnection *gc, const char *title,
@@ -97,14 +97,14 @@
AILog(@"**** returning search results");
//This will be released in adiumPurpleNotifyClose()
- void *res = [[AMPurpleSearchResultsController alloc] initWithPurpleConnection:gc
- title:(title ? [NSString stringWithUTF8String:title] : nil)
- primaryText:(primary ? [NSString stringWithUTF8String:primary] : nil)
- secondaryText:(secondary ? [NSString stringWithUTF8String:secondary] : nil)
+ void *res = (__bridge_retained void *)([[AMPurpleSearchResultsController alloc] initWithPurpleConnection:gc + title:(title ? [NSString stringWithUTF8String:title] : nil) + primaryText:(primary ? [NSString stringWithUTF8String:primary] : nil) + secondaryText:(secondary ? [NSString stringWithUTF8String:secondary] : nil)
static void adiumPurpleNotifySearchResultsNewRows(PurpleConnection *gc,
@@ -112,67 +112,68 @@
- if([(id)data isKindOfClass:[AMPurpleSearchResultsController class]]) {
- [(AMPurpleSearchResultsController*)data addResults:results];
+ if([(__bridge id)data isKindOfClass:[AMPurpleSearchResultsController class]]) { + [(__bridge AMPurpleSearchResultsController*)data addResults:results];
static void *adiumPurpleNotifyUserinfo(PurpleConnection *gc, const char *who,
PurpleNotifyUserInfo *user_info)
if (PURPLE_CONNECTION_IS_VALID(gc)) {
PurpleAccount *account = purple_connection_get_account(gc);
PurpleBuddy *buddy = purple_find_buddy(account, who);
CBPurpleAccount *adiumAccount = accountLookup(account);
contact = contactLookupFromBuddy(buddy);
NSString *UID = [NSString stringWithUTF8String:purple_normalize(account, who)];
contact = [accountLookup(account) contactWithUID:UID];
[adiumAccount updateUserInfo:contact
static void *adiumPurpleNotifyUri(const char *uri)
AILogWithSignature(@"Opening URI %s",uri);
NSString *passedURI = [NSString stringWithUTF8String:uri];
if ([passedURI hasPrefix:[NSString stringWithUTF8String:g_get_tmp_dir()]] ||
[passedURI hasPrefix:NSTemporaryDirectory()]) {
NSString *actualURI = passedURI;
if (![[passedURI pathExtension] length]) {
actualURI = [passedURI stringByAppendingPathExtension:@"htm"];
[[NSFileManager defaultManager] copyItemAtPath:passedURI
//Open the HTML file with a web browser, not with an HTML editor
- if (LSGetApplicationForURL((CFURLRef)[NSURL URLWithString:@"http://google.com"],
+ if (LSGetApplicationForURL((__bridge CFURLRef)[NSURL URLWithString:@"http://google.com"], NULL) != kLSApplicationNotFoundErr) {
if (FSPathMakeRef((UInt8 *)[actualURI fileSystemRepresentation], &urlRef, NULL) == noErr) {
@@ -183,7 +184,7 @@
spec.launchFlags = kLSLaunchDontAddToRecents | kLSLaunchAsync;
- LSOpenFromRefSpec(&spec, NULL);
+ LSOpenFromRefSpec(&spec, NULL); @@ -191,24 +192,25 @@
static void adiumPurpleNotifyClose(PurpleNotifyType type,void *uiHandle)
- id ourHandle = uiHandle;
+ id ourHandle = (__bridge id)uiHandle; AILogWithSignature(@"Closing %p (%i)",ourHandle,type);
if ([ourHandle respondsToSelector:@selector(purpleRequestClose)]) {
[ourHandle performSelector:@selector(purpleRequestClose)];
} else if ([ourHandle respondsToSelector:@selector(closeWindow:)]) {
[ourHandle performSelector:@selector(closeWindow:)
--- a/Plugins/Purple Service/adiumPurplePrivacy.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/adiumPurplePrivacy.m Sun Sep 09 12:24:39 2012 -0400
@@ -15,7 +15,7 @@
#import "adiumPurplePrivacy.h"
-#import <AIUtilities/AIObjectAdditions.h>
static void adiumPurplePermitAdded(PurpleAccount *account, const char *name)
--- a/Plugins/Purple Service/adiumPurpleRequest.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/adiumPurpleRequest.m Sun Sep 09 12:24:39 2012 -0400
@@ -26,7 +26,7 @@
#import <Adium/AIContactAlertsControllerProtocol.h>
#import <Adium/ESFileTransfer.h>
#import <Adium/AIListContact.h>
-#import <AIUtilities/AIObjectAdditions.h>
#import <AdiumLibpurple/SLPurpleCocoaAdapter.h>
@@ -77,7 +77,7 @@
range:NSMakeRange(0, [processedText length])];
- return [processedText autorelease];
@@ -91,7 +91,7 @@
Multiline should be a paragraph-sized box; otherwise, a single line will suffice.
Masked means we want to use an NSSecureTextField sort of thing.
@@ -101,21 +101,21 @@
NSString *primaryString = (primary ? [NSString stringWithUTF8String:primary] : nil);
//Ignore purple trying to get an account's password; we'll feed it the password and reconnect if it gets here, somehow.
- if (primaryString && [primaryString rangeOfString:@"Enter password for "].location != NSNotFound) return [NSNull null];
+ if (primaryString && [primaryString rangeOfString:@"Enter password for "].location != NSNotFound) return (__bridge void *)([NSNull null]); NSMutableDictionary *infoDict;
NSString *okButtonText = processButtonText([NSString stringWithUTF8String:okText]);
NSString *cancelButtonText = processButtonText([NSString stringWithUTF8String:cancelText]);
infoDict = [NSMutableDictionary dictionaryWithObjectsAndKeys:okButtonText,@"OK Text",
- cancelButtonText,@"Cancel Text",
- [NSValue valueWithPointer:okCb],@"OK Callback",
- [NSValue valueWithPointer:cancelCb],@"Cancel Callback",
- [NSValue valueWithPointer:userData],@"userData",nil];
+ cancelButtonText,@"Cancel Text", + [NSValue valueWithPointer:okCb],@"OK Callback", + [NSValue valueWithPointer:cancelCb],@"Cancel Callback", + [NSValue valueWithPointer:userData],@"userData",nil]; if (primaryString) [infoDict setObject:primaryString forKey:@"Primary Text"];
- if (title) [infoDict setObject:[NSString stringWithUTF8String:title] forKey:@"Title"];
+ if (title) [infoDict setObject:[NSString stringWithUTF8String:title] forKey:@"Title"]; if (defaultValue) [infoDict setObject:[NSString stringWithUTF8String:defaultValue] forKey:@"Default Value"];
if (secondary) [infoDict setObject:[NSString stringWithUTF8String:secondary] forKey:@"Secondary Text"];
@@ -126,7 +126,8 @@
requestController = [ESPurpleRequestWindowController showInputWindowWithDict:infoDict];
- return requestController;
+ return (__bridge void*)requestController; @@ -154,24 +155,24 @@
size_t actionCount, va_list actions)
NSString *titleString = (title ? [NSString stringWithUTF8String:title] : @"");
NSString *primaryString = (primary ? [NSString stringWithUTF8String:primary] : nil);
id requestController = nil;
if (primaryString && ([primaryString isEqualToString:[NSString stringWithFormat:[NSString stringWithUTF8String:_("%s has just asked to directly connect to %s")],
who, purple_account_get_username(account)]])) {
AIListContact *adiumContact = contactLookupFromBuddy(purple_find_buddy(account, who));
// Look up the user preference for this setting -- we use the same settings as the File Transfer code.
- AIFileTransferAutoAcceptType autoAccept = [[adium.preferenceController preferenceForKey:KEY_FT_AUTO_ACCEPT
- group:PREF_GROUP_FILE_TRANSFER] intValue];
- if ((autoAccept == AutoAccept_All) ||
+ AIFileTransferAutoAcceptType autoAccept = [[adium.preferenceController preferenceForKey:KEY_FT_AUTO_ACCEPT + group:PREF_GROUP_FILE_TRANSFER] intValue]; + if ((autoAccept == AutoAccept_All) || ((autoAccept == AutoAccept_FromContactList) && adiumContact && [adiumContact isIntentionallyNotAStranger])) {
//Get the callback for Connect, skipping over the title
ok_cb = va_arg(actions, GCallback);
@@ -183,11 +184,11 @@
} else if (primary && strcmp(primary, _("Accept chat invitation?")) == 0) {
AIListContact *contact = contactLookupFromBuddy(purple_find_buddy(account, who));
[adium.contactAlertsController generateEvent:CONTENT_GROUP_CHAT_INVITE
- userInfo:[NSDictionary dictionary]
- previouslyPerformedActionIDs:nil];
+ userInfo:[NSDictionary dictionary] + previouslyPerformedActionIDs:nil];
NSString *secondaryString = (secondary ? [NSString stringWithUTF8String:secondary] : nil);
NSMutableArray *buttonNamesArray = [NSMutableArray arrayWithCapacity:actionCount];
@@ -210,7 +211,7 @@
// If there's no default_action, assume the first one is, and move it to the end.
if (default_action == -1)
GCallback tempCallBack = callBacks[actionCount-1];
callBacks[actionCount-1] = callBacks[default_action];
callBacks[default_action] = tempCallBack;
@@ -245,18 +246,18 @@
[infoDict setObject:[NSString stringWithUTF8String:who] forKey:@"who"];
if (icon_data && (icon_size > 0)) {
NSData *imageData = [NSData dataWithBytes:icon_data length:icon_size];
- NSImage *image = [[[NSImage alloc] initWithData:imageData] autorelease];
+ NSImage *image = [[NSImage alloc] initWithData:imageData]; [infoDict setObject:image forKey:@"Image"];
requestController = [ESPurpleRequestActionController showActionWindowWithDict:infoDict];
- return requestController;
+ return (__bridge void*)requestController; @@ -286,9 +287,9 @@
id requestController = nil;
if (title && (strcmp(title, _("Register New XMPP Account")) == 0)) {
/* Jabber registration request. Instead of displaying a request dialogue, we fill in the information automatically.
* And by that, I mean that we accept all the default empty values, since the username and password are preset for us. */
@@ -305,7 +306,7 @@
notifyingTarget:[ESPurpleRequestAdapter class]
selector:@selector(returnedPassword:returnCode:context:)
context:[NSDictionary dictionaryWithObjectsAndKeys:
- adiumAccount, @"Account",
+ adiumAccount, @"Account", [NSValue valueWithPointer:fields], @"fields",
[NSValue valueWithPointer:okCb], @"okCb",
[NSValue valueWithPointer:cancelCb], @"cancelCb",
@@ -318,7 +319,7 @@
(primary ? primary : ""),
(secondary ? secondary : ""));
- id self = (CBPurpleAccount*)account->ui_data; // for AILocalizedString
+ id self = (__bridge CBPurpleAccount*)account->ui_data; // for AILocalizedString requestController = [[AMPurpleRequestFieldsController alloc] initWithTitle:(title ? [NSString stringWithUTF8String:title] : nil)
primaryText:(primary ? [NSString stringWithUTF8String:primary] : nil)
@@ -328,13 +329,13 @@
cancelText:(cancelText ? [NSString stringWithUTF8String:cancelText] : AILocalizedString(@"Cancel",nil))
- account:(CBPurpleAccount*)account->ui_data
+ account:(__bridge CBPurpleAccount*)account->ui_data who:(who ? [NSString stringWithUTF8String:who] : nil)
- return requestController;
+ return (__bridge void*)requestController; @@ -343,24 +344,24 @@
PurpleAccount *account, const char *who, PurpleConversation *conv,
NSString *titleString = (title ? [NSString stringWithUTF8String:title] : nil);
NSSavePanel *savePanel = [NSSavePanel savePanel];
if ([titleString length]) [savePanel setTitle:titleString];
[savePanel setAllowedFileTypes:nil];
if ([savePanel runModal] == NSOKButton) {
((PurpleRequestFileCb)ok_cb)(user_data, [[[savePanel URL] path] UTF8String]);
NSOpenPanel *openPanel = [NSOpenPanel openPanel];
if ([titleString length]) [openPanel setTitle:titleString];
[openPanel setAllowedFileTypes:nil];
if ([openPanel runModal] == NSOKButton) {
((PurpleRequestFileCb)ok_cb)(user_data, [[[openPanel URL] path] UTF8String]);
@@ -384,7 +385,7 @@
* and we do, in fact, want to send. Call the OK callback immediately.
if (xfer->local_filename != NULL && xfer->filename != NULL) {
- AILog(@"PURPLE_XFER_SEND: %x (%s)",xfer,xfer->local_filename);
+ AILog(@"PURPLE_XFER_SEND: %p (%s)",xfer,xfer->local_filename); ((PurpleRequestFileCb)ok_cb)(user_data, xfer->local_filename);
((PurpleRequestFileCb)cancel_cb)(user_data, xfer->local_filename);
@@ -393,9 +394,9 @@
@@ -410,15 +411,15 @@
static void adiumPurpleRequestClose(PurpleRequestType type, void *uiHandle)
- id ourHandle = (id)uiHandle;
+ id ourHandle = (__bridge id)uiHandle; AILogWithSignature(@"%@ (%i)",uiHandle,[ourHandle respondsToSelector:@selector(purpleRequestClose)]);
if ([ourHandle respondsToSelector:@selector(purpleRequestClose)]) {
[ourHandle purpleRequestClose];
} else if ([ourHandle respondsToSelector:@selector(closeWindow:)]) {
[ourHandle closeWindow:nil];
static void *adiumPurpleRequestFolder(const char *title, const char *dirname, GCallback ok_cb, GCallback cancel_cb,
@@ -454,7 +455,7 @@
+ (void)requestCloseWithHandle:(id)handle
AILogWithSignature(@"%@", handle);
- purple_request_close_with_handle(handle);
+ purple_request_close_with_handle((__bridge void*)handle); + (void)returnedPassword:(NSString *)password returnCode:(AIPasswordPromptReturn)returnCode context:(id)context
--- a/Plugins/Purple Service/adiumPurpleSignals.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Purple Service/adiumPurpleSignals.m Sun Sep 09 12:24:39 2012 -0400
@@ -15,7 +15,7 @@
#import "adiumPurpleSignals.h"
-#import <AIUtilities/AIObjectAdditions.h>
#import <AIUtilities/AIAttributedStringAdditions.h>
#import <Adium/AIChatControllerProtocol.h>
@@ -27,245 +27,245 @@
static void buddy_event_cb(PurpleBuddy *buddy, PurpleBuddyEvent event)
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- SEL updateSelector = nil;
- BOOL letAccountHandleUpdate = YES;
- CBPurpleAccount *account = accountLookup(purple_buddy_get_account(buddy));
- AIListContact *theContact = contactLookupFromBuddy(buddy);
- case PURPLE_BUDDY_SIGNON: {
- updateSelector = @selector(updateSignon:withData:);
- case PURPLE_BUDDY_SIGNOFF: {
- updateSelector = @selector(updateSignoff:withData:);
- case PURPLE_BUDDY_SIGNON_TIME: {
- PurplePresence *presence = purple_buddy_get_presence(buddy);
- time_t loginTime = purple_presence_get_login_time(presence);
- updateSelector = @selector(updateSignonTime:withData:);
- data = (loginTime ? [NSDate dateWithTimeIntervalSince1970:loginTime] : nil);
+ SEL updateSelector = nil; + BOOL letAccountHandleUpdate = YES; + CBPurpleAccount *account = accountLookup(purple_buddy_get_account(buddy)); + AIListContact *theContact = contactLookupFromBuddy(buddy); + case PURPLE_BUDDY_SIGNON: { + updateSelector = @selector(updateSignon:withData:); + case PURPLE_BUDDY_SIGNOFF: { + updateSelector = @selector(updateSignoff:withData:); + case PURPLE_BUDDY_SIGNON_TIME: { + PurplePresence *presence = purple_buddy_get_presence(buddy); + time_t loginTime = purple_presence_get_login_time(presence); + updateSelector = @selector(updateSignonTime:withData:); + data = (loginTime ? [NSDate dateWithTimeIntervalSince1970:loginTime] : nil); + case PURPLE_BUDDY_EVIL: { + updateSelector = @selector(updateEvil:withData:); + //This is an update of the AIM Warning Level. We really, really don't care. + data = [NSNumber numberWithInt:buddy->evil]; + case PURPLE_BUDDY_ICON: { + PurpleBuddyIcon *buddyIcon = purple_buddy_get_icon(buddy); + updateSelector = @selector(updateIcon:withData:); + AILog(@"Buddy icon update for %s",purple_buddy_get_name(buddy)); + const guchar *iconData; + iconData = purple_buddy_icon_get_data(buddyIcon, &len); + data = [NSData dataWithBytes:iconData + AILog(@"[buddy icon: %s got data]",purple_buddy_get_name(buddy)); + case PURPLE_BUDDY_NAME: { + updateSelector = @selector(renameContact:toUID:); + data = [NSString stringWithUTF8String:purple_buddy_get_name(buddy)]; + AILog(@"Renaming %@ to %@",theContact,data); + data = [NSNumber numberWithInteger:event];
- case PURPLE_BUDDY_EVIL: {
- updateSelector = @selector(updateEvil:withData:);
- //This is an update of the AIM Warning Level. We really, really don't care.
- data = [NSNumber numberWithInt:buddy->evil];
+ if (letAccountHandleUpdate) { + [account performSelector:updateSelector + [account updateContact:theContact
- case PURPLE_BUDDY_ICON: {
- PurpleBuddyIcon *buddyIcon = purple_buddy_get_icon(buddy);
- updateSelector = @selector(updateIcon:withData:);
- AILog(@"Buddy icon update for %s",purple_buddy_get_name(buddy));
- const guchar *iconData;
- iconData = purple_buddy_icon_get_data(buddyIcon, &len);
- data = [NSData dataWithBytes:iconData
- AILog(@"[buddy icon: %s got data]",purple_buddy_get_name(buddy));
+ /* If a status event didn't change from its previous value, we won't be notified of it. + * That's generally a good thing, but we clear some values when a contact signs off, including + * status, idle time, and signed-on time. Manually update these as appropriate when we're informed of + if ((event == PURPLE_BUDDY_SIGNON) || (event == PURPLE_BUDDY_SIGNOFF)) { + PurplePresence *presence = purple_buddy_get_presence(buddy); + PurpleStatus *status = purple_presence_get_active_status(presence); + buddy_status_changed_cb(buddy, NULL, status, event); + if (event == PURPLE_BUDDY_SIGNON) { + buddy_idle_changed_cb(buddy, FALSE, purple_presence_is_idle(presence), event); + buddy_event_cb(buddy, PURPLE_BUDDY_SIGNON_TIME);
- case PURPLE_BUDDY_NAME: {
- updateSelector = @selector(renameContact:toUID:);
- data = [NSString stringWithUTF8String:purple_buddy_get_name(buddy)];
- AILog(@"Renaming %@ to %@",theContact,data);
- data = [NSNumber numberWithInteger:event];
- if (letAccountHandleUpdate) {
- [account performSelector:updateSelector
- [account updateContact:theContact
- /* If a status event didn't change from its previous value, we won't be notified of it.
- * That's generally a good thing, but we clear some values when a contact signs off, including
- * status, idle time, and signed-on time. Manually update these as appropriate when we're informed of
- if ((event == PURPLE_BUDDY_SIGNON) || (event == PURPLE_BUDDY_SIGNOFF)) {
- PurplePresence *presence = purple_buddy_get_presence(buddy);
- PurpleStatus *status = purple_presence_get_active_status(presence);
- buddy_status_changed_cb(buddy, NULL, status, event);
- if (event == PURPLE_BUDDY_SIGNON) {
- buddy_idle_changed_cb(buddy, FALSE, purple_presence_is_idle(presence), event);
- buddy_event_cb(buddy, PURPLE_BUDDY_SIGNON_TIME);
static void buddy_status_changed_cb(PurpleBuddy *buddy, PurpleStatus *oldstatus, PurpleStatus *status, PurpleBuddyEvent event)
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- CBPurpleAccount *account = accountLookup(purple_buddy_get_account(buddy));
- AIListContact *theContact = contactLookupFromBuddy(buddy);
- NSNumber *statusTypeNumber;
- NSAttributedString *statusMessage;
- BOOL isAvailable, isMobile;
- isAvailable = ((purple_status_type_get_primitive(purple_status_get_type(status)) == PURPLE_STATUS_AVAILABLE) ||
- (purple_status_type_get_primitive(purple_status_get_type(status)) == PURPLE_STATUS_OFFLINE));
- isMobile = purple_presence_is_status_primitive_active(purple_buddy_get_presence(buddy), PURPLE_STATUS_MOBILE);
- statusTypeNumber = [NSNumber numberWithInteger:(isAvailable ?
- AIAvailableStatusType :
- statusName = [account statusNameForPurpleBuddy:buddy];
- statusMessage = [account statusMessageForPurpleBuddy:buddy];
- [account updateStatusForContact:theContact
- toStatusType:statusTypeNumber
- statusMessage:statusMessage
+ CBPurpleAccount *account = accountLookup(purple_buddy_get_account(buddy)); + AIListContact *theContact = contactLookupFromBuddy(buddy); + NSNumber *statusTypeNumber; + NSAttributedString *statusMessage; + BOOL isAvailable, isMobile; + isAvailable = ((purple_status_type_get_primitive(purple_status_get_type(status)) == PURPLE_STATUS_AVAILABLE) || + (purple_status_type_get_primitive(purple_status_get_type(status)) == PURPLE_STATUS_OFFLINE)); + isMobile = purple_presence_is_status_primitive_active(purple_buddy_get_presence(buddy), PURPLE_STATUS_MOBILE); + statusTypeNumber = [NSNumber numberWithInteger:(isAvailable ? + AIAvailableStatusType : + statusName = [account statusNameForPurpleBuddy:buddy]; + statusMessage = [account statusMessageForPurpleBuddy:buddy]; + [account updateStatusForContact:theContact + toStatusType:statusTypeNumber + statusMessage:statusMessage static void buddy_idle_changed_cb(PurpleBuddy *buddy, gboolean old_idle, gboolean idle, PurpleBuddyEvent event)
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- CBPurpleAccount *account = accountLookup(purple_buddy_get_account(buddy));
- AIListContact *theContact = contactLookupFromBuddy(buddy);
- PurplePresence *presence = purple_buddy_get_presence(buddy);
- time_t idleTime = purple_presence_get_idle_time(presence);
- [account updateWentIdle:theContact
- [NSDate dateWithTimeIntervalSince1970:idleTime] :
- [account updateIdleReturn:theContact
+ CBPurpleAccount *account = accountLookup(purple_buddy_get_account(buddy)); + AIListContact *theContact = contactLookupFromBuddy(buddy); + PurplePresence *presence = purple_buddy_get_presence(buddy); + time_t idleTime = purple_presence_get_idle_time(presence); + [account updateWentIdle:theContact + [NSDate dateWithTimeIntervalSince1970:idleTime] : + [account updateIdleReturn:theContact
//This is called when a buddy is added or changes groups
static void buddy_added_cb(PurpleBuddy *buddy)
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- PurpleAccount *purpleAccount = purple_buddy_get_account(buddy);
- if (purple_account_is_connected(purpleAccount)) {
- CBPurpleAccount *account = accountLookup(purpleAccount);
- PurpleGroup *g = purple_buddy_get_group(buddy);
- NSString *groupName = ((g && purple_group_get_name(g)) ? [NSString stringWithUTF8String:purple_group_get_name(g)] : nil);
- AIListContact *listContact = contactLookupFromBuddy(buddy);
- /* We pass in purple_buddy_get_name(buddy) directly (without filtering or normalizing it) as it may indicate a
- * formatted version of the UID. We have a signal for when a rename occurs, but passing here lets us get
- * formatted names which are originally formatted in a way which differs from the results of normalization.
- * For example, TekJew will normalize to tekjew in AIM; we want to use tekjew internally but display TekJew.
- [account addContact:listContact
- contactName:[NSString stringWithUTF8String:purple_buddy_get_name(buddy)]];
- /* We won't get an initial alias update for this buddy if one is already set, so check and update appropriately.
- * This will give us an alias we've set serverside (the "private server alias") if possible.
- * Failing that, we will get an alias specified remotely (either by the server or by the buddy).
- const char *alias = purple_buddy_get_alias_only(buddy);
- [account updateContact:listContact
- toAlias:[NSString stringWithUTF8String:alias]];
+ PurpleAccount *purpleAccount = purple_buddy_get_account(buddy); + if (purple_account_is_connected(purpleAccount)) { + CBPurpleAccount *account = accountLookup(purpleAccount); + PurpleGroup *g = purple_buddy_get_group(buddy); + NSString *groupName = ((g && purple_group_get_name(g)) ? [NSString stringWithUTF8String:purple_group_get_name(g)] : nil); + AIListContact *listContact = contactLookupFromBuddy(buddy); + /* We pass in purple_buddy_get_name(buddy) directly (without filtering or normalizing it) as it may indicate a + * formatted version of the UID. We have a signal for when a rename occurs, but passing here lets us get + * formatted names which are originally formatted in a way which differs from the results of normalization. + * For example, TekJew will normalize to tekjew in AIM; we want to use tekjew internally but display TekJew. + [account addContact:listContact + contactName:[NSString stringWithUTF8String:purple_buddy_get_name(buddy)]]; + /* We won't get an initial alias update for this buddy if one is already set, so check and update appropriately. + * This will give us an alias we've set serverside (the "private server alias") if possible. + * Failing that, we will get an alias specified remotely (either by the server or by the buddy). + const char *alias = purple_buddy_get_alias_only(buddy); + [account updateContact:listContact + toAlias:[NSString stringWithUTF8String:alias]]; + // Force a status update for the user. Useful for things like XMPP which might display an error message for an offline contact. + buddy_status_changed_cb(buddy, NULL, purple_presence_get_active_status(purple_buddy_get_presence(buddy)), PURPLE_BUDDY_NONE);
- // Force a status update for the user. Useful for things like XMPP which might display an error message for an offline contact.
- buddy_status_changed_cb(buddy, NULL, purple_presence_get_active_status(purple_buddy_get_presence(buddy)), PURPLE_BUDDY_NONE);
static void buddy_removed_cb(PurpleBuddy *buddy)
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- PurpleAccount *purpleAccount = purple_buddy_get_account(buddy);
- if (purple_account_is_connected(purpleAccount)) {
- CBPurpleAccount *account = accountLookup(purpleAccount);
- PurpleGroup *g = purple_buddy_get_group(buddy);
- NSString *groupName = ((g && purple_group_get_name(g)) ? [NSString stringWithUTF8String:purple_group_get_name(g)] : nil);
- AIListContact *listContact = contactLookupFromBuddy(buddy);
- /* We pass in purple_buddy_get_name(buddy) directly (without filtering or normalizing it) as it may indicate a
- * formatted version of the UID. We have a signal for when a rename occurs, but passing here lets us get
- * formatted names which are originally formatted in a way which differs from the results of normalization.
- * For example, TekJew will normalize to tekjew in AIM; we want to use tekjew internally but display TekJew.
- [account removeContact:listContact fromGroupName:groupName];
+ PurpleAccount *purpleAccount = purple_buddy_get_account(buddy); + if (purple_account_is_connected(purpleAccount)) { + CBPurpleAccount *account = accountLookup(purpleAccount); + PurpleGroup *g = purple_buddy_get_group(buddy); + NSString *groupName = ((g && purple_group_get_name(g)) ? [NSString stringWithUTF8String:purple_group_get_name(g)] : nil); + AIListContact *listContact = contactLookupFromBuddy(buddy); + /* We pass in purple_buddy_get_name(buddy) directly (without filtering or normalizing it) as it may indicate a + * formatted version of the UID. We have a signal for when a rename occurs, but passing here lets us get + * formatted names which are originally formatted in a way which differs from the results of normalization. + * For example, TekJew will normalize to tekjew in AIM; we want to use tekjew internally but display TekJew. + [account removeContact:listContact fromGroupName:groupName];
static void connection_signed_on_cb(PurpleConnection *gc)
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- GSList *buddies = purple_find_buddies(purple_connection_get_account(gc), /* buddy_name */ NULL);
- for (cur = buddies; cur; cur = cur->next) {
- buddy_added_cb((PurpleBuddy *)cur->data);
+ GSList *buddies = purple_find_buddies(purple_connection_get_account(gc), /* buddy_name */ NULL); + for (cur = buddies; cur; cur = cur->next) { + buddy_added_cb((PurpleBuddy *)cur->data);
static void node_aliased_cb(PurpleBlistNode *node, char *old_alias)
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- if (PURPLE_BLIST_NODE_IS_BUDDY(node)) {
- PurpleBuddy *buddy = (PurpleBuddy *)node;
- CBPurpleAccount *account = accountLookup(purple_buddy_get_account(buddy));
+ if (PURPLE_BLIST_NODE_IS_BUDDY(node)) { + PurpleBuddy *buddy = (PurpleBuddy *)node; + CBPurpleAccount *account = accountLookup(purple_buddy_get_account(buddy)); + /* This will give us an alias we've set serverside (the "private server alias") if possible. + * Failing that, we will get an alias specified remotely (either by the server or by the buddy). + alias = purple_buddy_get_alias_only(buddy); + AILogWithSignature(@"%@ -> %s", contactLookupFromBuddy(buddy), alias); + [account updateContact:contactLookupFromBuddy(buddy) + toAlias:(alias ? [NSString stringWithUTF8String:alias] : nil)]; - /* This will give us an alias we've set serverside (the "private server alias") if possible.
- * Failing that, we will get an alias specified remotely (either by the server or by the buddy).
- alias = purple_buddy_get_alias_only(buddy);
- AILogWithSignature(@"%@ -> %s", contactLookupFromBuddy(buddy), alias);
- [account updateContact:contactLookupFromBuddy(buddy)
- toAlias:(alias ? [NSString stringWithUTF8String:alias] : nil)];
static NSDictionary *dictionaryFromHashTable(GHashTable *data)
@@ -295,54 +295,53 @@
static void chat_join_failed_cb(PurpleConnection *gc, GHashTable *components)
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- CBPurpleAccount *account = accountLookup(purple_connection_get_account(gc));
- NSDictionary *componentDict = dictionaryFromHashTable(components);
- for (AIChat *chat in adium.chatController.openChats) {
- if ((chat.account == account) &&
- [account chatCreationDictionary:chat.chatCreationDictionary isEqualToDictionary:componentDict]) {
- [account chatJoinDidFail:chat];
+ CBPurpleAccount *account = accountLookup(purple_connection_get_account(gc)); + NSDictionary *componentDict = dictionaryFromHashTable(components); + for (AIChat *chat in adium.chatController.openChats) { + if ((chat.account == account) && + [account chatCreationDictionary:chat.chatCreationDictionary isEqualToDictionary:componentDict]) { + [account chatJoinDidFail:chat];
static void typing_changed(PurpleAccount *account, const char *name, AITypingState typingState)
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- CBPurpleAccount *cbaccount = accountLookup(account);
- AIListContact *contact = contactLookupFromBuddy(purple_find_buddy(account, name));
- // Don't do anything for those who aren't on our contact list.
- if (contact.isStranger) {
+ CBPurpleAccount *cbaccount = accountLookup(account); + AIListContact *contact = contactLookupFromBuddy(purple_find_buddy(account, name)); + // Don't do anything for those who aren't on our contact list. + if (contact.isStranger) { + AIChat *chat = [adium.chatController existingChatWithContact:contact]; + if (typingState != AINotTyping && !chat) { + chat = [adium.chatController chatWithContact:contact]; + AILogWithSignature(@"Made a chat for %s: %i", name, typingState); + [cbaccount typingUpdateForIMChat:chat typing:[NSNumber numberWithInteger:typingState]];
- AIChat *chat = [adium.chatController existingChatWithContact:contact];
- if (typingState != AINotTyping && !chat) {
- chat = [adium.chatController chatWithContact:contact];
- AILogWithSignature(@"Made a chat for %s: %i", name, typingState);
- [cbaccount typingUpdateForIMChat:chat typing:[NSNumber numberWithInteger:typingState]];
static void conversation_created_cb(PurpleConversation *conv, void *data) {
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM) {
- AIChat *chat = imChatLookupFromConv(conv);
- //When a conversation is created, we must clear the typing flag, as libpurple won't notify us properly
- [accountLookup(purple_conversation_get_account(conv)) typingUpdateForIMChat:chat typing:[NSNumber numberWithInteger:AINotTyping]];
+ if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM) { + AIChat *chat = imChatLookupFromConv(conv); + //When a conversation is created, we must clear the typing flag, as libpurple won't notify us properly + [accountLookup(purple_conversation_get_account(conv)) typingUpdateForIMChat:chat typing:[NSNumber numberWithInteger:AINotTyping]];
/* The buddy-typing, buddy-typed, and buddy-typing-stopped signals will only be sent
@@ -368,124 +367,124 @@
chat_joined_cb(PurpleConversation *conv, void *data) {
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- //Pass chats along to the account
- if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) {
+ //Pass chats along to the account + if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) { + AIChat *chat = groupChatLookupFromConv(conv); + [accountLookup(purple_conversation_get_account(conv)) addChat:chat]; - AIChat *chat = groupChatLookupFromConv(conv);
- [accountLookup(purple_conversation_get_account(conv)) addChat:chat];
file_recv_request_cb(PurpleXfer *xfer)
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- ESFileTransfer *fileTransfer;
- //Purple doesn't return normalized user id, so it should be normalized manually
- char* who = g_strdup(purple_normalize(xfer->account, xfer->who));
- //Ask the account for an ESFileTransfer* object
- fileTransfer = [accountLookup(xfer->account) newFileTransferObjectWith:[NSString stringWithUTF8String:who]
- size:purple_xfer_get_size(xfer)
- remoteFilename:[NSString stringWithUTF8String:purple_xfer_get_filename(xfer)]];
- //Configure the new object for the transfer
- [fileTransfer setAccountData:[NSValue valueWithPointer:xfer]];
- xfer->ui_data = [fileTransfer retain];
- /* Set a fake local filename to convince libpurple that we are handling the request. We are, but
- * the code expects a synchronous response, and we rock out asynchronously.
- purple_xfer_set_local_filename(xfer, "");
- //Tell the account that we are ready to request the reception
- [accountLookup(purple_xfer_get_account(xfer)) requestReceiveOfFileTransfer:fileTransfer];
+ ESFileTransfer *fileTransfer; + //Purple doesn't return normalized user id, so it should be normalized manually + char* who = g_strdup(purple_normalize(xfer->account, xfer->who)); + //Ask the account for an ESFileTransfer* object + fileTransfer = [accountLookup(xfer->account) newFileTransferObjectWith:[NSString stringWithUTF8String:who] + size:purple_xfer_get_size(xfer) + remoteFilename:[NSString stringWithUTF8String:purple_xfer_get_filename(xfer)]]; + //Configure the new object for the transfer + [fileTransfer setAccountData:[NSValue valueWithPointer:xfer]]; + xfer->ui_data = (__bridge_retained void *)(fileTransfer); + /* Set a fake local filename to convince libpurple that we are handling the request. We are, but + * the code expects a synchronous response, and we rock out asynchronously. + purple_xfer_set_local_filename(xfer, ""); + //Tell the account that we are ready to request the reception + [accountLookup(purple_xfer_get_account(xfer)) requestReceiveOfFileTransfer:fileTransfer]; void configureAdiumPurpleSignals(void)
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- void *blist_handle = purple_blist_get_handle();
- void *handle = adium_purple_get_handle();
- purple_signal_connect(blist_handle, "buddy-idle-changed",
- handle, PURPLE_CALLBACK(buddy_idle_changed_cb),
- purple_signal_connect(blist_handle, "buddy-status-changed",
- handle, PURPLE_CALLBACK(buddy_status_changed_cb),
- purple_signal_connect(blist_handle, "buddy-icon-changed",
- handle, PURPLE_CALLBACK(buddy_event_cb),
- GINT_TO_POINTER(PURPLE_BUDDY_ICON));
- purple_signal_connect(blist_handle, "buddy-signed-on",
- handle, PURPLE_CALLBACK(buddy_event_cb),
- GINT_TO_POINTER(PURPLE_BUDDY_SIGNON));
- purple_signal_connect(blist_handle, "buddy-signed-off",
- handle, PURPLE_CALLBACK(buddy_event_cb),
- GINT_TO_POINTER(PURPLE_BUDDY_SIGNOFF));
- purple_signal_connect(blist_handle, "buddy-got-login-time",
- handle, PURPLE_CALLBACK(buddy_event_cb),
- GINT_TO_POINTER(PURPLE_BUDDY_SIGNON_TIME));
- purple_signal_connect(blist_handle, "buddy-got-login-time",
- handle, PURPLE_CALLBACK(buddy_event_cb),
- GINT_TO_POINTER(PURPLE_BUDDY_SIGNON_TIME));
- purple_signal_connect(blist_handle, "buddy-added",
- handle, PURPLE_CALLBACK(buddy_added_cb),
- purple_signal_connect(blist_handle, "buddy-removed",
- handle, PURPLE_CALLBACK(buddy_removed_cb),
- purple_signal_connect(blist_handle, "blist-node-aliased",
- handle, PURPLE_CALLBACK(node_aliased_cb),
- purple_signal_connect(purple_connections_get_handle(), "signed-on",
- handle, PURPLE_CALLBACK(connection_signed_on_cb),
- purple_signal_connect(purple_conversations_get_handle(), "conversation-created",
- handle, PURPLE_CALLBACK(conversation_created_cb),
- purple_signal_connect(purple_conversations_get_handle(), "chat-joined",
- handle, PURPLE_CALLBACK(chat_joined_cb),
- purple_signal_connect(purple_conversations_get_handle(), "chat-join-failed",
- handle, PURPLE_CALLBACK(chat_join_failed_cb),
- purple_signal_connect(purple_conversations_get_handle(), "buddy-typing",
- handle, PURPLE_CALLBACK(buddy_typing_cb), NULL);
- purple_signal_connect(purple_conversations_get_handle(), "buddy-typed",
- handle, PURPLE_CALLBACK(buddy_typed_cb), NULL);
- purple_signal_connect(purple_conversations_get_handle(), "buddy-typing-stopped",
- handle, PURPLE_CALLBACK(buddy_typing_stopped_cb), NULL);
- purple_signal_connect(purple_xfers_get_handle(), "file-recv-request",
- handle, PURPLE_CALLBACK(file_recv_request_cb), NULL);
+ void *blist_handle = purple_blist_get_handle(); + void *handle = adium_purple_get_handle(); + purple_signal_connect(blist_handle, "buddy-idle-changed", + handle, PURPLE_CALLBACK(buddy_idle_changed_cb), + purple_signal_connect(blist_handle, "buddy-status-changed", + handle, PURPLE_CALLBACK(buddy_status_changed_cb), + purple_signal_connect(blist_handle, "buddy-icon-changed", + handle, PURPLE_CALLBACK(buddy_event_cb), + GINT_TO_POINTER(PURPLE_BUDDY_ICON)); + purple_signal_connect(blist_handle, "buddy-signed-on", + handle, PURPLE_CALLBACK(buddy_event_cb), + GINT_TO_POINTER(PURPLE_BUDDY_SIGNON)); + purple_signal_connect(blist_handle, "buddy-signed-off", + handle, PURPLE_CALLBACK(buddy_event_cb), + GINT_TO_POINTER(PURPLE_BUDDY_SIGNOFF)); + purple_signal_connect(blist_handle, "buddy-got-login-time", + handle, PURPLE_CALLBACK(buddy_event_cb), + GINT_TO_POINTER(PURPLE_BUDDY_SIGNON_TIME)); + purple_signal_connect(blist_handle, "buddy-got-login-time", + handle, PURPLE_CALLBACK(buddy_event_cb), + GINT_TO_POINTER(PURPLE_BUDDY_SIGNON_TIME)); + purple_signal_connect(blist_handle, "buddy-added", + handle, PURPLE_CALLBACK(buddy_added_cb), + purple_signal_connect(blist_handle, "buddy-removed", + handle, PURPLE_CALLBACK(buddy_removed_cb), + purple_signal_connect(blist_handle, "blist-node-aliased", + handle, PURPLE_CALLBACK(node_aliased_cb), + purple_signal_connect(purple_connections_get_handle(), "signed-on", + handle, PURPLE_CALLBACK(connection_signed_on_cb), + purple_signal_connect(purple_conversations_get_handle(), "conversation-created", + handle, PURPLE_CALLBACK(conversation_created_cb), + purple_signal_connect(purple_conversations_get_handle(), "chat-joined", + handle, PURPLE_CALLBACK(chat_joined_cb), + purple_signal_connect(purple_conversations_get_handle(), "chat-join-failed", + handle, PURPLE_CALLBACK(chat_join_failed_cb), + purple_signal_connect(purple_conversations_get_handle(), "buddy-typing", + handle, PURPLE_CALLBACK(buddy_typing_cb), NULL); + purple_signal_connect(purple_conversations_get_handle(), "buddy-typed", + handle, PURPLE_CALLBACK(buddy_typed_cb), NULL); + purple_signal_connect(purple_conversations_get_handle(), "buddy-typing-stopped", + handle, PURPLE_CALLBACK(buddy_typing_stopped_cb), NULL); + purple_signal_connect(purple_xfers_get_handle(), "file-recv-request", + handle, PURPLE_CALLBACK(file_recv_request_cb), NULL); --- a/Plugins/Secure Messaging/ESSecureMessagingPlugin.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Secure Messaging/ESSecureMessagingPlugin.m Sun Sep 09 12:24:39 2012 -0400
@@ -64,11 +64,11 @@
//Muy imporatante: Set OTR as our encryption method
- [adium.contentController setEncryptor:[[[AdiumOTREncryption alloc] init] autorelease]];
+ [adium.contentController setEncryptor:[[AdiumOTREncryption alloc] init]]; _secureMessagingMenu = nil;
- lockImage_Locked = [[NSImage imageNamed:@"lock-locked" forClass:[self class]] retain];
- lockImage_Unlocked = [[NSImage imageNamed:@"lock-unlocked" forClass:[self class]] retain];
+ lockImage_Locked = [NSImage imageNamed:@"lock-locked" forClass:[self class]]; + lockImage_Unlocked = [NSImage imageNamed:@"lock-unlocked" forClass:[self class]]; [self registerToolbarItem];
[self configureMenuItems];
@@ -87,7 +87,7 @@
NSMenu *menu = [self _secureMessagingMenu];
//Add menu to toolbar item (for text mode)
- menuItem_encryption = [[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:AILocalizedString(@"Encryption", nil)
+ menuItem_encryption = [[NSMenuItem alloc] initWithTitle:AILocalizedString(@"Encryption", nil) action:@selector(dummyAction:)
@@ -120,7 +120,7 @@
//Register our toolbar item
NSToolbarItem *toolbarItem;
- button = [[[MVMenuButton alloc] initWithFrame:NSMakeRect(0,0,32,32)] autorelease];
+ button = [[MVMenuButton alloc] initWithFrame:NSMakeRect(0,0,32,32)]; [button setImage:lockImage_Locked];
toolbarItem = [AIToolbarUtilities toolbarItemWithIdentifier:@"Encryption"
@@ -162,7 +162,7 @@
[[item view] setMenu:menu];
//Add menu to toolbar item (for text mode)
- NSMenuItem *mItem = [[[NSMenuItem allocWithZone:[NSMenu menuZone]] init] autorelease];
+ NSMenuItem *mItem = [[NSMenuItem alloc] init]; [mItem setTitle:[menu title]];
[item setMenuFormRepresentation:mItem];
@@ -440,49 +440,49 @@
if (!_secureMessagingMenu) {
- _secureMessagingMenu = [[NSMenu allocWithZone:[NSMenu menuZone]] init];
+ _secureMessagingMenu = [[NSMenu alloc] init]; [_secureMessagingMenu setTitle:TITLE_ENCRYPTION];
- item = [[[NSMenuItem alloc] initWithTitle:TITLE_MAKE_SECURE
+ item = [[NSMenuItem alloc] initWithTitle:TITLE_MAKE_SECURE action:@selector(toggleSecureMessaging:)
- keyEquivalent:@""] autorelease];
[item setTag:AISecureMessagingMenu_Toggle];
[_secureMessagingMenu addItem:item];
- item = [[[NSMenuItem alloc] initWithTitle:TITLE_SHOW_DETAILS
+ item = [[NSMenuItem alloc] initWithTitle:TITLE_SHOW_DETAILS action:@selector(showDetails:)
- keyEquivalent:@""] autorelease];
[item setTag:AISecureMessagingMenu_ShowDetails];
[_secureMessagingMenu addItem:item];
- item = [[[NSMenuItem alloc] initWithTitle:TITLE_VERIFY
+ item = [[NSMenuItem alloc] initWithTitle:TITLE_VERIFY action:@selector(verify:)
- keyEquivalent:@""] autorelease];
[item setTag:AISecureMessagingMenu_Verify];
[_secureMessagingMenu addItem:item];
- item = [[[NSMenuItem alloc] initWithTitle:TITLE_ENCRYPTION_OPTIONS
+ item = [[NSMenuItem alloc] initWithTitle:TITLE_ENCRYPTION_OPTIONS - keyEquivalent:@""] autorelease];
[item setTag:AISecureMessagingMenu_Options];
[item setSubmenu:[adium.contentController encryptionMenuNotifyingTarget:self
[_secureMessagingMenu addItem:item];
[_secureMessagingMenu addItem:[NSMenuItem separatorItem]];
- item = [[[NSMenuItem alloc] initWithTitle:TITLE_ABOUT_ENCRYPTION
+ item = [[NSMenuItem alloc] initWithTitle:TITLE_ABOUT_ENCRYPTION action:@selector(showAbout:)
- keyEquivalent:@""] autorelease];
[item setTag:AISecureMessagingMenu_ShowAbout];
[_secureMessagingMenu addItem:item];
- return [[_secureMessagingMenu copy] autorelease];
+ return [_secureMessagingMenu copy]; - (void)dummyAction:(id)sender {};
--- a/Plugins/Send Message Contact Alert/ESSendMessageAlertDetailPane.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Send Message Contact Alert/ESSendMessageAlertDetailPane.m Sun Sep 09 12:24:39 2012 -0400
@@ -52,18 +52,18 @@
[button_useAnotherAccount setLocalizedString:AILocalizedString(@"Use another account if necessary",nil)];
- accountMenu = [[AIAccountMenu accountMenuWithDelegate:self
+ accountMenu = [AIAccountMenu accountMenuWithDelegate:self submenuType:AIAccountNoSubmenu
- showTitleVerbs:NO] retain];
[popUp_messageFrom setMenu:[accountMenu menu]];
- [toContact release]; toContact = nil;
- [accountMenu release]; accountMenu = nil;
- [contactMenu release]; contactMenu = nil;
//Configure for the action
@@ -79,7 +79,7 @@
if (!destObject) destObject = inObject;
//Configure the destination menu
- contactMenu = [[AIContactMenu contactMenuWithDelegate:self forContactsInObject:nil] retain];
+ contactMenu = [AIContactMenu contactMenuWithDelegate:self forContactsInObject:nil]; if (destObject && [destObject isKindOfClass:[AIListContact class]]) {
[self setDestinationContact:(AIListContact *)destObject];
@@ -138,7 +138,7 @@
NSMenuItem *firstMenuItem;
AIAccount *preferredAccount;
- [toContact release]; toContact = [inContact retain];
//NSPopUpButton doesn't handle submenus well at all. We put a blank menu item at the top of our
//menu when we created it. We can now change its attributes to affect the way the unclicked button
--- a/Plugins/Send Message Contact Alert/ESSendMessageContactAlertPlugin.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Send Message Contact Alert/ESSendMessageContactAlertPlugin.m Sun Sep 09 12:24:39 2012 -0400
@@ -42,12 +42,6 @@
//Send Message Alert -----------------------------------------------------------------------------------------------------
#pragma mark Send Message Alert
- (NSString *)shortDescriptionForActionID:(NSString *)actionID
--- a/Plugins/Status Menu Item/AIStatusItemView.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Status Menu Item/AIStatusItemView.h Sun Sep 09 12:24:39 2012 -0400
@@ -17,15 +17,15 @@
#import "AIImageTextCellView.h"
@interface AIStatusItemView : AIImageTextCellView {
- NSStatusItem *statusItem;
+ __weak NSStatusItem *statusItem;
+ __unsafe_unretained NSMenu *menu; + __unsafe_unretained NSMenu *alternateMenu; @property(readonly) NSUInteger desiredWidth;
@@ -34,9 +34,9 @@
@property(copy) NSImage *alternateImage;
//These are by retain in case you want to set a delegate for the menu.
-@property(retain) NSMenu *menu;
-@property(retain) NSMenu *alternateMenu;
+@property(assign) NSMenu *menu; +@property(assign) NSMenu *alternateMenu; -@property(assign) NSStatusItem *statusItem;
+@property(weak) NSStatusItem *statusItem; --- a/Plugins/Status Menu Item/AIStatusItemView.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Status Menu Item/AIStatusItemView.m Sun Sep 09 12:24:39 2012 -0400
@@ -35,17 +35,6 @@
- [regularImage release];
- [alternateImage release];
- [alternateMenu release];
- (void)drawRect:(NSRect)rect
@@ -122,7 +111,6 @@
- (void)setRegularImage:(NSImage *)image
- [regularImage release];
regularImage = [image copy];
@@ -148,7 +136,6 @@
- (void)setAlternateImage:(NSImage *)image
- [alternateImage release];
alternateImage = [image copy];
--- a/Plugins/Status Menu Item/CBStatusMenuItemController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Status Menu Item/CBStatusMenuItemController.m Sun Sep 09 12:24:39 2012 -0400
@@ -35,6 +35,7 @@
#import <Adium/AIContactHidingController.h>
#import <AIUtilities/AIColorAdditions.h>
#import <AIUtilities/AIStringAdditions.h>
// For the KEY_SHOW_OFFLINE_CONTACTS and PREF_GROUP_CONTACT_LIST_DISPLAY
#import "AIContactController.h"
#import "AIInterfaceController.h"
@@ -54,7 +55,7 @@
- (void)activateAccountList:(id)sender;
- (void)disableStatusItem:(id)sender;
-@property (nonatomic, retain) NSMenuItem *contactsMenuItem;
+@property (nonatomic, strong) NSMenuItem *contactsMenuItem; @implementation CBStatusMenuItemController
@@ -63,14 +64,14 @@
+ (CBStatusMenuItemController *)statusMenuItemController
- return [[[self alloc] init] autorelease];
+ return [[self alloc] init]; if ((self = [super init])) {
//Create and set up the status item
- statusItem = [[[NSStatusBar systemStatusBar] statusItemWithLength:25] retain];
+ statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:25]; statusItemView = [[AIStatusItemView alloc] initWithFrame:NSMakeRect(0,0,25,22)];
statusItemView.statusItem = statusItem;
@@ -98,10 +99,10 @@
accountsMenuNeedsUpdate = YES;
optionsMenuNeedsUpdate = YES;
- self.contactsMenuItem = [[[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:AILocalizedString(@"Contacts",nil)
+ self.contactsMenuItem = [[NSMenuItem alloc] initWithTitle:AILocalizedString(@"Contacts",nil) - keyEquivalent:@""] autorelease];
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
//Register to recieve chat opened and chat closed notifications
@@ -154,16 +155,16 @@
//Register ourself for the status menu items
- statusMenu = [[AIStatusMenu statusMenuWithDelegate:self] retain];
+ statusMenu = [AIStatusMenu statusMenuWithDelegate:self]; - accountMenu = [[AIAccountMenu accountMenuWithDelegate:self
+ accountMenu = [AIAccountMenu accountMenuWithDelegate:self submenuType:AIAccountStatusSubmenu
- showTitleVerbs:YES] retain];
- contactMenu = [[AIContactMenu contactMenuWithDelegate:self
- forContactsInObject:nil] retain];
+ contactMenu = [AIContactMenu contactMenuWithDelegate:self + forContactsInObject:nil]; @@ -182,31 +183,22 @@
[[statusItem statusBar] removeStatusItem:statusItem];
- [statusItemView release];
// All the temporary NSMutableArrays we store
- [accountMenuItemsArray release];
- [stateMenuItemsArray release];
- [openChatsArray release];
- [mainAccountsMenu release];
- [mainOptionsMenu release];
// Release our various menus.
- [accountMenu setDelegate:nil]; [accountMenu release];
- [contactMenu setDelegate:nil]; [contactMenu release];
- [statusMenu setDelegate:nil]; [statusMenu release];
+ [accountMenu setDelegate:nil]; + [contactMenu setDelegate:nil]; + [statusMenu setDelegate:nil]; // Release our AIMenuBarIcons bundle
// Can't release this because it causes a crash on quit. rdar://4139755, rdar://4160625, and #743. --boredzo
//To the superclass, Robin!
@@ -246,7 +238,6 @@
resourceFolderName:RESOURCE_MENU_BAR_ICONS];
menuIcons = [[AIMenuBarIcons alloc] initWithURL:[NSURL fileURLWithPath:menuIconPath]];
@@ -294,7 +285,7 @@
currentlyIgnoringUnviewed = NO;
[unviewedContentFlash invalidate];
- [unviewedContentFlash release]; unviewedContentFlash = nil;
+ unviewedContentFlash = nil; #define IMAGE_TYPE_CONTENT @"Content"
@@ -408,7 +399,7 @@
NSImage *image = duckImage;
- image = [[duckImage copy] autorelease];
+ image = [duckImage copy]; @@ -461,8 +452,7 @@
mainMenuNeedsUpdate = YES;
- [accountMenuItemsArray release];
- accountMenuItemsArray = [menuItems retain];
+ accountMenuItemsArray = menuItems; //We need to update next time we're clicked
accountsMenuNeedsUpdate = YES;
@@ -481,8 +471,7 @@
- (void)statusMenu:(AIStatusMenu *)inStatusMenu didRebuildStatusMenuItems:(NSArray *)menuItemArray
- [stateMenuItemsArray release];
- stateMenuItemsArray = [menuItemArray retain];
+ stateMenuItemsArray = menuItemArray; //We need to update next time we're clicked
mainMenuNeedsUpdate = YES;
@@ -619,19 +608,17 @@
NSUInteger unviewedContentCount = [adium.chatController unviewedContentCount];
- [openChatsArray release];
- openChatsArray = [[adium.interfaceController openChats] retain];
+ openChatsArray = [adium.interfaceController openChats]; // We think there's unviewed content, but there's not.
if (unviewedContent && unviewedContentCount == 0) {
// Invalidate and release the unviewed content flash timer
[unviewedContentFlash invalidate];
- [unviewedContentFlash release]; unviewedContentFlash = nil;
+ unviewedContentFlash = nil; currentlyIgnoringUnviewed = NO;
// Update unviewed content
@@ -644,11 +631,11 @@
// If this particular Xtra wants us to flash unviewed content, start the timer up
currentlyIgnoringUnviewed = NO;
- unviewedContentFlash = [[NSTimer scheduledTimerWithTimeInterval:1.0
+ unviewedContentFlash = [NSTimer scheduledTimerWithTimeInterval:1.0 selector:@selector(updateUnviewedContentFlash:)
// Update unviewed content
@@ -661,9 +648,7 @@
[self updateUnreadCount];
- mainMenuNeedsUpdate = YES;
+ mainMenuNeedsUpdate = YES; #pragma mark Menu Delegates/Actions
@@ -695,23 +680,21 @@
// If there's more than one account, show the accounts menu
if ([accountMenuItemsArray count] > 1) {
- menuItem = [[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:AILocalizedString(@"Accounts",nil)
+ menuItem = [[NSMenuItem alloc] initWithTitle:AILocalizedString(@"Accounts",nil) [menuItem setSubmenu:mainAccountsMenu];
- menuItem = [[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:AILocalizedString(@"Options",nil)
+ menuItem = [[NSMenuItem alloc] initWithTitle:AILocalizedString(@"Options",nil) [menuItem setSubmenu:mainOptionsMenu];
[menu addItem:[NSMenuItem separatorItem]];
@@ -735,7 +718,7 @@
for (AIChat *chat in openChatsArray) {
//Create a menu item from the chat
- menuItem = [[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:chat.displayName
+ menuItem = [[NSMenuItem alloc] initWithTitle:chat.displayName action:@selector(switchToChat:)
@@ -755,7 +738,6 @@
--- a/Plugins/Status Menu Item/CBStatusMenuItemPlugin.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Status Menu Item/CBStatusMenuItemPlugin.m Sun Sep 09 12:24:39 2012 -0400
@@ -52,7 +52,7 @@
[adium.preferenceController unregisterPreferenceObserver:self];
- [itemController release]; itemController = nil;
- (void)preferencesChangedForGroup:(NSString *)group
@@ -64,12 +64,12 @@
if ([[prefDict objectForKey:KEY_STATUS_MENU_ITEM_ENABLED] boolValue]) {
//If it hasn't been created yet, create it. It will be created visible.
- itemController = [[CBStatusMenuItemController statusMenuItemController] retain];
+ itemController = [CBStatusMenuItemController statusMenuItemController]; // NSTimer retains its target, so we need to invalidate any timers the controller has going on.
[itemController invalidateTimers];
- [itemController autorelease]; itemController = nil;
--- a/Plugins/Twitter Plugin/AILaconicaAccount.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Twitter Plugin/AILaconicaAccount.m Sun Sep 09 12:24:39 2012 -0400
@@ -153,15 +153,15 @@
NSString *path = [[@"/" stringByAppendingPathComponent:self.apiPath]
stringByAppendingPathComponent:@"statusnet/config.xml"];
- NSURL *url = [[[NSURL alloc] initWithScheme:(self.useSSL ? @"https" : @"http")
+ NSURL *url = [[NSURL alloc] initWithScheme:(self.useSSL ? @"https" : @"http") - path:path] autorelease];
NSURLRequest *configRequest = [NSURLRequest requestWithURL:url];
if (textLimitConfigDownload) {
[textLimitConfigDownload cancel];
- [textLimitConfigDownload release]; textLimitConfigDownload = nil;
+ textLimitConfigDownload = nil; textLimitConfigDownload = [[NSURLConnection alloc] initWithRequest:configRequest delegate:self];
@@ -195,11 +195,10 @@
- AILogWithSignature(@"Failed fetching StatusNet server config for %@: %d %@", self.host, [err code], [err localizedDescription]);
+ AILogWithSignature(@"Failed fetching StatusNet server config for %@: %ld %@", self.host, [err code], [err localizedDescription]); - [configData release]; configData = nil;
- [textLimitConfigDownload release]; textLimitConfigDownload = nil;
+ textLimitConfigDownload = nil; @@ -208,9 +207,9 @@
-(void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error
- [textLimitConfigDownload release]; textLimitConfigDownload = nil;
+ textLimitConfigDownload = nil; - [configData release]; configData = nil;
AILogWithSignature(@"%@",[NSString stringWithFormat:@"Fetch failed: %@", [error localizedDescription]]);
@@ -261,9 +260,7 @@
NSMutableCharacterSet *disallowedCharacters = [[NSCharacterSet punctuationCharacterSet] mutableCopy];
[disallowedCharacters formUnionWithCharacterSet:[NSCharacterSet whitespaceCharacterSet]];
- groupCharacters = [[disallowedCharacters invertedSet] retain];
- [disallowedCharacters release];
+ groupCharacters = [disallowedCharacters invertedSet]; attributedString = [AITwitterURLParser linkifiedStringFromAttributedString:attributedString
--- a/Plugins/Twitter Plugin/AITwitterAccount.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Twitter Plugin/AITwitterAccount.h Sun Sep 09 12:24:39 2012 -0400
@@ -164,23 +164,23 @@
NSMutableDictionary *pendingRequests;
-@property (readonly, nonatomic) NSString *timelineChatName;
-@property (readonly, nonatomic) NSString *timelineGroupName;
-@property (readonly, nonatomic) NSString *apiPath;
-@property (readonly, nonatomic) NSString *sourceToken;
-@property (readonly, nonatomic) NSString *defaultServer;
+@property (weak, readonly, nonatomic) NSString *timelineChatName; +@property (weak, readonly, nonatomic) NSString *timelineGroupName; +@property (weak, readonly, nonatomic) NSString *apiPath; +@property (weak, readonly, nonatomic) NSString *sourceToken; +@property (weak, readonly, nonatomic) NSString *defaultServer; @property (readonly, nonatomic) int maxChars;
@property (readonly, nonatomic) BOOL useSSL;
@property (readonly, nonatomic) BOOL useOAuth;
@property (readonly, nonatomic) BOOL supportsCursors;
-@property (readonly, nonatomic) NSString *consumerKey;
-@property (readonly, nonatomic) NSString *secretKey;
-@property (readonly, nonatomic) NSString *tokenRequestURL;
-@property (readonly, nonatomic) NSString *tokenAccessURL;
-@property (readonly, nonatomic) NSString *tokenAuthorizeURL;
+@property (weak, readonly, nonatomic) NSString *consumerKey; +@property (weak, readonly, nonatomic) NSString *secretKey; +@property (weak, readonly, nonatomic) NSString *tokenRequestURL; +@property (weak, readonly, nonatomic) NSString *tokenAccessURL; +@property (weak, readonly, nonatomic) NSString *tokenAuthorizeURL; -@property (readonly, nonatomic) AIChat *timelineChat;
+@property (weak, readonly, nonatomic) AIChat *timelineChat; - (NSString *)errorMessageForError:(NSError *)error;
--- a/Plugins/Twitter Plugin/AITwitterAccount.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Twitter Plugin/AITwitterAccount.m Sun Sep 09 12:24:39 2012 -0400
@@ -121,14 +121,6 @@
[[NSNotificationCenter defaultCenter] removeObserver:self];
[adium.preferenceController unregisterPreferenceObserver:self];
- [twitterEngine release];
- [pendingRequests release];
- [queuedUpdates release];
- [queuedOutgoingDM release];
@@ -154,8 +146,6 @@
- [twitterEngine release];
twitterEngine = [[MGTwitterEngine alloc] initWithDelegate:self];
[twitterEngine setClientName:@"Adium"
@@ -188,8 +178,8 @@
twitterEngine.useOAuth = YES;
- OAToken *token = [[[OAToken alloc] initWithHTTPResponseBody:self.passwordWhileConnected] autorelease];
- OAConsumer *consumer = [[[OAConsumer alloc] initWithKey:self.consumerKey secret:self.secretKey] autorelease];
+ OAToken *token = [[OAToken alloc] initWithHTTPResponseBody:self.passwordWhileConnected]; + OAConsumer *consumer = [[OAConsumer alloc] initWithKey:self.consumerKey secret:self.secretKey]; twitterEngine.accessToken = token;
twitterEngine.consumer = consumer;
@@ -243,7 +233,7 @@
- AILog(@"%@ Timeline bookmark is nil! Tried checking for existing bookmark for chat name %@, and creating a bookmark for chat %@ in group %@",
+ AILog(@"Timeline bookmark is nil! Tried checking for existing bookmark for chat name %@, and creating a bookmark for chat %@ in group %@", self.timelineChatName, newTimelineChat,
[adium.contactController groupWithUID:self.timelineGroupName]);
@@ -272,7 +262,7 @@
- [twitterEngine release]; twitterEngine = nil;
[updateTimer invalidate]; updateTimer = nil;
@@ -452,7 +442,7 @@
* @brief For an invalid password, fail but don't try and reconnect or report it. We do it ourself.
-- (AIReconnectDelayType)shouldAttemptReconnectAfterDisconnectionError:(NSString **)disconnectionError
+- (AIReconnectDelayType)shouldAttemptReconnectAfterDisconnectionError:(NSString * __strong *)disconnectionError AIReconnectDelayType reconnectDelayType = [super shouldAttemptReconnectAfterDisconnectionError:disconnectionError];
@@ -671,27 +661,27 @@
- menuItem = [[[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:[NSString stringWithFormat:AILocalizedString(@"Open %@'s user page",nil), inContact.UID]
+ menuItem = [[NSMenuItem alloc] initWithTitle:[NSString stringWithFormat:AILocalizedString(@"Open %@'s user page",nil), inContact.UID] action:@selector(openUserPage:)
- keyEquivalent:@""] autorelease];
[menuItem setImage:serviceIcon];
[menuItem setRepresentedObject:inContact];
[menuItemArray addObject:menuItem];
- menuItem = [[[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:[NSString stringWithFormat:AILocalizedString(@"Enable device notifications for %@", "Enable sending Twitter notifications to your phone (device)"), inContact.UID]
+ menuItem = [[NSMenuItem alloc] initWithTitle:[NSString stringWithFormat:AILocalizedString(@"Enable device notifications for %@", "Enable sending Twitter notifications to your phone (device)"), inContact.UID] action:@selector(enableOrDisableNotifications:)
- keyEquivalent:@""] autorelease];
[menuItem setImage:serviceIcon];
[menuItem setRepresentedObject:inContact];
[menuItemArray addObject:menuItem];
- menuItem = [[[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:[NSString stringWithFormat:AILocalizedString(@"Disable device notifications for %@", "Disable sending Twitter notifications to your phone"), inContact.UID]
+ menuItem = [[NSMenuItem alloc] initWithTitle:[NSString stringWithFormat:AILocalizedString(@"Disable device notifications for %@", "Disable sending Twitter notifications to your phone"), inContact.UID] action:@selector(enableOrDisableNotifications:)
- keyEquivalent:@""] autorelease];
[menuItem setImage:serviceIcon];
[menuItem setRepresentedObject:inContact];
@@ -778,17 +768,17 @@
- menuItem = [[[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:AILocalizedString(@"Update Tweets",nil)
+ menuItem = [[NSMenuItem alloc] initWithTitle:AILocalizedString(@"Update Tweets",nil) action:@selector(periodicUpdate)
- keyEquivalent:@""] autorelease];
[menuItem setImage:serviceIcon];
[menuItemArray addObject:menuItem];
- menuItem = [[[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:AILocalizedString(@"Reply to a Tweet",nil)
+ menuItem = [[NSMenuItem alloc] initWithTitle:AILocalizedString(@"Reply to a Tweet",nil) action:@selector(replyToTweet)
- keyEquivalent:@""] autorelease];
[menuItem setImage:serviceIcon];
[menuItemArray addObject:menuItem];
@@ -808,22 +798,22 @@
- menuItem = [[[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:AILocalizedString(@"Update Tweets",nil)
+ menuItem = [[NSMenuItem alloc] initWithTitle:AILocalizedString(@"Update Tweets",nil) action:@selector(periodicUpdate)
- keyEquivalent:@""] autorelease];
[menuItemArray addObject:menuItem];
- menuItem = [[[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:AILocalizedString(@"Reply to a Tweet",nil)
+ menuItem = [[NSMenuItem alloc] initWithTitle:AILocalizedString(@"Reply to a Tweet",nil) action:@selector(replyToTweet)
- keyEquivalent:@""] autorelease];
[menuItemArray addObject:menuItem];
- menuItem = [[[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:AILocalizedString(@"Get Rate Limit Amount",nil)
+ menuItem = [[NSMenuItem alloc] initWithTitle:AILocalizedString(@"Get Rate Limit Amount",nil) action:@selector(getRateLimitAmount)
- keyEquivalent:@""] autorelease];
[menuItemArray addObject:menuItem];
@@ -1150,7 +1140,7 @@
if (pendingUpdateCount) {
- AILogWithSignature(@"%@ Update already in progress. Count = %d", self, pendingUpdateCount);
+ AILogWithSignature(@"%@ Update already in progress. Count = %ld", self, pendingUpdateCount); @@ -1413,7 +1403,7 @@
url, NSLinkAttributeName,
className, AIElementClassAttributeName, nil];
- return [[[NSAttributedString alloc] initWithString:label attributes:attributes] autorelease];
+ return [[NSAttributedString alloc] initWithString:label attributes:attributes]; @@ -1427,7 +1417,7 @@
static NSCharacterSet *hashCharacters = nil;
if (!usernameCharacters) {
- usernameCharacters = [[NSCharacterSet characterSetWithCharactersInString:@"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_"] retain];
+ usernameCharacters = [NSCharacterSet characterSetWithCharactersInString:@"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_"]; @@ -1435,9 +1425,8 @@
[disallowedCharacters formUnionWithCharacterSet:[NSCharacterSet whitespaceCharacterSet]];
[disallowedCharacters removeCharactersInString:@"_"];
- hashCharacters = [[disallowedCharacters invertedSet] retain];
+ hashCharacters = [disallowedCharacters invertedSet]; - [disallowedCharacters release];
attributedString = [AITwitterURLParser linkifiedStringFromAttributedString:inString
@@ -1474,7 +1463,7 @@
BOOL tweetLink = (tweetID.length && userID.length);
if (replyTweet || tweetLink) {
- NSMutableAttributedString *mutableMessage = [[message mutableCopy] autorelease];
+ NSMutableAttributedString *mutableMessage = [message mutableCopy]; NSUInteger startIndex = message.length;
@@ -1628,7 +1617,7 @@
message = [self linkifiedAttributedStringFromString:message];
- NSMutableAttributedString *mutableMessage = [[message mutableCopy] autorelease];
+ NSMutableAttributedString *mutableMessage = [message mutableCopy]; NSUInteger startIndex = message.length;
@@ -1695,7 +1684,7 @@
- return [mutableArray autorelease];
@@ -1710,7 +1699,7 @@
- AILogWithSignature(@"%@ Displaying %d updates", self, queuedUpdates.count);
+ AILogWithSignature(@"%@ Displaying %ld updates", self, queuedUpdates.count); // Sort the queued updates (since we're intermingling pages of data from different souces)
NSArray *sortedQueuedUpdates = [queuedUpdates sortedArrayUsingFunction:queuedUpdatesSort context:nil];
@@ -1777,13 +1766,13 @@
[queuedUpdates removeAllObjects];
} else if (requestType == AITwitterUpdateDirectMessage || requestType == AITwitterDirectMessageSend) {
- NSMutableArray **unsortedArray = (requestType == AITwitterUpdateDirectMessage) ? &queuedDM : &queuedOutgoingDM;
+ NSMutableArray * __strong *unsortedArray = (requestType == AITwitterUpdateDirectMessage) ? &queuedDM : &queuedOutgoingDM; if (!(*unsortedArray).count) {
- AILogWithSignature(@"%@ Displaying %d DMs", self, queuedDM.count);
+ AILogWithSignature(@"%@ Displaying %ld DMs", self, queuedDM.count); NSArray *sortedQueuedDM = [*unsortedArray sortedArrayUsingFunction:queuedDMSort context:nil];
@@ -2140,10 +2129,10 @@
if([self requestTypeForRequestID:identifier] == AITwitterUpdateFollowedTimeline) {
followedTimelineCompleted = YES;
- futureTimelineLastID = [largestTweet retain];
+ futureTimelineLastID = largestTweet; } else if ([self requestTypeForRequestID:identifier] == AITwitterUpdateReplies) {
- futureRepliesLastID = [largestTweet retain];
+ futureRepliesLastID = largestTweet; @@ -2160,7 +2149,7 @@
forKey:TWITTER_PREFERENCE_REPLIES_LAST_ID
group:TWITTER_PREFERENCE_GROUP_UPDATES];
- [futureRepliesLastID release]; futureRepliesLastID = nil;
+ futureRepliesLastID = nil; if(futureTimelineLastID) {
@@ -2170,7 +2159,7 @@
forKey:TWITTER_PREFERENCE_TIMELINE_LAST_ID
group:TWITTER_PREFERENCE_GROUP_UPDATES];
- [futureTimelineLastID release]; futureTimelineLastID = nil;
+ futureTimelineLastID = nil; [self displayQueuedUpdatesForRequestType:[self requestTypeForRequestID:identifier]];
@@ -2186,7 +2175,7 @@
} else if ([self requestTypeForRequestID:identifier] == AITwitterProfileStatusUpdates) {
AIListContact *listContact = [[self dictionaryForRequestID:identifier] objectForKey:@"ListContact"];
- NSMutableArray *profileArray = [[[listContact profileArray] mutableCopy] autorelease];
+ NSMutableArray *profileArray = [[listContact profileArray] mutableCopy]; AILogWithSignature(@"%@ Updating statuses for profile, user %@", self, listContact);
@@ -2383,7 +2372,7 @@
- AILogWithSignature(@"%@ User info pull, Users count: %d", self, users.count);
+ AILogWithSignature(@"%@ User info pull, Users count: %ld", self, users.count); for (NSDictionary *user in users) {
--- a/Plugins/Twitter Plugin/AITwitterAccountOAuthSetup.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Twitter Plugin/AITwitterAccountOAuthSetup.h Sun Sep 09 12:24:39 2012 -0400
@@ -36,13 +36,13 @@
+ __unsafe_unretained NSString *verifier; - (id)initWithDelegate:(id <AITwitterAccountOAuthSetupDelegate>)inDelegate
forAccount:(AITwitterAccount *)inAccount;
-@property (retain, nonatomic) NSString *verifier;
+@property (assign, nonatomic) NSString *verifier; - (void)fetchAccessToken;
--- a/Plugins/Twitter Plugin/AITwitterAccountOAuthSetup.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Twitter Plugin/AITwitterAccountOAuthSetup.m Sun Sep 09 12:24:39 2012 -0400
@@ -33,19 +33,10 @@
if ((self = [super init])) {
- account = [inAccount retain];
- [requestToken release];
@@ -72,7 +63,6 @@
didFailSelector:@selector(requestTokenTicket:didFailWithError:)];
@@ -106,14 +96,13 @@
didFailSelector:@selector(accessTokenTicket:didFailWithError:)];
#pragma mark Request token processing
- (void)requestTokenTicket:(OAServiceTicket *)ticket didFinishWithData:(NSData *)data {
- NSString *responseBody = [[[NSString alloc] initWithData:data
- encoding:NSUTF8StringEncoding] autorelease];
+ NSString *responseBody = [[NSString alloc] initWithData:data + encoding:NSUTF8StringEncoding]; requestToken = [[OAToken alloc] initWithHTTPResponseBody:responseBody];
@@ -135,8 +124,8 @@
#pragma mark Access token processing
- (void)accessTokenTicket:(OAServiceTicket *)ticket didFinishWithData:(NSData *)data {
- NSString *responseBody = [[[NSString alloc] initWithData:data
- encoding:NSUTF8StringEncoding] autorelease];
+ NSString *responseBody = [[NSString alloc] initWithData:data + encoding:NSUTF8StringEncoding]; OAToken *accessToken = [[OAToken alloc] initWithHTTPResponseBody:responseBody];
@@ -145,7 +134,6 @@
responseBody:responseBody];
[delegate OAuthSetup:self changedToStep:AIOAuthStepFailure withToken:nil responseBody:nil];
AILogWithSignature(@"%@ failure in access token", account);
--- a/Plugins/Twitter Plugin/AITwitterAccountViewController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Twitter Plugin/AITwitterAccountViewController.m Sun Sep 09 12:24:39 2012 -0400
@@ -48,7 +48,7 @@
- NSMenu *intervalMenu = [[[NSMenu alloc] init] autorelease];
+ NSMenu *intervalMenu = [[NSMenu alloc] init]; [intervalMenu addItemWithTitle:AILocalizedString(@"never", "Update tweets: never")
@@ -101,8 +101,7 @@
- [OAuthSetup release]; OAuthSetup = nil;
@@ -121,7 +120,6 @@
[OAuthSetup fetchAccessToken];
OAuthSetup = [[AITwitterAccountOAuthSetup alloc] initWithDelegate:self
forAccount:(AITwitterAccount *)account];
@@ -213,7 +211,7 @@
[super saveConfiguration];
- [OAuthSetup release]; OAuthSetup = nil;
[account setPreference:popUp_updateInterval.selectedItem.representedObject
forKey:TWITTER_PREFERENCE_UPDATE_INTERVAL
@@ -342,7 +340,7 @@
- (void)completedOAuthSetup
- [OAuthSetup release]; OAuthSetup = nil;
OAuthSetupStep = AIOAuthStepFailure;
--- a/Plugins/Twitter Plugin/AITwitterActionsHTMLFilter.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Twitter Plugin/AITwitterActionsHTMLFilter.m Sun Sep 09 12:24:39 2012 -0400
@@ -64,7 +64,7 @@
options:NSBackwardsSearch
range:NSMakeRange(mutableHTML.length - 1, 1)];
- return [mutableHTML autorelease];
--- a/Plugins/Twitter Plugin/AITwitterReplyWindowController.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Twitter Plugin/AITwitterReplyWindowController.h Sun Sep 09 12:24:39 2012 -0400
@@ -27,7 +27,7 @@
IBOutlet NSButton *button_reply;
IBOutlet NSButton *button_cancel;
+ AIAccount *__weak account; + (void)showReplyWindowForAccount:(AIAccount *)inAccount;
@@ -35,6 +35,6 @@
- (IBAction)reply:(id)sender;
- (IBAction)cancel:(id)sender;
-@property (nonatomic, retain) AIAccount *account;
+@property (weak, nonatomic) AIAccount *account; --- a/Plugins/Twitter Plugin/AITwitterReplyWindowController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Twitter Plugin/AITwitterReplyWindowController.m Sun Sep 09 12:24:39 2012 -0400
@@ -60,18 +60,11 @@
- (void)windowWillClose:(id)sender
[super windowWillClose:sender];
- [sharedController autorelease]; sharedController = nil;
+ sharedController = nil; --- a/Plugins/Twitter Plugin/AITwitterStatusFollowup.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Twitter Plugin/AITwitterStatusFollowup.m Sun Sep 09 12:24:39 2012 -0400
@@ -51,13 +51,6 @@
[[NSNotificationCenter defaultCenter] removeObserver:self];
- (void)imageAdded:(NSNotification *)notification
NSDictionary *trim = notification.object;
--- a/Plugins/Twitter Plugin/AITwitterURLHandler.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Twitter Plugin/AITwitterURLHandler.m Sun Sep 09 12:24:39 2012 -0400
@@ -140,11 +140,11 @@
if (![textView.string hasPrefix:prefix]) {
NSMutableAttributedString *newString;
if (textView.attributedString.length > 0){
- newString = [[[textView.attributedString attributedSubstringFromRange:NSMakeRange(0, 1)] mutableCopy] autorelease];
+ newString = [[textView.attributedString attributedSubstringFromRange:NSMakeRange(0, 1)] mutableCopy]; [newString replaceCharactersInRange:NSMakeRange(0, 1) withString:prefix];
- newString = [[[NSMutableAttributedString alloc] initWithString:prefix attributes:[adium.contentController defaultFormattingAttributes]] autorelease];
+ newString = [[NSMutableAttributedString alloc] initWithString:prefix attributes:[adium.contentController defaultFormattingAttributes]]; [newString appendAttributedString:textView.attributedString];
[textView setAttributedString:newString];
--- a/Plugins/Twitter Plugin/AITwitterURLParser.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Twitter Plugin/AITwitterURLParser.m Sun Sep 09 12:24:39 2012 -0400
@@ -82,7 +82,7 @@
- return [newString autorelease];
--- a/Plugins/Twitter Plugin/MGTwitterEngine/MGTwitterEngine.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Twitter Plugin/MGTwitterEngine/MGTwitterEngine.h Sun Sep 09 12:24:39 2012 -0400
@@ -137,6 +137,6 @@
@property (readwrite, nonatomic) BOOL useOAuth;
-@property (readwrite, nonatomic, retain) OAConsumer *consumer;
-@property (readwrite, nonatomic, retain) OAToken *accessToken;
+@property (readwrite, nonatomic) OAConsumer *consumer; +@property (readwrite, nonatomic) OAToken *accessToken; --- a/Plugins/Twitter Plugin/MGTwitterEngine/MGTwitterEngine.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Twitter Plugin/MGTwitterEngine/MGTwitterEngine.m Sun Sep 09 12:24:39 2012 -0400
@@ -68,7 +68,7 @@
+ (MGTwitterEngine *)twitterEngineWithDelegate:(NSObject *)theDelegate
- return [[[MGTwitterEngine alloc] initWithDelegate:theDelegate] autorelease];
+ return [[MGTwitterEngine alloc] initWithDelegate:theDelegate]; @@ -77,11 +77,11 @@
if ((self = [super init])) {
_delegate = newDelegate; // deliberately weak reference
_connections = [[NSMutableDictionary alloc] initWithCapacity:0];
- _clientName = [DEFAULT_CLIENT_NAME retain];
- _clientVersion = [DEFAULT_CLIENT_VERSION retain];
- _clientURL = [DEFAULT_CLIENT_URL retain];
- _clientSourceToken = [DEFAULT_CLIENT_TOKEN retain];
- _APIDomain = [TWITTER_DOMAIN retain];
+ _clientName = DEFAULT_CLIENT_NAME; + _clientVersion = DEFAULT_CLIENT_VERSION; + _clientURL = DEFAULT_CLIENT_URL; + _clientSourceToken = DEFAULT_CLIENT_TOKEN; + _APIDomain = TWITTER_DOMAIN; @@ -95,20 +95,6 @@
[[_connections allValues] makeObjectsPerformSelector:@selector(cancel)];
- [_connections release];
- [_accessToken release];
- [_clientVersion release];
- [_clientSourceToken release];
@@ -132,23 +118,21 @@
- return [[_username retain] autorelease];
- return [[_password retain] autorelease];
- (void)setUsername:(NSString *)newUsername password:(NSString *)newPassword
- _username = [newUsername retain];
- _password = [newPassword retain];
+ _username = newUsername; + _password = newPassword; if ([self clearsCookies]) {
// Remove all cookies for twitter, to ensure next connection uses new credentials.
@@ -169,54 +153,49 @@
- return [[_clientName retain] autorelease];
- (NSString *)clientVersion
- return [[_clientVersion retain] autorelease];
- return [[_clientURL retain] autorelease];
- (NSString *)clientSourceToken
- return [[_clientSourceToken retain] autorelease];
+ return _clientSourceToken; - (void)setClientName:(NSString *)name version:(NSString *)version URL:(NSString *)url token:(NSString *)token;
- _clientName = [name retain];
- [_clientVersion release];
- _clientVersion = [version retain];
- _clientURL = [url retain];
- [_clientSourceToken release];
- _clientSourceToken = [token retain];
+ _clientVersion = version; + _clientSourceToken = token; - return [[_APIDomain retain] autorelease];
- (void)setAPIDomain:(NSString *)domain
if (!domain || [domain length] == 0) {
- _APIDomain = [TWITTER_DOMAIN retain];
+ _APIDomain = TWITTER_DOMAIN; - _APIDomain = [domain retain];
@@ -284,7 +263,7 @@
// Returns a formatter for dates in HTTP format (i.e. RFC 822, updated by RFC 1123).
// e.g. "Sun, 06 Nov 1994 08:49:37 GMT"
- NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init] autorelease];
+ NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; //[dateFormatter setDateFormat:@"%a, %d %b %Y %H:%M:%S GMT"]; // won't work with -init, which uses new (unicode) format behaviour.
[dateFormatter setDateFormat:@"EEE, dd MMM yyyy HH:mm:ss GMT"];
@@ -335,12 +314,12 @@
- (NSString *)_encodeString:(NSString *)string
- NSString *result = (NSString *)CFURLCreateStringByAddingPercentEscapes(NULL,
+ NSString *result = (__bridge_transfer NSString *)CFURLCreateStringByAddingPercentEscapes(NULL, + (__bridge CFStringRef)string, (CFStringRef)@";/?:@&=$+{}<>,",
- return [result autorelease];
@@ -372,7 +351,6 @@
[_connections setObject:connection forKey:[connection identifier]];
return [connection identifier];
@@ -494,8 +472,8 @@
- (void)_parseXMLForConnection:(MGTwitterHTTPURLConnection *)connection
- NSString *identifier = [[[connection identifier] copy] autorelease];
- NSData *xmlData = [[[connection data] copy] autorelease];
+ NSString *identifier = [[connection identifier] copy]; + NSData *xmlData = [[connection data] copy]; MGTwitterRequestType requestType = [connection requestType];
MGTwitterResponseType responseType = [connection responseType];
@@ -716,7 +694,7 @@
UIImage *image = [[[UIImage alloc] initWithData:[connection data]] autorelease];
- NSImage *image = [[[NSImage alloc] initWithData:[connection data]] autorelease];
+ NSImage *image = [[NSImage alloc] initWithData:[connection data]]; @@ -1474,7 +1452,7 @@
NSMutableData *body = [NSMutableData data];
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithCapacity:0];
- NSImage *image = [[[NSImage alloc] initWithData:profileImage] autorelease];
+ NSImage *image = [[NSImage alloc] initWithData:profileImage]; NSBitmapImageRep *bitmapImageRep = nil;
for(NSImageRep *imageRep in image.representations) {
@@ -1546,11 +1524,11 @@
- theRequest = [[[OAMutableURLRequest alloc] initWithURL:finalURL
+ theRequest = [[OAMutableURLRequest alloc] initWithURL:finalURL - signatureProvider:nil] autorelease];
+ signatureProvider:nil]; // Construct an NSMutableURLRequest for the URL and set appropriate request method.
theRequest = [NSMutableURLRequest requestWithURL:finalURL
@@ -1624,7 +1602,6 @@
[_connections setObject:connection forKey:[connection identifier]];
return [connection identifier];
--- a/Plugins/Twitter Plugin/MGTwitterEngine/MGTwitterHTTPURLConnection.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Twitter Plugin/MGTwitterEngine/MGTwitterHTTPURLConnection.m Sun Sep 09 12:24:39 2012 -0400
@@ -21,25 +21,16 @@
if ((self = [super initWithRequest:request delegate:delegate])) {
_data = [[NSMutableData alloc] initWithCapacity:0];
- _identifier = [[NSString stringWithNewUUID] retain];
+ _identifier = [NSString stringWithNewUUID]; _requestType = requestType;
_responseType = responseType;
- _URL = [[request URL] retain];
#pragma mark Data helper methods
@@ -60,19 +51,19 @@
- return [[_identifier retain] autorelease];
- return [[_data retain] autorelease];
- return [[_URL retain] autorelease];
--- a/Plugins/Twitter Plugin/MGTwitterEngine/MGTwitterXMLParser.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Twitter Plugin/MGTwitterEngine/MGTwitterXMLParser.m Sun Sep 09 12:24:39 2012 -0400
@@ -24,7 +24,7 @@
connectionIdentifier:identifier
- return [parser autorelease];
@@ -33,8 +33,8 @@
responseType:(MGTwitterResponseType)respType
if ((self = [super init])) {
- identifier = [theIdentifier retain];
+ identifier = theIdentifier; @@ -54,18 +54,6 @@
- [parsedObjects release];
#pragma mark NSXMLParser delegate methods
@@ -82,21 +70,6 @@
withParsedObjects:parsedObjects];
-- (void)parser:(NSXMLParser *)theParser didStartElement:(NSString *)elementName
- namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName
- attributes:(NSDictionary *)attributeDict
- //NSLog(@"Started element: %@ (%@)", elementName, attributeDict);
-- (void)parser:(NSXMLParser *)theParser foundCharacters:(NSString *)characters
- //NSLog(@"Found characters: %@", characters);
- (void)parser:(NSXMLParser *)theParser didEndElement:(NSString *)elementName
namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName
@@ -118,20 +91,6 @@
-- (void)parser:(NSXMLParser *)theParser foundAttributeDeclarationWithName:(NSString *)attributeName
- forElement:(NSString *)elementName type:(NSString *)type defaultValue:(NSString *)defaultValue
- //NSLog(@"Found attribute: %@ (%@) [%@] {%@}", attributeName, elementName, type, defaultValue);
-- (void)parser:(NSXMLParser *)theParser foundIgnorableWhitespace:(NSString *)whitespaceString
- //NSLog(@"Found ignorable whitespace: %@", whitespaceString);
- (void)parser:(NSXMLParser *)theParser parseErrorOccurred:(NSError *)parseError
//NSLog(@"Parsing error occurred: %@", parseError);
@@ -144,13 +103,12 @@
- (NSString *)lastOpenedElement {
- return [[lastOpenedElement retain] autorelease];
+ return lastOpenedElement; - (void)setLastOpenedElement:(NSString *)value {
if (lastOpenedElement != value) {
- [lastOpenedElement release];
lastOpenedElement = [value copy];
--- a/Plugins/Twitter Plugin/MGTwitterEngine/NSData+Base64.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Twitter Plugin/MGTwitterEngine/NSData+Base64.m Sun Sep 09 12:24:39 2012 -0400
@@ -22,7 +22,7 @@
+ (NSData *) dataWithBase64EncodedString:(NSString *) string {
NSData *result = [[NSData alloc] initWithBase64EncodedString:string];
- return [result autorelease];
- (id) initWithBase64EncodedString:(NSString *) string {
--- a/Plugins/Twitter Plugin/MGTwitterEngine/NSString+UUID.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/Twitter Plugin/MGTwitterEngine/NSString+UUID.m Sun Sep 09 12:24:39 2012 -0400
@@ -18,9 +18,9 @@
CFUUIDRef uuidObj = CFUUIDCreate(nil);
// Get the string representation of the UUID
- NSString *newUUID = (NSString*)CFUUIDCreateString(nil, uuidObj);
+ NSString *newUUID = (__bridge_transfer NSString*)CFUUIDCreateString(nil, uuidObj); - return [newUUID autorelease];
--- a/Plugins/WebKit Message View/AIPreviewChat.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/WebKit Message View/AIPreviewChat.m Sun Sep 09 12:24:39 2012 -0400
@@ -26,8 +26,7 @@
- (void)setDateOpened:(NSDate *)inDate
if (dateOpened != inDate) {
- dateOpened = [inDate retain];
--- a/Plugins/WebKit Message View/AIWebKitDelegate.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/WebKit Message View/AIWebKitDelegate.m Sun Sep 09 12:24:39 2012 -0400
@@ -40,13 +40,6 @@
+ (AIWebKitDelegate *)sharedWebKitDelegate
if(!AISharedWebKitDelegate)
@@ -56,7 +49,7 @@
- (void) addDelegate:(AIWebKitMessageViewController *)controller forView:(ESWebView *)webView
- [mapping setObject:controller forKey:[NSValue valueWithPointer:webView]];
+ [mapping setObject:controller forKey:[NSValue valueWithPointer:(__bridge void *)webView]]; [webView setFrameLoadDelegate:self];
[webView setPolicyDelegate:self];
@@ -78,7 +71,7 @@
[webView setEditingDelegate:nil];
[webView setResourceLoadDelegate:nil];
- [mapping removeObjectForKey:[NSValue valueWithPointer:webView]];
+ [mapping removeObjectForKey:[NSValue valueWithPointer:(__bridge void *)webView]]; //WebView Delegates ----------------------------------------------------------------------------------------------------
@@ -88,7 +81,7 @@
- (void)webView:(ESWebView *)sender didFinishLoadForFrame:(WebFrame *)frame
- AIWebKitMessageViewController *controller = [mapping objectForKey:[NSValue valueWithPointer:sender]];
+ AIWebKitMessageViewController *controller = [mapping objectForKey:[NSValue valueWithPointer:(__bridge void *)sender]]; //Flag the view as ready (as soon as the current methods exit) so we know it's now safe to add content
[controller performSelector:@selector(webViewIsReady) withObject:nil afterDelay:0];
@@ -110,7 +103,7 @@
NSInteger actionKey = [[actionInformation objectForKey: WebActionNavigationTypeKey] integerValue];
if (actionKey == WebNavigationTypeOther) {
- } else if ([[[((NSString *)LSCopyDefaultHandlerForURLScheme((CFStringRef)request.URL.scheme)) autorelease] lowercaseString] isEqualToString:@"com.adiumx.adiumx"]) {
+ } else if ([[((__bridge_transfer NSString *)LSCopyDefaultHandlerForURLScheme((__bridge CFStringRef)request.URL.scheme)) lowercaseString] isEqualToString:@"com.adiumx.adiumx"]) { // We're the default for this URL, let's open it ourself.
[[NSNotificationCenter defaultCenter] postNotificationName:@"AIURLHandleNotification" object:request.URL.absoluteString];
@@ -142,7 +135,7 @@
- (NSArray *)webView:(WebView *)sender contextMenuItemsForElement:(NSDictionary *)element defaultMenuItems:(NSArray *)defaultMenuItems
- AIWebKitMessageViewController *controller = [mapping objectForKey:[NSValue valueWithPointer:sender]];
+ AIWebKitMessageViewController *controller = [mapping objectForKey:[NSValue valueWithPointer:(__bridge void *)sender]]; return [controller webView:sender contextMenuItemsForElement:element defaultMenuItems:defaultMenuItems];
@@ -152,7 +145,7 @@
* @brief Announce when the window script object is available for modification
- (void)webView:(WebView *)sender didClearWindowObject:(WebScriptObject *)windowObject forFrame:(WebFrame *)frame {
- AIWebKitMessageViewController *controller = [mapping objectForKey:[NSValue valueWithPointer:sender]];
+ AIWebKitMessageViewController *controller = [mapping objectForKey:[NSValue valueWithPointer:(__bridge void *)sender]]; [controller webView:sender didClearWindowObject:windowObject forFrame:frame];
@@ -162,7 +155,7 @@
- (NSDragOperation)webView:(ESWebView *)sender draggingEntered:(id <NSDraggingInfo>)info
- AIWebKitMessageViewController *controller = [mapping objectForKey:[NSValue valueWithPointer:sender]];
+ AIWebKitMessageViewController *controller = [mapping objectForKey:[NSValue valueWithPointer:(__bridge void *)sender]]; return controller ? [controller draggingEntered:info] : NSDragOperationNone;
@@ -172,7 +165,7 @@
- (NSDragOperation)webView:(ESWebView *)sender draggingUpdated:(id <NSDraggingInfo>)info
- AIWebKitMessageViewController *controller = [mapping objectForKey:[NSValue valueWithPointer:sender]];
+ AIWebKitMessageViewController *controller = [mapping objectForKey:[NSValue valueWithPointer:(__bridge void *)sender]]; return controller ? [controller draggingUpdated:info] : NSDragOperationNone;
@@ -183,7 +176,7 @@
- (BOOL)webView:(ESWebView *)sender performDragOperation:(id <NSDraggingInfo>)info
- AIWebKitMessageViewController *controller = [mapping objectForKey:[NSValue valueWithPointer:sender]];
+ AIWebKitMessageViewController *controller = [mapping objectForKey:[NSValue valueWithPointer:(__bridge void *)sender]]; return controller ? [controller performDragOperation:info] : NO;
@@ -192,7 +185,7 @@
- (BOOL)webView:(ESWebView *)sender prepareForDragOperation:(id <NSDraggingInfo>)info
- AIWebKitMessageViewController *controller = [mapping objectForKey:[NSValue valueWithPointer:sender]];
+ AIWebKitMessageViewController *controller = [mapping objectForKey:[NSValue valueWithPointer:(__bridge void *)sender]]; return controller ? [controller prepareForDragOperation:info] : NO;
@@ -201,7 +194,7 @@
- (void)webView:(ESWebView *)sender concludeDragOperation:(id <NSDraggingInfo>)info
- AIWebKitMessageViewController *controller = [mapping objectForKey:[NSValue valueWithPointer:sender]];
+ AIWebKitMessageViewController *controller = [mapping objectForKey:[NSValue valueWithPointer:(__bridge void *)sender]]; [controller concludeDragOperation:info];
@@ -216,7 +209,7 @@
- (BOOL)webView:(ESWebView *)sender shouldInsertText:(NSString *)text replacingDOMRange:(DOMRange *)range givenAction:(WebViewInsertAction)action
if ([text rangeOfCharacterFromSet:[NSCharacterSet newlineCharacterSet]].location != NSNotFound) {
- AIWebKitMessageViewController *controller = [mapping objectForKey:[NSValue valueWithPointer:sender]];
+ AIWebKitMessageViewController *controller = [mapping objectForKey:[NSValue valueWithPointer:(__bridge void *)sender]]; [controller editingDidComplete:range];
@@ -229,7 +222,7 @@
- (BOOL)webView:(ESWebView *)sender shouldEndEditingInDOMRange:(DOMRange *)range
- AIWebKitMessageViewController *controller = [mapping objectForKey:[NSValue valueWithPointer:sender]];
+ AIWebKitMessageViewController *controller = [mapping objectForKey:[NSValue valueWithPointer:(__bridge void *)sender]]; [controller editingDidComplete:range];
@@ -240,6 +233,6 @@
NSMutableURLRequest *newRequest = [request mutableCopy];
[newRequest setHTTPShouldHandleCookies:NO];
- return [newRequest autorelease];
--- a/Plugins/WebKit Message View/AIWebKitMessageViewController.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/WebKit Message View/AIWebKitMessageViewController.h Sun Sep 09 12:24:39 2012 -0400
@@ -40,7 +40,7 @@
BOOL documentIsReady; // Is DOM ready?
- AIWebkitMessageViewStyle *messageStyle;
+ AIWebkitMessageViewStyle *__weak messageStyle; NSString *preferenceGroup;
@@ -72,8 +72,8 @@
* @return the ESWebView which should be inserted into the message window
@property (readonly, nonatomic) ESWebView *messageView;
-@property (readonly, nonatomic) NSView *messageScrollView;
-@property (readonly, nonatomic) AIWebkitMessageViewStyle *messageStyle;
+@property (weak, readonly, nonatomic) NSView *messageScrollView; +@property (weak, readonly, nonatomic) AIWebkitMessageViewStyle *messageStyle; * @brief Clears the view from displayed messages
--- a/Plugins/WebKit Message View/AIWebKitMessageViewController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/WebKit Message View/AIWebKitMessageViewController.m Sun Sep 09 12:24:39 2012 -0400
@@ -105,7 +105,7 @@
+ (AIWebKitMessageViewController *)messageDisplayControllerForChat:(AIChat *)inChat withPlugin:(AIWebKitMessageViewPlugin *)inPlugin
- return [[[self alloc] initForChat:inChat withPlugin:inPlugin] autorelease];
+ return [[self alloc] initForChat:inChat withPlugin:inPlugin]; - (id)initForChat:(AIChat *)inChat withPlugin:(AIWebKitMessageViewPlugin *)inPlugin
@@ -116,8 +116,8 @@
delegateProxy = [AIWebKitDelegate sharedWebKitDelegate];
- chat = [inChat retain];
- plugin = [inPlugin retain];
contentQueue = [[NSMutableArray alloc] init];
objectIconPathDict = [[NSMutableDictionary alloc] init];
objectsWithUserIconsArray = [[NSMutableArray alloc] init];
@@ -186,7 +186,7 @@
[[webView windowScriptObject] removeWebScriptKey:@"client"];
- [webView release]; webView = nil;
@@ -196,9 +196,9 @@
[self releaseAllCachedIcons];
- [plugin release]; plugin = nil;
- [objectsWithUserIconsArray release]; objectsWithUserIconsArray = nil;
- [objectIconPathDict release]; objectIconPathDict = nil;
+ objectsWithUserIconsArray = nil; + objectIconPathDict = nil; //Stop any delayed requests and remove all observers
[NSObject cancelPreviousPerformRequestsWithTarget:self];
@@ -206,22 +206,16 @@
[[NSNotificationCenter defaultCenter] removeObserver:self];
//Clean up style/variant info
- [messageStyle release]; messageStyle = nil;
- [activeStyle release]; activeStyle = nil;
- [preferenceGroup release]; preferenceGroup = nil;
//Cleanup content processing
- [contentQueue release]; contentQueue = nil;
- [storedContentObjects release]; storedContentObjects = nil;
- [previousContent release]; previousContent = nil;
+ storedContentObjects = nil; - [chat release]; chat = nil;
- //Release the marked scroller
- [self.markedScroller release];
- (void)setShouldReflectPreferenceChanges:(BOOL)inValue
@@ -234,7 +228,7 @@
storedContentObjects = [[NSMutableArray alloc] init];
- [storedContentObjects release]; storedContentObjects = nil;
+ storedContentObjects = nil; @@ -353,13 +347,13 @@
dispatch_sync(webViewUpdateQueue, ^{
- [messageStyle autorelease]; messageStyle = nil;
- [activeStyle release]; activeStyle = nil;
- messageStyle = [[plugin currentMessageStyleForChat:chat] retain];
- activeStyle = [[[messageStyle bundle] bundleIdentifier] retain];
- preferenceGroup = [[plugin preferenceGroupForChat:chat] retain];
+ messageStyle = [plugin currentMessageStyleForChat:chat]; + activeStyle = [[messageStyle bundle] bundleIdentifier]; + preferenceGroup = [plugin preferenceGroupForChat:chat]; [webView setPreferencesIdentifier:[NSString stringWithFormat:@"%@-%@",
activeStyle, preferenceGroup]];
@@ -488,7 +482,6 @@
[self _primeWebViewAndReprocessContent:NO];
[self.markedScroller removeAllMarks];
- [previousContent release];
nextMessageRegainedFocus = NO;
@@ -537,11 +530,10 @@
//Add the old content queue back in if necessary
if (currentContentQueue) {
[contentQueue addObjectsFromArray:currentContentQueue];
- [currentContentQueue release];
//We're still holding onto the previousContent from before, which is no longer accurate. Release it.
- [previousContent release]; previousContent = nil;
@@ -553,7 +545,7 @@
- (void) setIsGroupChat:(BOOL) flag
DOMHTMLElement *chatElement = (DOMHTMLElement *)[[webView mainFrameDocument] getElementById:@"Chat"];
- NSMutableString *chatClassName = [[[chatElement className] mutableCopy] autorelease];
+ NSMutableString *chatClassName = [[chatElement className] mutableCopy]; [chatClassName replaceOccurrencesOfString:@" groupchat"
@@ -676,16 +668,15 @@
__block NSString *dateMessage;
[NSDateFormatter withLocalizedDateFormatterPerform:^(NSDateFormatter *dateFormatter){
- dateMessage = [[dateFormatter stringFromDate:content.date] retain];
+ dateMessage = [dateFormatter stringFromDate:content.date]; - [dateMessage autorelease];
dateSeparator = [AIContentEvent statusInChat:content.chat
withSource:content.chat.listObject
destination:content.chat.account
- message:[[[NSAttributedString alloc] initWithString:dateMessage
- attributes:[adium.contentController defaultFormattingAttributes]] autorelease]
+ message:[[NSAttributedString alloc] initWithString:dateMessage + attributes:[adium.contentController defaultFormattingAttributes]] withType:@"date_separator"];
if ([content isKindOfClass:[AIContentContext class]])
@@ -696,7 +687,7 @@
willAddMoreContentObjects:YES
- [previousContent release]; previousContent = [dateSeparator retain];
+ previousContent = dateSeparator; BOOL similar = (previousContent && [content isSimilarToContent:previousContent] && ![content isKindOfClass:[ESFileTransfer class]]);
@@ -750,8 +741,6 @@
[classes removeObject:@"lastFocus"];
node.className = [classes componentsJoinedByString:@" "];
@@ -774,7 +763,7 @@
replaceLastContent:replaceLastContent];
- [previousContent release]; previousContent = [content retain];
+ previousContent = content; @@ -854,7 +843,7 @@
- (NSArray *)webView:(WebView *)sender contextMenuItemsForElement:(NSDictionary *)element defaultMenuItems:(NSArray *)defaultMenuItems
- NSMutableArray *webViewMenuItems = [[defaultMenuItems mutableCopy] autorelease];
+ NSMutableArray *webViewMenuItems = [defaultMenuItems mutableCopy]; AIListContact *chatListObject = chat.listObject.parentContact;
@@ -892,14 +881,12 @@
representedObject:imageURL];
[webViewMenuItems addObject:menuItem];
menuItem = [[NSMenuItem alloc] initWithTitle:[AILocalizedString(@"Save Image As", nil) stringByAppendingEllipsis]
action:@selector(saveImageAs:)
representedObject:imageURL];
[webViewMenuItems addObject:menuItem];
NSString *imgClass = [img className];
@@ -969,7 +956,6 @@
action:@selector(clearView)
[webViewMenuItems addObject:menuItem];
@@ -1148,7 +1134,7 @@
//Remove the cache for any object no longer in the chat
- for (AIListObject *listObject in [[objectsWithUserIconsArray copy] autorelease]) {
+ for (AIListObject *listObject in [objectsWithUserIconsArray copy]) { if ((![listObject isKindOfClass:[AIMetaContact class]] || (![participatingListObjects firstObjectCommonWithArray:[(AIMetaContact *)listObject containedObjects]])) &&
(![listObject isKindOfClass:[AIListContact class]] || ![participatingListObjects containsObjectIdenticalTo:(AIListContact *)listObject]) &&
!(listObject == chat.account)) {
@@ -1274,7 +1260,7 @@
- (void)releaseAllCachedIcons
- for (AIListObject *listObject in [[objectsWithUserIconsArray copy] autorelease]) {
+ for (AIListObject *listObject in [objectsWithUserIconsArray copy]) { [self releaseCurrentWebKitUserIconForObject:listObject];
@@ -1300,7 +1286,7 @@
//If that's not the case, try using the UserIconPath
NSString *userIconPath = [iconSourceObject valueForProperty:@"UserIconPath"];
- userIcon = [[[NSImage alloc] initWithContentsOfFile:userIconPath] autorelease];
+ userIcon = [[NSImage alloc] initWithContentsOfFile:userIconPath]; @@ -1308,7 +1294,7 @@
//Apply the mask if the style has one
AILogWithSignature(@"Masking %@'s icon", inObject);
//XXX Using multiple styles at once, one of which has a user icon mask, would lead to odd behavior
- webKitUserIcon = [[[messageStyle userIconMask] copy] autorelease];
+ webKitUserIcon = [[messageStyle userIconMask] copy]; [webKitUserIcon lockFocus];
[userIcon drawInRect:NSMakeRect(0,0,[webKitUserIcon size].width,[webKitUserIcon size].height)
fromRect:NSMakeRect(0,0,[userIcon size].width,[userIcon size].height)
@@ -1526,7 +1512,7 @@
if( scroller && ! [scroller isMemberOfClass:[JVMarkedScroller class]] ) {
NSRect scrollerFrame = [[scrollView verticalScroller] frame];
NSScroller *oldScroller = scroller;
- scroller = [[[JVMarkedScroller alloc] initWithFrame:scrollerFrame] autorelease];
+ scroller = [[JVMarkedScroller alloc] initWithFrame:scrollerFrame]; [scroller setFloatValue:oldScroller.floatValue];
[scroller setKnobProportion:oldScroller.knobProportion];
[scrollView setVerticalScroller:scroller];
@@ -1567,8 +1553,6 @@
[classes removeObject:@"lastFocus"];
node.className = [classes componentsJoinedByString:@" "];
// Also remove .regainedFocus. By definition this should _not_ have class .focus too, so make a new list
@@ -1582,8 +1566,6 @@
[classes removeObject:@"regainedFocus"];
node.className = [classes componentsJoinedByString:@" "];
@@ -1659,7 +1641,7 @@
- (BOOL)zoomImage:(DOMHTMLImageElement *)img
- NSMutableString *className = [[[img className] mutableCopy] autorelease];
+ NSMutableString *className = [[img className] mutableCopy]; if ([className rangeOfString:@"fullSizeImage"].location != NSNotFound)
[className replaceOccurrencesOfString:@"fullSizeImage"
withString:@"scaledToFitImage"
--- a/Plugins/WebKit Message View/AIWebKitMessageViewPlugin.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/WebKit Message View/AIWebKitMessageViewPlugin.m Sun Sep 09 12:24:39 2012 -0400
@@ -58,7 +58,7 @@
[adium.preferenceController registerDefaults:[NSDictionary dictionaryNamed:WEBKIT_DEFAULT_PREFS forClass:[self class]]
forGroup:PREF_GROUP_WEBKIT_GROUP_MESSAGE_DISPLAY];
- preferences = [(ESWebKitMessageViewPreferences *)[ESWebKitMessageViewPreferences preferencePaneForPlugin:self] retain];
+ preferences = (ESWebKitMessageViewPreferences *)[ESWebKitMessageViewPreferences preferencePaneForPlugin:self]; //Observe for installation of new styles
[[NSNotificationCenter defaultCenter] addObserver:self
@@ -81,11 +81,11 @@
[[NSNotificationCenter defaultCenter] removeObserver:self];
- [styleDictionary release]; styleDictionary = nil;
- [preferences release]; preferences = nil;
- [currentRegularStyle release]; currentRegularStyle = nil;
- [currentGroupStyle release]; currentGroupStyle = nil;
- [lastStyleLoadDate release]; lastStyleLoadDate = nil;
+ currentRegularStyle = nil; + currentGroupStyle = nil; + lastStyleLoadDate = nil; @@ -172,7 +172,7 @@
- (AIWebkitMessageViewStyle *) currentMessageStyleForChat:(AIChat *)chat
NSString *loadFromGroup = nil;
- AIWebkitMessageViewStyle **thisStyle = nil;
+ AIWebkitMessageViewStyle * __strong *thisStyle = nil; if (!chat.isGroupChat || useRegularForGroupChat) {
if (!currentRegularStyle) {
@@ -213,7 +213,6 @@
@@ -224,10 +223,8 @@
[currentGroupStyle reloadStyle];
[currentRegularStyle reloadStyle];
- [lastStyleLoadDate release];
- lastStyleLoadDate = [[NSDate date] retain];
+ lastStyleLoadDate = [NSDate date]; - [lastStyleLoadDate release];
@@ -236,12 +233,12 @@
- (void) resetStylesForType:(AIWebkitStyleType)styleType
- [styleDictionary release]; styleDictionary = nil;
case AIWebkitRegularChat:
- [currentRegularStyle release]; currentRegularStyle = nil;
+ currentRegularStyle = nil; [adium.preferenceController setPreference:nil
forKey:KEY_CURRENT_WEBKIT_STYLE_PATH
@@ -250,7 +247,7 @@
- [currentGroupStyle release]; currentGroupStyle = nil;
+ currentGroupStyle = nil; [adium.preferenceController setPreference:nil
forKey:KEY_CURRENT_WEBKIT_STYLE_PATH
@@ -308,7 +305,7 @@
if (![[adium.preferenceController preferenceForKey:@"Adium 1.4:Updated Preferences"
group:PREF_GROUP_WEBKIT_REGULAR_MESSAGE_DISPLAY] boolValue]) {
NSDictionary *dict = [adium.preferenceController preferencesForGroup:PREF_GROUP_WEBKIT_REGULAR_MESSAGE_DISPLAY];
- NSMutableDictionary *newDict = [[dict mutableCopy] autorelease];
+ NSMutableDictionary *newDict = [dict mutableCopy]; NSMutableSet *keysToRemove = [NSMutableSet set];
NSDictionary *conversionDict =
--- a/Plugins/WebKit Message View/AIWebKitPreviewMessageViewController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/WebKit Message View/AIWebKitPreviewMessageViewController.m Sun Sep 09 12:24:39 2012 -0400
@@ -28,22 +28,19 @@
- [preferencesChangedDelegate release]; preferencesChangedDelegate = nil;
+ preferencesChangedDelegate = nil; - (void)setIsGroupChat:(BOOL)groupChat
chat.isGroupChat = groupChat;
- preferenceGroup = [[plugin preferenceGroupForChat:chat] retain];
+ preferenceGroup = [plugin preferenceGroupForChat:chat]; - (void)setPreferencesChangedDelegate:(id)inDelegate
if (inDelegate != preferencesChangedDelegate) {
- [preferencesChangedDelegate release];
- preferencesChangedDelegate = [inDelegate retain];
+ preferencesChangedDelegate = inDelegate; [preferencesChangedDelegate preferencesChangedForGroup:PREF_GROUP_WEBKIT_REGULAR_MESSAGE_DISPLAY
--- a/Plugins/WebKit Message View/AIWebkitMessageViewStyle.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/WebKit Message View/AIWebkitMessageViewStyle.h Sun Sep 09 12:24:39 2012 -0400
@@ -78,9 +78,9 @@
@interface AIWebkitMessageViewStyle : NSObject {
+ NSBundle *__weak styleBundle; - NSString *activeVariant;
+ NSString *__weak activeVariant; @@ -121,7 +121,7 @@
AIWebkitBackgroundType customBackgroundType;
NSString *customBackgroundPath;
- NSColor *customBackgroundColor;
+ NSColor *__weak customBackgroundColor; NSMutableDictionary *statusIconPathCache;
@@ -143,7 +143,7 @@
* @brief The NSBundle for this style
-@property (readonly, nonatomic) NSBundle *bundle;
+@property (weak, readonly, nonatomic) NSBundle *bundle; * @brief Reloads the content of the style, useful for style authors and updates
@@ -158,7 +158,7 @@
* This is only a store; if it is changed, the changing object is responsible for making
* any appropriate calls to update the display
-@property (nonatomic, retain) NSString *activeVariant;
+@property (weak, nonatomic) NSString *activeVariant; * Returns YES if this style is considered legacy
@@ -255,7 +255,7 @@
* @brief The style's sender colors
-@property (readonly, nonatomic) NSArray *validSenderColors;
+@property (weak, readonly, nonatomic) NSArray *validSenderColors; @@ -301,7 +301,7 @@
* @brief Set the custom background color
-@property (readwrite, retain, nonatomic) NSColor *customBackgroundColor;
+@property (weak, readwrite, nonatomic) NSColor *customBackgroundColor; * @brief Toggle visibility of received coloring
--- a/Plugins/WebKit Message View/AIWebkitMessageViewStyle.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/WebKit Message View/AIWebkitMessageViewStyle.m Sun Sep 09 12:24:39 2012 -0400
@@ -128,14 +128,14 @@
+ (id)messageViewStyleFromBundle:(NSBundle *)inBundle
- return [[[self alloc] initWithBundle:inBundle] autorelease];
+ return [[self alloc] initWithBundle:inBundle]; + (id)messageViewStyleFromPath:(NSString *)path
NSBundle *styleBundle = [NSBundle bundleWithPath:[path stringByExpandingBundlePath]];
- return [[[self alloc] initWithBundle:styleBundle] autorelease];
+ return [[self alloc] initWithBundle:styleBundle]; @@ -145,11 +145,10 @@
- (id)initWithBundle:(NSBundle *)inBundle
if ((self = [super init])) {
- styleBundle = [inBundle retain];
- stylePath = [[styleBundle resourcePath] retain];
+ styleBundle = inBundle; + stylePath = [styleBundle resourcePath]; if ([self reloadStyle] == FALSE) {
@@ -218,26 +217,26 @@
- [contentInHTML release];
- [nextContentInHTML release];
- [contextInHTML release];
- [nextContextInHTML release];
- [contentOutHTML release];
- [nextContentOutHTML release];
- [contextOutHTML release];
- [nextContextOutHTML release];
- [fileTransferHTML release];
- [customBackgroundPath release];
- [customBackgroundColor release];
+ nextContentInHTML = nil; + nextContextInHTML = nil; + nextContentOutHTML = nil; + nextContextOutHTML = nil; + fileTransferHTML = nil; - [userIconMask release];
+ customBackgroundPath = nil; + customBackgroundColor = nil; @@ -245,20 +244,9 @@
- [timeStampFormatter release];
[[NSDistributedNotificationCenter defaultCenter] removeObserver: self];
- [statusIconPathCache release];
- [timeFormatterCache release];
- self.activeVariant = nil;
@synthesize bundle = styleBundle;
@@ -279,7 +267,7 @@
NSString *senderColorsFile = [NSString stringWithContentsOfURL:url encoding:NSUTF8StringEncoding error:NULL];
- validSenderColors = [[senderColorsFile componentsSeparatedByString:@":"] retain];
+ validSenderColors = [senderColorsFile componentsSeparatedByString:@":"]; checkedSenderColors = YES;
@@ -329,8 +317,6 @@
format = [NSDateFormatter localizedDateFormatStringShowingSeconds:NO showingAMorPM:NO];
- [timeStampFormatter release];
if ([format rangeOfString:@"%"].location != NSNotFound) {
/* Support strftime-style format strings, which old message styles may use */
timeStampFormatter = [[NSDateFormatter alloc] initWithDateFormat:format allowNaturalLanguage:NO];
@@ -403,7 +389,7 @@
} else if([[content type] isEqualToString:CONTENT_FILE_TRANSFER_TYPE]) {
- template = [[fileTransferHTML mutableCopy] autorelease];
+ template = [fileTransferHTML mutableCopy]; } else if ([[content type] isEqualToString:CONTENT_TOPIC_TYPE]) {
@@ -421,7 +407,7 @@
[self fillKeywords:mutableTemplate forContent:content similar:contentIsSimilar];
- return [mutableTemplate autorelease];
+ return mutableTemplate; @@ -434,9 +420,9 @@
//Load the style's templates
//We can't use NSString's initWithContentsOfFile here. HTML files are interpreted in the defaultCEncoding
//(which varies by system) when read that way. We want to always interpret the files as UTF8.
- headerHTML = [[NSString stringWithContentsOfUTF8File:[styleBundle semiCaseInsensitivePathForResource:@"Header" ofType:@"html"]] retain];
- footerHTML = [[NSString stringWithContentsOfUTF8File:[styleBundle semiCaseInsensitivePathForResource:@"Footer" ofType:@"html"]] retain];
- topicHTML = [[NSString stringWithContentsOfUTF8File:[styleBundle semiCaseInsensitivePathForResource:@"Topic" ofType:@"html"]] retain];
+ headerHTML = [NSString stringWithContentsOfUTF8File:[styleBundle semiCaseInsensitivePathForResource:@"Header" ofType:@"html"]]; + footerHTML = [NSString stringWithContentsOfUTF8File:[styleBundle semiCaseInsensitivePathForResource:@"Footer" ofType:@"html"]]; + topicHTML = [NSString stringWithContentsOfUTF8File:[styleBundle semiCaseInsensitivePathForResource:@"Topic" ofType:@"html"]]; baseHTML = [NSString stringWithContentsOfUTF8File:[styleBundle semiCaseInsensitivePathForResource:@"Template" ofType:@"html"]];
//Starting with version 1, styles can choose to not include template.html. If the template is not included
@@ -455,7 +441,7 @@
* clicking works once, then the text doesn't allow a return click. This is an improvement compared
* to fully broken behavior in which the return click shows a missing-image placeholder.
- NSMutableString *imageSwapFixedBaseHTML = [[baseHTML mutableCopy] autorelease];
+ NSMutableString *imageSwapFixedBaseHTML = [baseHTML mutableCopy]; [imageSwapFixedBaseHTML replaceOccurrencesOfString:
@" function imageCheck() {\n"
" node = event.target;\n"
@@ -526,48 +512,47 @@
- contentHTML = [[NSString stringWithContentsOfUTF8File:[styleBundle semiCaseInsensitivePathForResource:@"Content" ofType:@"html"]] retain];
- contentInHTML = [[NSString stringWithContentsOfUTF8File:[styleBundle semiCaseInsensitivePathForResource:@"Content" ofType:@"html" inDirectory:@"Incoming"]] retain];
- nextContentInHTML = [[NSString stringWithContentsOfUTF8File:[styleBundle semiCaseInsensitivePathForResource:@"NextContent" ofType:@"html" inDirectory:@"Incoming"]] retain];
- contentOutHTML = [[NSString stringWithContentsOfUTF8File:[styleBundle semiCaseInsensitivePathForResource:@"Content" ofType:@"html" inDirectory:@"Outgoing"]] retain];
- nextContentOutHTML = [[NSString stringWithContentsOfUTF8File:[styleBundle semiCaseInsensitivePathForResource:@"NextContent" ofType:@"html" inDirectory:@"Outgoing"]] retain];
+ contentHTML = [NSString stringWithContentsOfUTF8File:[styleBundle semiCaseInsensitivePathForResource:@"Content" ofType:@"html"]]; + contentInHTML = [NSString stringWithContentsOfUTF8File:[styleBundle semiCaseInsensitivePathForResource:@"Content" ofType:@"html" inDirectory:@"Incoming"]]; + nextContentInHTML = [NSString stringWithContentsOfUTF8File:[styleBundle semiCaseInsensitivePathForResource:@"NextContent" ofType:@"html" inDirectory:@"Incoming"]]; + contentOutHTML = [NSString stringWithContentsOfUTF8File:[styleBundle semiCaseInsensitivePathForResource:@"Content" ofType:@"html" inDirectory:@"Outgoing"]]; + nextContentOutHTML = [NSString stringWithContentsOfUTF8File:[styleBundle semiCaseInsensitivePathForResource:@"NextContent" ofType:@"html" inDirectory:@"Outgoing"]]; - contextInHTML = [[NSString stringWithContentsOfUTF8File:[styleBundle semiCaseInsensitivePathForResource:@"Context" ofType:@"html" inDirectory:@"Incoming"]] retain];
- nextContextInHTML = [[NSString stringWithContentsOfUTF8File:[styleBundle semiCaseInsensitivePathForResource:@"NextContext" ofType:@"html" inDirectory:@"Incoming"]] retain];
- contextOutHTML = [[NSString stringWithContentsOfUTF8File:[styleBundle semiCaseInsensitivePathForResource:@"Context" ofType:@"html" inDirectory:@"Outgoing"]] retain];
- nextContextOutHTML = [[NSString stringWithContentsOfUTF8File:[styleBundle semiCaseInsensitivePathForResource:@"NextContext" ofType:@"html" inDirectory:@"Outgoing"]] retain];
+ contextInHTML = [NSString stringWithContentsOfUTF8File:[styleBundle semiCaseInsensitivePathForResource:@"Context" ofType:@"html" inDirectory:@"Incoming"]]; + nextContextInHTML = [NSString stringWithContentsOfUTF8File:[styleBundle semiCaseInsensitivePathForResource:@"NextContext" ofType:@"html" inDirectory:@"Incoming"]]; + contextOutHTML = [NSString stringWithContentsOfUTF8File:[styleBundle semiCaseInsensitivePathForResource:@"Context" ofType:@"html" inDirectory:@"Outgoing"]]; + nextContextOutHTML = [NSString stringWithContentsOfUTF8File:[styleBundle semiCaseInsensitivePathForResource:@"NextContext" ofType:@"html" inDirectory:@"Outgoing"]]; //Fall back to Resources/Content.html if Incoming isn't present
- if (!contentInHTML) contentInHTML = [contentHTML retain];
+ if (!contentInHTML) contentInHTML = contentHTML; //Fall back to Content if NextContent doesn't need to use different HTML
- if (!nextContentInHTML) nextContentInHTML = [contentInHTML retain];
+ if (!nextContentInHTML) nextContentInHTML = contentInHTML; //Fall back to Content if Context isn't present
- if (!nextContextInHTML) nextContextInHTML = [nextContentInHTML retain];
- if (!contextInHTML) contextInHTML = [contentInHTML retain];
+ if (!nextContextInHTML) nextContextInHTML = nextContentInHTML; + if (!contextInHTML) contextInHTML = contentInHTML; //Fall back to Content if Context isn't present
- if (!nextContextOutHTML && nextContentOutHTML) nextContextOutHTML = [nextContentOutHTML retain];
- if (!contextOutHTML && contentOutHTML) contextOutHTML = [contentOutHTML retain];
+ if (!nextContextOutHTML && nextContentOutHTML) nextContextOutHTML = nextContentOutHTML; + if (!contextOutHTML && contentOutHTML) contextOutHTML = contentOutHTML; //Fall back to Content if Context isn't present
- if (!nextContextOutHTML) nextContextOutHTML = [nextContextInHTML retain];
- if (!contextOutHTML) contextOutHTML = [contextInHTML retain];
+ if (!nextContextOutHTML) nextContextOutHTML = nextContextInHTML; + if (!contextOutHTML) contextOutHTML = contextInHTML; //Fall back to Incoming if Outgoing doesn't need to be different
- if (!contentOutHTML) contentOutHTML = [contentInHTML retain];
- if (!nextContentOutHTML) nextContentOutHTML = [nextContentInHTML retain];
+ if (!contentOutHTML) contentOutHTML = contentInHTML; + if (!nextContentOutHTML) nextContentOutHTML = nextContentInHTML; - statusHTML = [[NSString stringWithContentsOfUTF8File:[styleBundle semiCaseInsensitivePathForResource:@"Status" ofType:@"html"]] retain];
+ statusHTML = [NSString stringWithContentsOfUTF8File:[styleBundle semiCaseInsensitivePathForResource:@"Status" ofType:@"html"]]; //Fall back to Resources/Incoming/Content.html if Status isn't present
- if (!statusHTML) statusHTML = [contentInHTML retain];
+ if (!statusHTML) statusHTML = contentInHTML; //TODO: make a generic Request message, rather than having this ft specific one
NSMutableString *fileTransferHTMLTemplate;
@@ -592,7 +577,7 @@
if (!combineConsecutive) contentIsSimilar = NO;
//Fetch the correct template and substitute keywords for the passed content
- newHTML = [[[self completedTemplateForContent:content similar:contentIsSimilar] mutableCopy] autorelease];
+ newHTML = [[self completedTemplateForContent:content similar:contentIsSimilar] mutableCopy]; //BOM scripts vary by style version
if (!usingCustomTemplateHTML && styleVersion >= 4) {
@@ -774,9 +759,8 @@
__block NSString *shortTimeString;
[NSDateFormatter withLocalizedDateFormatterShowingSeconds:NO showingAMorPM:NO perform:^(NSDateFormatter *dateFormatter){
- shortTimeString = (date ? [[dateFormatter stringFromDate:date] retain] : @"");
+ shortTimeString = (date ? [dateFormatter stringFromDate:date] : @""); - [shortTimeString autorelease];
[inString replaceKeyword:@"%shortTime%"
withString:shortTimeString];
@@ -857,7 +841,6 @@
[dateFormatter setDateFormat:timeFormat];
[timeFormatterCache setObject:dateFormatter forKey:timeFormat];
- [dateFormatter release];
[inString safeReplaceCharactersInRange:NSUnionRange(range, endRange)
@@ -1278,8 +1261,6 @@
[inString safeReplaceCharactersInRange:NSUnionRange(range, endRange)
withString:[dateFormatter stringFromDate:[chat dateOpened]]];
- [dateFormatter release];
} while (range.location != NSNotFound);
@@ -1297,7 +1278,7 @@
NSMutableString *bodyTag = nil;
if (allowsCustomBackground && (customBackgroundPath || customBackgroundColor)) {
- bodyTag = [[[NSMutableString alloc] init] autorelease];
+ bodyTag = [[NSMutableString alloc] init]; if (customBackgroundPath) {
if ([customBackgroundPath length]) {
--- a/Plugins/WebKit Message View/ESWebKitMessageViewPreferences.h Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/WebKit Message View/ESWebKitMessageViewPreferences.h Sun Sep 09 12:24:39 2012 -0400
@@ -53,17 +53,12 @@
- NSButton *checkBox_customNameFormatting;
- NSPopUpButton *popUp_nameFormat;
- NSPopUpButton *popUp_timeStampFormat;
- NSPopUpButton *popUp_minimumFontSize;
-@property (assign) IBOutlet NSButton *checkBox_customNameFormatting;
-@property (assign) IBOutlet NSPopUpButton *popUp_nameFormat;
-@property (assign) IBOutlet NSPopUpButton *popUp_timeStampFormat;
-@property (assign) IBOutlet NSPopUpButton *popUp_minimumFontSize;
+@property (weak) IBOutlet NSButton *checkBox_customNameFormatting; +@property (weak) IBOutlet NSPopUpButton *popUp_nameFormat; +@property (weak) IBOutlet NSPopUpButton *popUp_timeStampFormat; +@property (weak) IBOutlet NSPopUpButton *popUp_minimumFontSize; * @brief Rebuild our styles menu when installed message styles change
@@ -75,7 +70,7 @@
- (IBAction)resetDisplayFontToDefault:(id)sender;
-@property (readonly, nonatomic) NSString *preferenceGroupForCurrentTab;
+@property (weak, readonly, nonatomic) NSString *preferenceGroupForCurrentTab; @property (readonly, nonatomic) AIWebkitStyleType currentTab;
--- a/Plugins/WebKit Message View/ESWebKitMessageViewPreferences.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Plugins/WebKit Message View/ESWebKitMessageViewPreferences.m Sun Sep 09 12:24:39 2012 -0400
@@ -126,15 +126,14 @@
[[NSColorPanel sharedColorPanel] setShowsAlpha:NO];
[[NSNotificationCenter defaultCenter] removeObserver:self];
- [previewListObjectsDict release]; previewListObjectsDict = nil;
+ previewListObjectsDict = nil; [previewController messageViewIsClosing];
- [previewController release]; previewController = nil;
+ previewController = nil; [view_previewLocation setFrame:[preview frame]];
[[preview superview] replaceSubview:preview with:view_previewLocation];
- [preview release]; preview = nil;
//Matches the retain performed in -[ESWebKitMessageViewPreferences _configureChatPreview]
- [view_previewLocation release];
@@ -270,7 +269,7 @@
NSData *backgroundImage = [adium.preferenceController preferenceForKey:[plugin styleSpecificKey:@"Background" forStyle:style]
group:PREF_GROUP_WEBKIT_BACKGROUND_IMAGES];
- [imageView_backgroundImage setImage:[[[NSImage alloc] initWithData:backgroundImage] autorelease]];
+ [imageView_backgroundImage setImage:[[NSImage alloc] initWithData:backgroundImage]]; [imageView_backgroundImage setImage:nil];
@@ -490,19 +489,18 @@
- NSMenu *menu = [[NSMenu allocWithZone:[NSMenu menuZone]] initWithTitle:@""];
+ NSMenu *menu = [[NSMenu alloc] initWithTitle:@""]; NSMutableArray *menuItemArray = [NSMutableArray array];
NSArray *availableStyles = [[plugin availableMessageStyles] allValues];
for (NSBundle *style in availableStyles) {
- menuItem = [[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:[style name]
+ menuItem = [[NSMenuItem alloc] initWithTitle:[style name] [menuItem setRepresentedObject:[style bundleIdentifier]];
[menuItemArray addObject:menuItem];
[menuItemArray sortUsingSelector:@selector(titleCompare:)];
@@ -511,7 +509,7 @@
- return [menu autorelease];
@@ -519,7 +517,7 @@
- (NSMenu *)_variantsMenu
- NSMenu *menu = [[NSMenu allocWithZone:[NSMenu menuZone]] initWithTitle:@""];
+ NSMenu *menu = [[NSMenu alloc] initWithTitle:@""]; //Add a menu item for each variant
for (NSString *variant in previewController.messageStyle.availableVariants) {
@@ -530,7 +528,7 @@
representedObject:variant];
- return [menu autorelease];
@@ -538,7 +536,7 @@
- (NSMenu *)_backgroundImageTypeMenu
- NSMenu *menu = [[NSMenu allocWithZone:[NSMenu menuZone]] init];
+ NSMenu *menu = [[NSMenu alloc] init]; [self _addBackgroundImageTypeChoice:BackgroundNormal toMenu:menu withTitle:AILocalizedString(@"Normal","Background image display preference: The image will be displayed normally")];
[self _addBackgroundImageTypeChoice:BackgroundCenter toMenu:menu withTitle:AILocalizedString(@"Centered","Background image display preference: The image will be centered in the window")];
@@ -546,16 +544,15 @@
[self _addBackgroundImageTypeChoice:BackgroundTileCenter toMenu:menu withTitle:AILocalizedString(@"Tiled (Centered)","Background image display preference: The image will be tiled and centered in the window")];
[self _addBackgroundImageTypeChoice:BackgroundScale toMenu:menu withTitle:AILocalizedString(@"Scaled", "Background image display preference: The image will be increased or decreased in size to fit the window")];
- return [menu autorelease];
- (void)_addBackgroundImageTypeChoice:(NSInteger)tag toMenu:(NSMenu *)menu withTitle:(NSString *)title
- NSMenuItem *menuItem = [[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:title
+ NSMenuItem *menuItem = [[NSMenuItem alloc] initWithTitle:title
@@ -572,14 +569,12 @@
__block NSString *sampleStampA, *sampleStampB;
[NSDateFormatter withLocalizedDateFormatterShowingSeconds:NO showingAMorPM:YES perform:^(NSDateFormatter *noSecondsAMPM){
- sampleStampA = [[noSecondsAMPM stringForObjectValue:[NSDate date]] retain];
+ sampleStampA = [noSecondsAMPM stringForObjectValue:[NSDate date]]; - [sampleStampA autorelease];
[NSDateFormatter withLocalizedDateFormatterShowingSeconds:NO showingAMorPM:NO perform:^(NSDateFormatter *noSecondsNoAMPM){
- sampleStampB = [[noSecondsNoAMPM stringForObjectValue:[NSDate date]] retain];
+ sampleStampB = [noSecondsNoAMPM stringForObjectValue:[NSDate date]]; - [sampleStampB autorelease];
BOOL noAMPM = [sampleStampA isEqualToString:sampleStampB];
@@ -616,17 +611,17 @@
- (NSMenu *)_fontSizeMenu
- NSMenu *menu = [[[NSMenu allocWithZone:[NSMenu menuZone]] init] autorelease];
+ NSMenu *menu = [[NSMenu allocWithZone:[NSMenu menuZone]] init]; NSUInteger sizes[] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,18,20,22,24,36,48,64,72,96};
for (loopCounter = 0; loopCounter < 23; loopCounter++) {
- menuItem = [[[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:[[NSNumber numberWithInteger:sizes[loopCounter]] stringValue]
+ menuItem = [[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:[[NSNumber numberWithInteger:sizes[loopCounter]] stringValue] - keyEquivalent:@""] autorelease];
[menuItem setTag:sizes[loopCounter]];
@@ -654,8 +649,8 @@
NSDictionary *listObjects;
previewChat = [self previewChatWithDictionary:previewDict fromPath:previewPath listObjects:&listObjects];
- previewController = [(AIWebKitPreviewMessageViewController *)[AIWebKitPreviewMessageViewController messageDisplayControllerForChat:previewChat
- withPlugin:plugin] retain];
+ previewController = (AIWebKitPreviewMessageViewController *)[AIWebKitPreviewMessageViewController messageDisplayControllerForChat:previewChat //Enable live refreshing of our preview
[previewController setShouldReflectPreferenceChanges:YES];
@@ -663,13 +658,11 @@
//Add fake users and content to our chat
[self _fillContentOfChat:previewChat withDictionary:previewDict fromPath:previewPath listObjects:listObjects];
//Place the preview chat in our view
- preview = [[previewController messageView] retain];
+ preview = [previewController messageView]; [preview setFrame:[view_previewLocation frame]];
//Will be released in viewWillClose
- [view_previewLocation retain];
[[view_previewLocation superview] replaceSubview:view_previewLocation with:preview];
//Disable drag and drop onto the preview chat - Jeff doesn't need your porn :)
@@ -740,7 +733,6 @@
[listObjectDict setObject:listContact forKey:UID];
--- a/Resources/ContactListWindow.xib Thu Sep 06 21:09:42 2012 +0200
+++ b/Resources/ContactListWindow.xib Sun Sep 09 12:24:39 2012 -0400
@@ -11,17 +11,17 @@
<string key="NS.object.0">2182</string>
<array key="IBDocument.IntegratedClassDependencies">
- <string>NSView</string>
+ <string>NSCustomObject</string> + <string>NSCustomView</string> + <string>NSImageCell</string> + <string>NSImageView</string> <string>NSOutlineView</string>
<string>NSScrollView</string>
- <string>NSWindowTemplate</string>
+ <string>NSScroller</string> + <string>NSTableColumn</string> <string>NSTextFieldCell</string>
- <string>NSCustomView</string>
- <string>NSImageCell</string>
- <string>NSTableColumn</string>
- <string>NSImageView</string>
- <string>NSScroller</string>
- <string>NSCustomObject</string>
+ <string>NSView</string> + <string>NSWindowTemplate</string> <array key="IBDocument.PluginDependencies">
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
--- a/Resources/Preferences.xib Thu Sep 06 21:09:42 2012 +0200
+++ b/Resources/Preferences.xib Sun Sep 09 12:24:39 2012 -0400
@@ -8,29 +8,29 @@
<string key="IBDocument.HIToolboxVersion">569.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string key="NS.object.0">2182</string>
+ <string key="NS.object.0">2488</string> <array key="IBDocument.IntegratedClassDependencies">
- <string>NSToolbarItem</string>
- <string>NSToolbarFlexibleSpaceItem</string>
+ <string>NSArrayController</string> + <string>NSCollectionView</string> + <string>NSCollectionViewItem</string> <string>NSCustomObject</string>
- <string>NSArrayController</string>
+ <string>NSImageCell</string> <string>NSImageView</string>
- <string>NSImageCell</string>
- <string>NSCollectionView</string>
+ <string>NSScrollView</string> + <string>NSScroller</string> <string>NSSearchField</string>
- <string>NSTextField</string>
<string>NSSearchFieldCell</string>
- <string>NSWindowTemplate</string>
- <string>NSTextFieldCell</string>
+ <string>NSSegmentedCell</string> <string>NSSegmentedControl</string>
- <string>NSCollectionViewItem</string>
- <string>NSView</string>
+ <string>NSTextField</string> + <string>NSTextFieldCell</string> <string>NSToolbar</string>
- <string>NSScrollView</string>
- <string>NSSegmentedCell</string>
- <string>NSScroller</string>
+ <string>NSToolbarFlexibleSpaceItem</string> + <string>NSToolbarItem</string> + <string>NSView</string> + <string>NSWindowTemplate</string> <array key="IBDocument.PluginDependencies">
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -168,7 +168,7 @@
<object class="NSSegmentedControl" key="NSToolbarItemView" id="346899390">
<reference key="NSNextResponder"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{0, 14}, {81, 25}}</string>
+ <string key="NSFrame">{{0, 14}, {77, 25}}</string> <reference key="NSSuperview"/>
<reference key="NSWindow"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
@@ -188,13 +188,13 @@
<int key="NSSelectedSegment">-1</int>
<int key="NSTrackingMode">2</int>
- <int key="NSSegmentStyle">2</int>
+ <int key="NSSegmentStyle">4</int> <nil key="NSToolbarItemImage"/>
<nil key="NSToolbarItemTarget"/>
<nil key="NSToolbarItemAction"/>
- <string key="NSToolbarItemMinSize">{81, 25}</string>
+ <string key="NSToolbarItemMinSize">{77, 25}</string> <string key="NSToolbarItemMaxSize">{81, 25}</string>
<bool key="NSToolbarItemEnabled">YES</bool>
<bool key="NSToolbarItemAutovalidates">YES</bool>
--- a/Source/AIAccountController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Source/AIAccountController.m Sun Sep 09 12:24:39 2012 -0400
@@ -23,7 +23,7 @@
#import "AIStatusController.h"
#import <AIUtilities/AIDictionaryAdditions.h>
#import <AIUtilities/AIMenuAdditions.h>
-#import <AIUtilities/AIObjectAdditions.h>
#import <AIUtilities/AIImageAdditions.h>
#import <Adium/AIAccount.h>
@@ -78,16 +78,6 @@
[self disconnectAllAccounts];
- [adiumServices release];
- [adiumPasswords release];
- [adiumAccounts release];
- [adiumPreferredAccounts release];
- (void)registerService:(AIService *)inService {
@@ -236,6 +226,6 @@
- (NSScriptObjectSpecifier *) objectSpecifier {
id classDescription = [NSClassDescription classDescriptionForClass:[NSApplication class]];
NSScriptObjectSpecifier *container = [[NSApplication sharedApplication] objectSpecifier];
- return [[[NSPropertySpecifier alloc] initWithContainerClassDescription:classDescription containerSpecifier:container key:@"accountController"] autorelease];
+ return [[NSPropertySpecifier alloc] initWithContainerClassDescription:classDescription containerSpecifier:container key:@"accountController"]; --- a/Source/AIAccountListPreferences.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Source/AIAccountListPreferences.m Sun Sep 09 12:24:39 2012 -0400
@@ -120,13 +120,13 @@
[button_addOrRemoveAccount setMenuIndicatorShown:YES forSegment:0];
//Set ourselves up for Account Menus
- accountMenu_options = [[AIAccountMenu accountMenuWithDelegate:self
+ accountMenu_options = [AIAccountMenu accountMenuWithDelegate:self submenuType:AIAccountOptionsSubmenu
- showTitleVerbs:NO] retain];
- accountMenu_status = [[AIAccountMenu accountMenuWithDelegate:self
+ accountMenu_status = [AIAccountMenu accountMenuWithDelegate:self submenuType:AIAccountStatusSubmenu
- showTitleVerbs:NO] retain];
//Observe status icon pack changes
[[NSNotificationCenter defaultCenter] addObserver:self
@@ -155,20 +155,14 @@
[[AIContactObserverManager sharedManager] unregisterListObjectObserver:self];
[[NSNotificationCenter defaultCenter] removeObserver:self];
- [accountArray release]; accountArray = nil;
- [requiredHeightDict release]; requiredHeightDict = nil;
- [accountMenu_options release]; accountMenu_options = nil;
- [accountMenu_status release]; accountMenu_status = nil;
+ requiredHeightDict = nil; + accountMenu_options = nil; + accountMenu_status = nil; // Cancel our auto-refreshing reconnect countdown.
[reconnectTimeUpdater invalidate];
- [reconnectTimeUpdater release]; reconnectTimeUpdater = nil;
- [accountArray release];
+ reconnectTimeUpdater = nil; @@ -382,7 +376,6 @@
[cell setDrawsImageAfterMainString:YES];
[[tableView_accountList tableColumnWithIdentifier:@"name"] setDataCell:cell];
[cell setLineBreakMode:NSLineBreakByWordWrapping];
cell = [[AIImageTextCell alloc] init];
[cell setFont:[NSFont systemFontOfSize:13]];
@@ -391,7 +384,6 @@
[[tableView_accountList tableColumnWithIdentifier:@"status"] setDataCell:cell];
[cell accessibilitySetOverrideValue:[NSNumber numberWithBool:YES]
forAttribute:NSAccessibilityEnabledAttribute];
[tableView_accountList sizeToFit];
@@ -412,8 +404,7 @@
- (void)accountListChanged:(NSNotification *)notification
//Update our list of accounts
- [accountArray release];
- accountArray = [adium.accountController.accounts retain];
+ accountArray = adium.accountController.accounts; //Refresh the account table
[tableView_accountList reloadData];
@@ -427,7 +418,7 @@
- (NSMenu *)menuForRowIndexes:(NSIndexSet *)indexes
- NSMenu *statusMenu = nil, *optionsMenu = [[[NSMenu alloc] init] autorelease];
+ NSMenu *statusMenu = nil, *optionsMenu = [[NSMenu alloc] init]; NSMenuItem *statusMenuItem = nil;
NSArray *accounts = [accountArray objectsAtIndexes:indexes];
@@ -557,7 +548,7 @@
if (row >= 0 && row < [accountArray count]) {
AIAccount *account = [accountArray objectAtIndex:row];
- NSMenu *optionsMenu = [[[NSMenu alloc] init] autorelease];
+ NSMenu *optionsMenu = [[NSMenu alloc] init]; NSMenu *accountOptionsMenu = [[accountMenu_options menuItemForAccount:account] submenu];
NSMenuItem *statusMenuItem = [optionsMenu addItemWithTitle:AILocalizedString(@"Set Status", "Used in the context menu for the accounts list for the sub menu to set status in.")
@@ -566,7 +557,7 @@
//We can't put the submenu into our menu directly or otherwise modify the accountMenu_status, as we may want to use it again
- [statusMenuItem setSubmenu:[[[[accountMenu_status menuItemForAccount:account] submenu] copy] autorelease]];
+ [statusMenuItem setSubmenu:[[[accountMenu_status menuItemForAccount:account] submenu] copy]]; if (!account.online && ![account boolValueForProperty:@"isConnecting"] && [self statusMessageForAccount:account]) {
[optionsMenu addItemWithTitle:AILocalizedString(@"Copy Error Message","Menu Item for the context menu of an account in the accounts list")
@@ -600,7 +591,7 @@
for (NSMenuItem *menuItem in [accountOptionsMenu itemArray]) {
//Use copies of the menu items rather than moving the actual items, as we may want to use them again
- [optionsMenu addItem:[[menuItem copy] autorelease]];
+ [optionsMenu addItem:[menuItem copy]]; @@ -625,14 +616,14 @@
if (moreUpdatesNeeded && reconnectTimeUpdater == nil) {
- reconnectTimeUpdater = [[NSTimer scheduledTimerWithTimeInterval:1.0
+ reconnectTimeUpdater = [NSTimer scheduledTimerWithTimeInterval:1.0 selector:@selector(updateReconnectTime:)
} else if (!moreUpdatesNeeded && reconnectTimeUpdater != nil) {
[reconnectTimeUpdater invalidate];
- [reconnectTimeUpdater release]; reconnectTimeUpdater = nil;
+ reconnectTimeUpdater = nil; @@ -712,7 +703,7 @@
statusMessage = [[account valueForProperty:@"connectionProgressString"] stringByAppendingFormat:@" (%2.f%%)", [[account valueForProperty:@"connectionProgressPercent"] doubleValue]];
} else if ([account lastDisconnectionError] && ![account boolValueForProperty:@"isOnline"] && ![account boolValueForProperty:@"isConnecting"]) {
// If there's an error and we're not online and not connecting
- NSMutableString *returnedMessage = [[[account lastDisconnectionError] mutableCopy] autorelease];
+ NSMutableString *returnedMessage = [[account lastDisconnectionError] mutableCopy]; // Replace the LibPurple error prefixes
[returnedMessage replaceOccurrencesOfString:@"Could not establish a connection with the server:\n"
@@ -776,9 +767,6 @@
if (combinedHeight > necessaryHeight) {
necessaryHeight = combinedHeight;
- [subStringTitle release];
// Cache the height value
@@ -793,7 +781,7 @@
- [requiredHeightDict release]; requiredHeightDict = [[NSMutableDictionary alloc] init];
+ requiredHeightDict = [[NSMutableDictionary alloc] init]; for (accountNumber = 0; accountNumber < [accountArray count]; accountNumber++) {
[self calculateHeightForRow:accountNumber];
--- a/Source/AIAccountListPreferencesPlugin.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Source/AIAccountListPreferencesPlugin.m Sun Sep 09 12:24:39 2012 -0400
@@ -30,7 +30,7 @@
- accountListPreferences = [(AIAccountListPreferences *)[AIAccountListPreferences preferencePaneForPlugin:self] retain];
+ accountListPreferences = (AIAccountListPreferences *)[AIAccountListPreferences preferencePaneForPlugin:self]; [[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(editAccount:)
@@ -41,9 +41,6 @@
[[NSNotificationCenter defaultCenter] removeObserver:self];
- [accountListPreferences release];
--- a/Source/AIAccountMenuAccessPlugin.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Source/AIAccountMenuAccessPlugin.m Sun Sep 09 12:24:39 2012 -0400
@@ -39,22 +39,13 @@
- accountMenu = [[AIAccountMenu accountMenuWithDelegate:self submenuType:AIAccountOptionsSubmenu showTitleVerbs:YES] retain];
+ accountMenu = [AIAccountMenu accountMenuWithDelegate:self submenuType:AIAccountOptionsSubmenu showTitleVerbs:YES]; NSMenuItem *menuItem = [[NSMenuItem alloc] initWithTitle:[AILocalizedString(@"Connect a Guest Account", "Menu item title which opens the window for adding and connecting a guest (temporary) account") stringByAppendingEllipsis]
action:@selector(showGuestAccountWindow:)
[adium.menuController addMenuItem:menuItem toLocation:LOC_File_Additions];
- * @brief Uninstall Plugin
@@ -79,8 +70,7 @@
//Remember the installed items so we can remove them later
- [installedMenuItems release];
- installedMenuItems = [menuItems retain];
+ installedMenuItems = menuItems; - (void)accountMenu:(AIAccountMenu *)inAccountMenu didSelectAccount:(AIAccount *)inAccount {
[inAccount toggleOnline];
@@ -98,12 +88,12 @@
- (NSMenuItem *)accountMenuSpecialMenuItem:(AIAccountMenu *)inAccountMenu
- NSMenuItem *menuItem = [[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:AILocalizedString(@"Connect All Accounts",nil)
+ NSMenuItem *menuItem = [[NSMenuItem alloc] initWithTitle:AILocalizedString(@"Connect All Accounts",nil) action:@selector(connectAllAccounts:)
[menuItem setKeyEquivalentModifierMask:NSCommandKeyMask];
- return [menuItem autorelease];
--- a/Source/AIAccountProxySettings.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Source/AIAccountProxySettings.m Sun Sep 09 12:24:39 2012 -0400
@@ -64,17 +64,6 @@
- [view_accountProxy release];
* Called when proxy usage is turned on or off
@@ -102,8 +91,7 @@
- (void)configureForAccount:(AIAccount *)inAccount
if (account != inAccount) {
- account = [inAccount retain];
[checkBox_useProxy setState:[[account preferenceForKey:KEY_ACCOUNT_PROXY_ENABLED
@@ -260,7 +248,7 @@
[proxyMenu addItem:[self _proxyMenuItemWithTitle:@"SOCKS5" tag:Adium_Proxy_SOCKS5]];
[proxyMenu addItem:[self _proxyMenuItemWithTitle:@"HTTP" tag:Adium_Proxy_HTTP]];
- return [proxyMenu autorelease];
@@ -272,13 +260,13 @@
- menuItem = [[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:title
+ menuItem = [[NSMenuItem alloc] initWithTitle:title action:@selector(changeProxyType:)
- return [menuItem autorelease];
--- a/Source/AIAddBookmarkPlugin.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Source/AIAddBookmarkPlugin.m Sun Sep 09 12:24:39 2012 -0400
@@ -54,14 +54,14 @@
action:@selector(addBookmark:)
- addBookmarkMenuItem = [[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:ADD_BOOKMARK
+ addBookmarkMenuItem = [[NSMenuItem alloc] initWithTitle:ADD_BOOKMARK action:@selector(addBookmark:)
[adium.menuController addMenuItem:addBookmarkMenuItem toLocation:LOC_Contact_Manage];
- addBookmarkContextMenuItem = [[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:ADD_BOOKMARK_CONTEXT_MENU
+ addBookmarkContextMenuItem = [[NSMenuItem alloc] initWithTitle:ADD_BOOKMARK_CONTEXT_MENU action:@selector(addBookmarkContext:)
@@ -75,9 +75,6 @@
- [addBookmarkMenuItem release];
- [addBookmarkContextMenuItem release];
[adium.toolbarController unregisterToolbarItem:addBookmarkToolbarItem forToolbarType:@"MessageWindow"];
--- a/Source/AIAddressBookInspectorPane.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Source/AIAddressBookInspectorPane.m Sun Sep 09 12:24:39 2012 -0400
@@ -44,14 +44,6 @@
- [inspectorContentView release]; inspectorContentView = nil;
- [addressBookPanel release]; addressBookPanel = nil;
return ADDRESS_BOOK_NIB_NAME;
@@ -67,11 +59,9 @@
//Hold onto the object, using the highest-up metacontact if necessary
- [displayedObject release];
displayedObject = ([inObject isKindOfClass:[AIListContact class]] ?
[(AIListContact *)inObject parentContact] :
- [displayedObject retain];
if ((currentNotes = [displayedObject notes])) {
--- a/Source/AIAdium.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Source/AIAdium.m Sun Sep 09 12:24:39 2012 -0400
@@ -175,7 +175,7 @@
* Menu and interface controllers are created by MainMenu.nib when it loads.
@@ -198,17 +198,17 @@
applescriptabilityController = [[ESApplescriptabilityController alloc] init];
statusController = [[AIStatusController alloc] init];
- //Finish setting up the preference controller before the components and plugins load so they can read prefs
+ //Finish setting up the preference controller before the components and plugins load so they can read prefs [preferenceController controllerDidLoad];
[debugController controllerDidLoad];
//Plugins and components should always init last, since they rely on everything else.
componentLoader = [[AICoreComponentLoader alloc] init];
pluginLoader = [[AICorePluginLoader alloc] init];
[menuController controllerDidLoad]; //Loaded by nib
@@ -220,7 +220,7 @@
[contactController controllerDidLoad]; //** Before interfaceController so the contact list is available to the interface
[interfaceController controllerDidLoad]; //Loaded by nib
[toolbarController controllerDidLoad];
[contactAlertsController controllerDidLoad];
@@ -231,32 +231,31 @@
[dockController controllerDidLoad];
[fileTransferController controllerDidLoad];
[applescriptabilityController controllerDidLoad];
[statusController controllerDidLoad];
//Open the preferences if we were unable to because application:openFile: was called before we got here
[self openAppropriatePreferencesIfNeeded];
//If no accounts are setup, run the setup wizard
if (accountController.accounts.count == 0 || ALWAYS_RUN_SETUP_WIZARD) {
[AdiumSetupWizard runWizard];
- //Process any delayed URL events
+ //Process any delayed URL events for (NSString *eventString in queuedURLEvents) {
[[NSNotificationCenter defaultCenter] postNotificationName:AIURLHandleNotification object:eventString];
- [queuedURLEvents release]; queuedURLEvents = nil;
//If we were asked to open a log at launch, do it now
if (queuedLogPathToShow) {
[[NSNotificationCenter defaultCenter] postNotificationName:AIShowLogAtPathNotification
- object:queuedLogPathToShow];
- [queuedLogPathToShow release];
+ object:queuedLogPathToShow]; completedApplicationLoad = YES;
@@ -270,11 +269,12 @@
connection = [[NSConnection alloc] init];
[connection setRootObject:self];
[connection registerName:@"com.adiumX.adiumX"];
[[AIContactObserverManager sharedManager] delayListObjectNotifications];
[[NSNotificationCenter defaultCenter] postNotificationName:AIApplicationDidFinishLoadingNotification object:nil];
[[NSDistributedNotificationCenter defaultCenter] postNotificationName:AIApplicationDidFinishLoadingNotification object:nil];
[[AIContactObserverManager sharedManager] endListObjectNotificationsDelay];
@@ -295,33 +295,42 @@
group:@"Confirmations"] boolValue];
NSString *questionToAsk = [NSString string];
- SEL questionSelector = nil;
+ void (^responseHandler)(AITextAndButtonsReturnCode ret, BOOL suppressed, id userInfo) = nil; NSApplicationTerminateReply allowQuit = NSTerminateNow;
switch (confirmationType) {
- case AIQuitConfirmAlways:
- questionSelector = @selector(confirmQuitQuestion:userInfo:suppression:);
+ case AIQuitConfirmAlways: { + responseHandler = [^(AITextAndButtonsReturnCode ret, BOOL suppressed, id userInfo) { + [self confirmQuitQuestion:[NSNumber numberWithInteger:ret] userInfo:userInfo suppression:[NSNumber numberWithBool:suppressed]]; allowQuit = NSTerminateLater;
- case AIQuitConfirmSelective:
+ case AIQuitConfirmSelective: { if ([chatController unviewedContentCount] > 0 && confirmUnreadMessages) {
questionToAsk = (([chatController unviewedContentCount] > 1) ? [NSString stringWithFormat:AILocalizedString(@"You have %d unread messages.",@"Quit Confirmation"), [chatController unviewedContentCount]] : AILocalizedString(@"You have an unread message.",@"Quit Confirmation"));
- questionSelector = @selector(unreadQuitQuestion:userInfo:suppression:);
+ responseHandler = [^(AITextAndButtonsReturnCode ret, BOOL suppressed, id userInfo) { + [self unreadQuitQuestion:[NSNumber numberWithInteger:ret] userInfo:userInfo suppression:[NSNumber numberWithBool:suppressed]]; allowQuit = NSTerminateLater;
} else if ([fileTransferController activeTransferCount] > 0 && confirmFileTransfers) {
questionToAsk = (([fileTransferController activeTransferCount] > 1) ? [NSString stringWithFormat:AILocalizedString(@"You have %d file transfers in progress.",@"Quit Confirmation"), [fileTransferController activeTransferCount]] : AILocalizedString(@"You have a file transfer in progress.",@"Quit Confirmation"));
- questionSelector = @selector(fileTransferQuitQuestion:userInfo:suppression:);
+ responseHandler = [^(AITextAndButtonsReturnCode ret, BOOL suppressed, id userInfo) { + [self fileTransferQuitQuestion:[NSNumber numberWithInteger:ret] userInfo:userInfo suppression:[NSNumber numberWithBool:suppressed]]; allowQuit = NSTerminateLater;
} else if ([[chatController openChats] count] > 0 && confirmOpenChats) {
questionToAsk = (([[chatController openChats] count] > 1) ? [NSString stringWithFormat:AILocalizedString(@"You have %d open chats.",@"Quit Confirmation"), [[chatController openChats] count]] : AILocalizedString(@"You have an open chat.",@"Quit Confirmation"));
- questionSelector = @selector(openChatQuitQuestion:userInfo:suppression:);
+ responseHandler = [^(AITextAndButtonsReturnCode ret, BOOL suppressed, id userInfo) { + [self openChatQuitQuestion:[NSNumber numberWithInteger:ret] userInfo:userInfo suppression:[NSNumber numberWithBool:suppressed]]; allowQuit = NSTerminateLater;
if (allowQuit == NSTerminateLater) {
@@ -334,9 +343,7 @@
alternateButton:AILocalizedString(@"Cancel", nil)
suppression:AILocalizedString(@"Don't ask again", nil)
- selector:questionSelector
+ responseHandler:responseHandler]; @@ -348,7 +355,7 @@
//Take no action if we didn't complete the application load
if (!completedApplicationLoad) return;
- [connection release]; connection = nil;
@@ -556,7 +563,7 @@
//Queue the request until Adium is done launching if Adium is not ready
- [queuedLogPathToShow release]; queuedLogPathToShow = [filename retain];
+ queuedLogPathToShow = filename; //Don't continue to the xtras installation code. Return YES because we handled the open.
@@ -565,8 +572,8 @@
/* Installation of Xtras below this point */
- [prefsCategory release]; prefsCategory = nil;
- [advancedPrefsName release]; advancedPrefsName = nil;
+ advancedPrefsName = nil; /* Specify a file extension and a human-readable description of what the files of this type do
* We reassign the extension so that regardless of its original case we end up with the case we want; this allows installation of
@@ -737,8 +744,8 @@
//If the user didn't press the "open prefs" button, clear the pref opening information
- [prefsCategory release]; prefsCategory = nil;
- [advancedPrefsName release]; advancedPrefsName = nil;
+ advancedPrefsName = nil; @@ -769,7 +776,7 @@
[preferenceController openPreferencesToCategoryWithIdentifier:prefsCategory];
- [prefsCategory release]; prefsCategory = nil;
@@ -786,9 +793,9 @@
//Determine the preferences path if neccessary
if (!_preferencesFolderPath) {
- _preferencesFolderPath = [[[[[NSBundle mainBundle] infoDictionary] objectForKey:PORTABLE_ADIUM_KEY] stringByExpandingTildeInPath] retain];
+ _preferencesFolderPath = [[[[NSBundle mainBundle] infoDictionary] objectForKey:PORTABLE_ADIUM_KEY] stringByExpandingTildeInPath]; if (!_preferencesFolderPath)
- _preferencesFolderPath = [[[[NSHomeDirectory() stringByAppendingPathComponent:@"Library"] stringByAppendingPathComponent:@"Application Support"] stringByAppendingPathComponent:@"Adium 2.0"] retain];
+ _preferencesFolderPath = [[[NSHomeDirectory() stringByAppendingPathComponent:@"Library"] stringByAppendingPathComponent:@"Application Support"] stringByAppendingPathComponent:@"Adium 2.0"]; return _preferencesFolderPath;
@@ -955,7 +962,7 @@
static dispatch_once_t setCachesPath;
dispatch_once(&setCachesPath, ^{
- NSFileManager *defaultManager = [[[NSFileManager alloc] init] autorelease];
+ NSFileManager *defaultManager = [[NSFileManager alloc] init]; NSURL *generalCacheURL = [defaultManager URLForDirectory:NSCachesDirectory
inDomain:NSUserDomainMask
@@ -966,7 +973,7 @@
[defaultManager createDirectoryAtPath:cachesPath withIntermediateDirectories:YES attributes:nil error:NULL];
- return [cachesPath retain];
- (NSString *)pathOfPackWithName:(NSString *)name extension:(NSString *)extension resourceFolderName:(NSString *)folderName
@@ -1194,7 +1201,7 @@
- s = [[[version substringToIndex:1] mutableCopy] autorelease];
+ s = [[version substringToIndex:1] mutableCopy]; oldType = [self typeOfCharacter:s];
n = [version length] - 1;
for (i = 1; i <= n; ++i) {
@@ -1204,7 +1211,6 @@
// We've reached a new segment
NSString *aPart = [[NSString alloc] initWithString:s];
// Add character to string and continue
--- a/Source/AIAdvancedInspectorPane.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Source/AIAdvancedInspectorPane.m Sun Sep 09 12:24:39 2012 -0400
@@ -71,9 +71,9 @@
- accountMenu = [[AIAccountMenu accountMenuWithDelegate:self
+ accountMenu = [AIAccountMenu accountMenuWithDelegate:self submenuType:AIAccountNoSubmenu
- showTitleVerbs:NO] retain];
@@ -81,13 +81,12 @@
- [accountMenu release]; accountMenu = nil;
- [contactMenu release]; contactMenu = nil;
- [displayedObject release]; displayedObject = nil;
- [inspectorContentView release]; inspectorContentView = nil;
+ inspectorContentView = nil; [[NSNotificationCenter defaultCenter] removeObserver:self];
@@ -109,14 +108,10 @@
-(void)updateForListObject:(AIListObject *)inObject
if (displayedObject != inObject) {
- [displayedObject release];
displayedObject = ([inObject isKindOfClass:[AIListContact class]] ?
[(AIListContact *)inObject parentContact] :
- [displayedObject retain];
//Rebuild the account and contacts lists
@@ -188,8 +183,8 @@
// Instantiate here so we don't end up creating a massive menu for all contacts.
- contactMenu = [[AIContactMenu contactMenuWithDelegate:self
- forContactsInObject:displayedObject] retain];
+ contactMenu = [AIContactMenu contactMenuWithDelegate:self + forContactsInObject:displayedObject]; [contactMenu setContainingObject:displayedObject];
--- a/Source/AIAdvancedPreferencesPlugin.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Source/AIAdvancedPreferencesPlugin.m Sun Sep 09 12:24:39 2012 -0400
@@ -25,10 +25,10 @@
// Generic advanced panes with no specific plugins.
- messageAlertsPreferences = [(AIMessageAlertsAdvancedPreferences *)[AIMessageAlertsAdvancedPreferences preferencePane] retain];
- windowHandlingPreferences = [(AIWindowHandlingPreferences *)[AIWindowHandlingPreferences preferencePane] retain];
- messagePreferences = [(AIMessagePreferences *)[AIMessagePreferences preferencePane] retain];
- xtrasManager = [(AIXtrasManager *)[AIXtrasManager preferencePane] retain];
+ messageAlertsPreferences = (AIMessageAlertsAdvancedPreferences *)[AIMessageAlertsAdvancedPreferences preferencePane]; + windowHandlingPreferences = (AIWindowHandlingPreferences *)[AIWindowHandlingPreferences preferencePane]; + messagePreferences = (AIMessagePreferences *)[AIMessagePreferences preferencePane]; + xtrasManager = (AIXtrasManager *)[AIXtrasManager preferencePane]; --- a/Source/AIAliasSupportPlugin.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Source/AIAliasSupportPlugin.m Sun Sep 09 12:24:39 2012 -0400
@@ -63,15 +63,15 @@
forGroup:PREF_GROUP_DISPLAYFORMAT];
- menuItem_contactName = [[[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:CONTACT_NAME_MENU_TITLE
+ menuItem_contactName = [[NSMenuItem alloc] initWithTitle:CONTACT_NAME_MENU_TITLE - keyEquivalent:@""] autorelease];
//Add the menu item (which will have _contactNameMenu as its submenu)
[adium.menuController addMenuItem:menuItem_contactName toLocation:LOC_View_Additions];
- menu_contactSubmenu = [[self _contactNameMenu] retain];
+ menu_contactSubmenu = [self _contactNameMenu]; [menuItem_contactName setSubmenu:menu_contactSubmenu];
//Observe preferences changes
@@ -93,15 +93,6 @@
- [menu_contactSubmenu release];
* @brief Change the format for the long display name used in the contact list
* @param sender An NSMenuItem which was clicked. Its tag should be an AIDisplayNameType.
@@ -277,33 +268,33 @@
- choicesMenu = [[[NSMenu allocWithZone:[NSMenu menuZone]] initWithTitle:@""] autorelease];
+ choicesMenu = [[NSMenu alloc] initWithTitle:@""]; - menuItem = [[[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:ALIAS
+ menuItem = [[NSMenuItem alloc] initWithTitle:ALIAS action:@selector(changeFormat:)
- keyEquivalent:@""] autorelease];
[menuItem setTag:AINameFormat_DisplayName];
[choicesMenu addItem:menuItem];
- menuItem = [[[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:ALIAS_SCREENNAME
+ menuItem = [[NSMenuItem alloc] initWithTitle:ALIAS_SCREENNAME action:@selector(changeFormat:)
- keyEquivalent:@""] autorelease];
[menuItem setTag:AINameFormat_DisplayName_ScreenName];
[choicesMenu addItem:menuItem];
- menuItem = [[[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:SCREENNAME_ALIAS
+ menuItem = [[NSMenuItem alloc] initWithTitle:SCREENNAME_ALIAS action:@selector(changeFormat:)
- keyEquivalent:@""] autorelease];
[menuItem setTag:AINameFormat_ScreenName_DisplayName];
[choicesMenu addItem:menuItem];
- menuItem = [[[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:SCREENNAME
+ menuItem = [[NSMenuItem alloc] initWithTitle:SCREENNAME action:@selector(changeFormat:)
- keyEquivalent:@""] autorelease];
[menuItem setTag:AINameFormat_ScreenName];
[choicesMenu addItem:menuItem];
--- a/Source/AIAnimatingListOutlineView.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Source/AIAnimatingListOutlineView.m Sun Sep 09 12:24:39 2012 -0400
@@ -66,10 +66,6 @@
[animations makeObjectsPerformSelector:@selector(stopAnimation)];
- [allAnimatingItemsDict release];
@@ -123,7 +119,7 @@
- (NSRect)rectOfRow:(NSInteger)rowIndex
if (animationsCount > 0) {
- return [self currentDisplayRectForItemPointer:[NSValue valueWithPointer:[self itemAtRow:rowIndex]] atRow:rowIndex];
+ return [self currentDisplayRectForItemPointer:[NSValue valueWithPointer:(__bridge const void *)([self itemAtRow:rowIndex])] atRow:rowIndex]; return [super rectOfRow:rowIndex];
@@ -207,7 +203,7 @@
- if (item) [dict setObject:[NSNumber numberWithInteger:idx] forKey:[NSValue valueWithPointer:item]];
+ if (item) [dict setObject:[NSNumber numberWithInteger:idx] forKey:[NSValue valueWithPointer:(__bridge const void *)(item)]]; --- a/Source/AIAppearancePreferences.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Source/AIAppearancePreferences.m Sun Sep 09 12:24:39 2012 -0400
@@ -121,9 +121,9 @@
NSString *filenameExtension = [notification object];
//Convert our filename extension into a Uniform Type Identifier so that we can robustly determine what type of Xtra this is.
- CFStringRef type = (CFStringRef)[(NSString *)UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension,
- (CFStringRef)filenameExtension,
- /*inConformingToUTI*/ NULL) autorelease];
+ CFStringRef type = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, + (__bridge CFStringRef)filenameExtension, + /*inConformingToUTI*/ NULL); if (!type || UTTypeEqual(type, CFSTR("com.adiumx.emoticonset"))) {
[self _rebuildEmoticonMenuAndSelectActivePack];
@@ -248,7 +248,7 @@
} else if (sender == popUp_emoticons) {
if ([[sender selectedItem] tag] != AIEmoticonMenuMultiple) {
//Disable all active emoticons
- NSArray *activePacks = [[[adium.emoticonController activeEmoticonPacks] mutableCopy] autorelease];
+ NSArray *activePacks = [[adium.emoticonController activeEmoticonPacks] mutableCopy]; AIEmoticonPack *pack, *selectedPack;
selectedPack = [[sender selectedItem] representedObject];
@@ -283,24 +283,24 @@
- (NSMenu *)_emoticonPackMenu
- NSMenu *menu = [[NSMenu allocWithZone:[NSMenu menuZone]] init];
+ NSMenu *menu = [[NSMenu alloc] init]; //Add the "No Emoticons" option
- menuItem = [[[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:AILocalizedString(@"None",nil)
+ menuItem = [[NSMenuItem alloc] initWithTitle:AILocalizedString(@"None",nil) - keyEquivalent:@""] autorelease];
[menuItem setImage:[NSImage imageNamed:@"emoticonBlank" forClass:[self class]]];
[menuItem setTag:AIEmoticonMenuNone];
//Add the "Multiple packs selected" option
if ([[adium.emoticonController activeEmoticonPacks] count] > 1) {
- menuItem = [[[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:AILocalizedString(@"Multiple Packs Selected",nil)
+ menuItem = [[NSMenuItem alloc] initWithTitle:AILocalizedString(@"Multiple Packs Selected",nil) - keyEquivalent:@""] autorelease];
[menuItem setImage:[NSImage imageNamed:@"emoticonBlank" forClass:[self class]]];
[menuItem setTag:AIEmoticonMenuMultiple];
@@ -311,16 +311,16 @@
for (AIEmoticonPack *pack in [adium.emoticonController availableEmoticonPacks]) {
- menuItem = [[[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:[pack name]
+ menuItem = [[NSMenuItem alloc] initWithTitle:[pack name] - keyEquivalent:@""] autorelease];
[menuItem setRepresentedObject:pack];
[menuItem setImage:[pack menuPreviewImage]];
- return [menu autorelease];
//Dock icons -----------------------------------------------------------------------------------------------------------
@@ -352,10 +352,10 @@
- menuItem = [[[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:name
+ menuItem = [[NSMenuItem alloc] initWithTitle:name - keyEquivalent:@""] autorelease];
[menuItem setRepresentedObject:packName];
[menuItem setImage:[[preview image] imageByScalingForMenuItem]];
@@ -385,7 +385,7 @@
- (void)configureDockIconMenu
- NSMenu *tempMenu = [[[NSMenu allocWithZone:[NSMenu menuZone]] init] autorelease];
+ NSMenu *tempMenu = [[NSMenu alloc] init]; NSString *activePackName = [adium.preferenceController preferenceForKey:KEY_ACTIVE_DOCK_ICON
group:PREF_GROUP_APPEARANCE];
@@ -406,10 +406,10 @@
- (NSMenuItem *)menuItemForIconPackAtPath:(NSString *)packPath class:(Class)iconClass
NSString *name = [[packPath lastPathComponent] stringByDeletingPathExtension];
- NSMenuItem *menuItem = [[[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:name
+ NSMenuItem *menuItem = [[NSMenuItem alloc] initWithTitle:name - keyEquivalent:@""] autorelease];
[menuItem setRepresentedObject:name];
[menuItem setImage:[iconClass previewMenuImageForIconPackAtPath:packPath]];
@@ -438,7 +438,7 @@
- (void)configureStatusIconsMenu
- NSMenu *tempMenu = [[[NSMenu allocWithZone:[NSMenu menuZone]] init] autorelease];
+ NSMenu *tempMenu = [[NSMenu alloc] init]; NSString *activePackName = [adium.preferenceController preferenceForKey:KEY_STATUS_ICON_PACK
group:PREF_GROUP_APPEARANCE];
@@ -465,7 +465,7 @@
- (void)configureServiceIconsMenu
- NSMenu *tempMenu = [[[NSMenu allocWithZone:[NSMenu menuZone]] init] autorelease];
+ NSMenu *tempMenu = [[NSMenu alloc] init]; NSString *activePackName = [adium.preferenceController preferenceForKey:KEY_SERVICE_ICON_PACK
group:PREF_GROUP_APPEARANCE];
@@ -492,7 +492,7 @@
- (void)configureMenuBarIconsMenu
- NSMenu *tempMenu = [[[NSMenu allocWithZone:[NSMenu menuZone]] init] autorelease];
+ NSMenu *tempMenu = [[NSMenu alloc] init]; NSString *activePackName = [adium.preferenceController preferenceForKey:KEY_MENU_BAR_ICONS
group:PREF_GROUP_APPEARANCE];
--- a/Source/AIAppearancePreferencesPlugin.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Source/AIAppearancePreferencesPlugin.m Sun Sep 09 12:24:39 2012 -0400
@@ -47,7 +47,7 @@
forGroup:PREF_GROUP_APPEARANCE];
- preferences = [(AIAppearancePreferences *)[AIAppearancePreferences preferencePaneForPlugin:self] retain];
+ preferences = (AIAppearancePreferences *)[AIAppearancePreferences preferencePaneForPlugin:self]; [[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(invalidStatusSetActivated:)
@@ -276,7 +276,7 @@
NSMutableArray *setArray = [NSMutableArray array];
NSMutableSet *alreadyAddedArray = [NSMutableSet set];
- for (NSString *filePath in [adium allResourcesForName:folder withExtensions:extension]) {
+ for (__strong NSString *filePath in [adium allResourcesForName:folder withExtensions:extension]) { --- a/Source/AIApplication.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Source/AIApplication.m Sun Sep 09 12:24:39 2012 -0400
@@ -72,7 +72,7 @@
NSArray *windows = [self orderedWindows];
- NSMutableArray *chatWindows = [[[NSMutableArray alloc] init] autorelease];
+ NSMutableArray *chatWindows = [[NSMutableArray alloc] init]; for (NSInteger i=0;i<[windows count];i++)
if ([[windows objectAtIndex:i] isKindOfClass:[AIMessageWindow class]])
[chatWindows addObject:[windows objectAtIndex:i]];
--- a/Source/AIAutoLinkingPlugin.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Source/AIAutoLinkingPlugin.m Sun Sep 09 12:24:39 2012 -0400
@@ -53,8 +53,8 @@
NSUInteger stringLength = [replacementMessage length];
if([AHHyperlinkScanner isStringValidURI:[replacementMessage string] usingStrict:YES fromIndex:NULL withStatus:NULL schemeLength:NULL]){
- NSString *linkString = (NSString *)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault,
- (CFStringRef)[replacementMessage string],
+ NSString *linkString = (__bridge_transfer NSString *)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, + (__bridge CFStringRef)[replacementMessage string], @@ -64,7 +64,6 @@
range:NSMakeRange(0, [replacementMessage length])];
for (NSInteger i = 0; i < stringLength; i += linkRange.length) {
@@ -82,7 +81,7 @@
- return [replacementMessage autorelease];
+ return replacementMessage; --- a/Source/AIAutoReplyPlugin.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Source/AIAutoReplyPlugin.m Sun Sep 09 12:24:39 2012 -0400
@@ -77,9 +77,6 @@
[[AIContactObserverManager sharedManager] unregisterListObjectObserver:self];
- [receivedAutoReply release];
@@ -95,7 +92,7 @@
[inModifiedKeys containsObject:@"accountStatus"]) {
//Reset our list of contacts who have already received an auto-reply
- [receivedAutoReply release]; receivedAutoReply = [[NSMutableSet alloc] init];
+ receivedAutoReply = [[NSMutableSet alloc] init]; //Don't want to remove from the new set any chats which previously closed and are pending removal
[NSObject cancelPreviousPerformRequestsWithTarget:self];
@@ -155,7 +152,7 @@
if (!supportsAutoreply) {
//Tthe service isn't natively expecting an autoresponse, so make it a bit clearer what's going on
- NSMutableAttributedString *mutableAutoReply = [[autoReply mutableCopy] autorelease];
+ NSMutableAttributedString *mutableAutoReply = [autoReply mutableCopy]; [mutableAutoReply replaceCharactersInRange:NSMakeRange(0, 0)
withString:AILocalizedString(@"(Autoreply) ",
"Prefix to place before autoreplies on services which do not natively support them")];
--- a/Source/AIAutoScrollTextView.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Source/AIAutoScrollTextView.m Sun Sep 09 12:24:39 2012 -0400
@@ -30,12 +30,12 @@
- (void)loadText:(NSAttributedString *)textToLoad
- [self addTrackingArea:[[[NSTrackingArea alloc] initWithRect:[self bounds]
+ [self addTrackingArea:[[NSTrackingArea alloc] initWithRect:[self bounds] options:(NSTrackingMouseEnteredAndExited |
- userInfo:nil] autorelease]];
[[self textStorage] setAttributedString:textToLoad];
@@ -43,9 +43,7 @@
- [scrollTimer invalidate]; [scrollTimer release]; scrollTimer = nil;
+ [scrollTimer invalidate]; scrollTimer = nil; // When the user scrolls stop the automatic scrolling
@@ -90,16 +88,16 @@
scrollLocation = [[[self enclosingScrollView] contentView] bounds].origin.y + 7;
maxScroll = [[self textStorage] size].height;
- scrollTimer = [[NSTimer scheduledTimerWithTimeInterval:(1.0f / ABOUT_SCROLL_FPS)
+ scrollTimer = [NSTimer scheduledTimerWithTimeInterval:(1.0f / ABOUT_SCROLL_FPS) selector:@selector(scrollTimer:)
- [scrollTimer invalidate]; [scrollTimer release]; scrollTimer = nil;
+ [scrollTimer invalidate]; scrollTimer = nil; [[self enclosingScrollView] setHasVerticalScroller:YES];
--- a/Source/AIAutomaticStatus.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Source/AIAutomaticStatus.m Sun Sep 09 12:24:39 2012 -0400
@@ -140,25 +140,6 @@
- [accountsToReconnect release];
- [previousStatus release];
- [fastUserSwitchID release];
- [screenSaverID release];
- [idleStatusID release];
* @brief Preferences changed
* Note the status IDs, interval information, and enabled information for our preferences
@@ -178,19 +159,16 @@
idleReportInterval = [[prefDict objectForKey:KEY_STATUS_REPORT_IDLE_INTERVAL] doubleValue];
- [idleStatusID release];
- idleStatusID = [[prefDict objectForKey:KEY_STATUS_AUTO_AWAY_STATUS_STATE_ID] retain];
+ idleStatusID = [prefDict objectForKey:KEY_STATUS_AUTO_AWAY_STATUS_STATE_ID]; idleStatusEnabled = [[prefDict objectForKey:KEY_STATUS_AUTO_AWAY] boolValue];
idleStatusInterval = [[prefDict objectForKey:KEY_STATUS_AUTO_AWAY_INTERVAL] doubleValue];
- [fastUserSwitchID release];
- fastUserSwitchID = [[prefDict objectForKey:KEY_STATUS_FUS_STATUS_STATE_ID] retain];
+ fastUserSwitchID = [prefDict objectForKey:KEY_STATUS_FUS_STATUS_STATE_ID]; fastUserSwitchEnabled = [[prefDict objectForKey:KEY_STATUS_FUS] boolValue];
- [screenSaverID release];
- screenSaverID = [[prefDict objectForKey:KEY_STATUS_SS_STATUS_STATE_ID] retain];
+ screenSaverID = [prefDict objectForKey:KEY_STATUS_SS_STATUS_STATE_ID]; screenSaverEnabled = [[prefDict objectForKey:KEY_STATUS_SS] boolValue];
@@ -362,8 +340,7 @@
- oldStatusID = [statusID retain];
+ oldStatusID = statusID; @@ -397,7 +374,6 @@
automaticStatusBitMap = 0;
--- a/Source/AIChatConsolidationPlugin.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Source/AIChatConsolidationPlugin.m Sun Sep 09 12:24:39 2012 -0400
@@ -57,14 +57,6 @@
[adium.menuController addMenuItem:newWndowMenuItem toLocation:LOC_Window_Commands];
- [consolidateMenuItem release];
- [newWndowMenuItem release];
* @brief Consolidate chats
--- a/Source/AIChatController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Source/AIChatController.m Sun Sep 09 12:24:39 2012 -0400
@@ -106,19 +106,19 @@
//Ignore menu item for contacts in group chats
- menuItem_ignore = [[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:@""
+ menuItem_ignore = [[NSMenuItem alloc] initWithTitle:@"" action:@selector(toggleIgnoreOfContact:)
[adium.menuController addContextualMenuItem:menuItem_ignore toLocation:Context_Contact_GroupChat_ParticipantAction];
- menuItem_joinLeave = [[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:SHOW_JOIN_LEAVE_TITLE
+ menuItem_joinLeave = [[NSMenuItem alloc] initWithTitle:SHOW_JOIN_LEAVE_TITLE action:@selector(toggleShowJoinLeave:)
[adium.menuController addMenuItem:menuItem_joinLeave toLocation:LOC_Display_MessageControl];
- [adium.menuController addContextualMenuItem:[[menuItem_joinLeave copy] autorelease] toLocation:Context_GroupChat_Action];
+ [adium.menuController addContextualMenuItem:[menuItem_joinLeave copy] toLocation:Context_GroupChat_Action]; [adiumChatEvents controllerDidLoad];
@@ -142,10 +142,9 @@
//Every open chat is about to close. We perform the internal closing here rather than calling on the interface controller since the UI need not change.
//Also, we don't care for still processing content, the user won't see it anyway, and it can make Adium refuse to quit.
while ([openChats count] > 0) {
- AIChat *chat = [[openChats anyObject] retain];
+ AIChat *chat = [openChats anyObject]; if (mostRecentChat == chat) {
- [mostRecentChat release];
@@ -157,7 +156,6 @@
AILogWithSignature(@"Removed <<%@>> [%@]", chat, openChats);
@@ -166,11 +164,9 @@
- [openChats release]; openChats = nil;
- [chatObserverArray release]; chatObserverArray = nil;
+ chatObserverArray = nil; [[NSNotificationCenter defaultCenter] removeObserver:self];
@@ -555,10 +551,7 @@
shouldRemove = ![adium.contentController chatIsReceivingContent:inChat];
if (mostRecentChat == inChat) {
- [mostRecentChat release];
@@ -578,7 +571,6 @@
@@ -615,9 +607,6 @@
AIAccount *oldAccount = chat.account;
if (newAccount != oldAccount) {
- //Hang onto stuff until we're done
//Close down the chat on account A
[oldAccount closeChat:chat];
@@ -634,9 +623,6 @@
//Open the chat on account B
[newAccount openChat:chat];
@@ -656,9 +642,6 @@
if (newContact != chat.listObject) {
- //Hang onto stuff until we're done
//Close down the chat on the account, as the account may need to perform actions such as closing a connection
[chat.account closeChat:chat];
@@ -669,9 +652,6 @@
//Reopen the chat on the account
[chat.account openChat:chat];
@@ -750,7 +730,7 @@
- return [[openChats copy] autorelease];
+ return [openChats copy]; @@ -857,8 +837,7 @@
AIChat *chat = contentObject.chat;
if (chat != mostRecentChat) {
- [mostRecentChat release];
- mostRecentChat = [chat retain];
--- a/Source/AIChatLog.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Source/AIChatLog.m Sun Sep 09 12:24:39 2012 -0400
@@ -30,10 +30,10 @@
- (id)initWithPath:(NSString *)inPath from:(NSString *)inFrom to:(NSString *)inTo serviceClass:(NSString *)inServiceClass
if ((self = [super init])) {
- relativePath = [inPath retain];
- from = [inFrom retain];
- serviceClass = [inServiceClass retain];
+ serviceClass = inServiceClass; @@ -70,17 +70,6 @@
serviceClass:myServiceClass];
- [relativePath release];
- [serviceClass release];
- (NSString *)relativePath{
@@ -96,7 +85,7 @@
- (NSCalendarDate *)date{
//Determine the date of this log lazily
- date = [dateFromFileName([relativePath lastPathComponent]) retain];
+ date = dateFromFileName([relativePath lastPathComponent]); //Sometimes the filename doesn't have a date (e.g., “jdoe ((null)).chatlog”). In such cases, if it's a chatlog, parse it and get the date from the first element that has one.
@@ -105,7 +94,6 @@
NSXMLParser *parser = [[NSXMLParser alloc] initWithContentsOfURL:[NSURL fileURLWithPath:[[AILoggerPlugin logBasePath] stringByAppendingPathComponent:relativePath]]];
[parser setDelegate:self];
@@ -116,7 +104,7 @@
//Stop at the first element with a date.
NSString *dateString = nil;
if ((dateString = [attributeDict objectForKey:@"time"])) {
- date = [[NSCalendarDate calendarDateWithString:dateString strictly:YES] retain];
+ date = [NSCalendarDate calendarDateWithString:dateString strictly:YES]; --- a/Source/AIContactAwayPlugin.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Source/AIContactAwayPlugin.m Sun Sep 09 12:24:39 2012 -0400
@@ -135,7 +135,7 @@
NSString *awayDescription = [self awayDescriptionForObject:inObject];
entry = (awayDescription ?
- [[[NSAttributedString alloc] initWithString:awayDescription] autorelease] :
+ [[NSAttributedString alloc] initWithString:awayDescription] : @@ -146,7 +146,7 @@
/* We don't display tabs well in the tooltips because we use them for alignment, so
* turn them into 4 spaces. */
- NSMutableAttributedString *mutableStatusMessage = [[statusMessage mutableCopy] autorelease];
+ NSMutableAttributedString *mutableStatusMessage = [statusMessage mutableCopy]; [mutableStatusMessage replaceOccurrencesOfString:@"\t"
@@ -159,7 +159,7 @@
NSString *awayDescription = [self awayDescriptionForObject:inObject];
entry = (awayDescription ?
- [[[NSAttributedString alloc] initWithString:awayDescription] autorelease] :
+ [[NSAttributedString alloc] initWithString:awayDescription] : --- a/Source/AIContactController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Source/AIContactController.m Sun Sep 09 12:24:39 2012 -0400
@@ -172,17 +172,6 @@
[adium.preferenceController unregisterPreferenceObserver:self];
- [metaContactDict release];
- [contactToMetaContactLookupDict release];
- [contactLists release];
- [bookmarkDict release];
- [contactPropertiesObserverManager release];
- (void)clearAllMetaContactData
@@ -191,15 +180,15 @@
[contactPropertiesObserverManager delayListObjectNotifications];
//Remove all the metaContacts to get any existing objects out of them
- for (AIMetaContact *metaContact in [[[metaContactDict copy] autorelease] objectEnumerator]) {
+ for (AIMetaContact *metaContact in [[metaContactDict copy] objectEnumerator]) { [self explodeMetaContact:metaContact];
[contactPropertiesObserverManager endListObjectNotificationsDelay];
- [metaContactDict release]; metaContactDict = [[NSMutableDictionary alloc] init];
- [contactToMetaContactLookupDict release]; contactToMetaContactLookupDict = [[NSMutableDictionary alloc] init];
+ metaContactDict = [[NSMutableDictionary alloc] init]; + contactToMetaContactLookupDict = [[NSMutableDictionary alloc] init]; //Clear the preferences for good measure
[adium.preferenceController setPreference:nil
@@ -283,9 +272,6 @@
BOOL performedGrouping = NO;
- //Protect with a retain while we are removing and adding the contact to our arrays
if (listContact.canJoinMetaContacts) {
AIListObject *existingObject = [localGroup objectWithService:listContact.service UID:listContact.UID];
if (existingObject && (existingObject != listContact)) {
@@ -318,9 +304,6 @@
[self _didChangeContainer:localGroup object:listContact];
@@ -334,9 +317,6 @@
- (void)_moveContactLocally:(AIListContact *)listContact fromGroups:(NSSet *)oldGroups toGroups:(NSSet *)groups
if (![oldGroups isEqualToSet:groups]) {
- //Protect with a retain while we are removing and adding the contact to our arrays
[contactPropertiesObserverManager delayListObjectNotifications];
#ifdef CONTACT_MOVEMENT_DEBUG
@@ -356,8 +336,6 @@
[self _addContactLocally:listContact toGroup:group];
[contactPropertiesObserverManager endListObjectNotificationsDelay];
@@ -499,8 +477,6 @@
* this object's existence.
[contactPropertiesObserverManager _updateAllAttributesOfObject:metaContact];
@@ -665,9 +641,6 @@
AILogWithSignature(@"Updated %@'s containedContactsArray: %@", metaContact, containedContactsArray);
- [allMetaContactsDict release];
- [containedContactsArray release];
@@ -751,9 +724,6 @@
forKey:metaContactInternalObjectID];
[self _saveMetaContacts:newAllMetaContactsDict];
- [newContainedContactsArray release];
- [newAllMetaContactsDict release];
/* Remove all contacts matching this service/UID from the metacontact */
@@ -855,8 +825,6 @@
- [internalObjectIDs release];
@@ -935,9 +903,6 @@
//Then, procede to remove the metaContact
//Remove it from its containing groups (no contained contacts == present in no groups)
[metaContact restoreGrouping];
@@ -953,10 +918,6 @@
[self _saveMetaContacts:allMetaContactsDict];
[contactPropertiesObserverManager endListObjectNotificationsDelay];
- //Protection is overrated.
- [allMetaContactsDict release];
- (void)_saveMetaContacts:(NSDictionary *)allMetaContactsDict
@@ -1064,7 +1025,7 @@
- NSMutableArray *result = [[[NSMutableArray alloc] init] autorelease];
+ NSMutableArray *result = [[NSMutableArray alloc] init]; for (AIListContact *contact in self.contactEnumerator) {
/* We want only contacts, not metacontacts. For a given contact, -[contact parentContact] could be used to access the meta. */
@@ -1080,7 +1041,7 @@
- (NSArray *)allBookmarks
- return [[[bookmarkDict allValues] copy] autorelease];
+ return [[bookmarkDict allValues] copy]; @@ -1138,13 +1099,12 @@
NSMutableArray *groups = [groupsByList objectForKey:list.UID];
[groups sortUsingActiveSortControllerInContainer:list];
for (AIListGroup *group in groups) {
- NSMenuItem *menuItem = [[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:group.displayName
+ NSMenuItem *menuItem = [[NSMenuItem alloc] initWithTitle:group.displayName action:@selector(selectGroup:)
[menuItem setRepresentedObject:group];
@@ -1157,7 +1117,7 @@
- return [menu autorelease];
#pragma mark Retrieving Specific Contacts
@@ -1173,8 +1133,6 @@
- (void)setUID:(NSString *)UID forContact:(AIListContact *)contact
// Remove the old value, its internal ID is going to change.
[contactDict removeObjectForKey:contact.internalUniqueObjectID];
@@ -1183,8 +1141,6 @@
// Add it back int othe dict.
[contactDict setObject:contact forKey:contact.internalUniqueObjectID];
- (AIListContact *)contactWithService:(AIService *)inService account:(AIAccount *)inAccount UID:(NSString *)inUID
@@ -1220,8 +1176,6 @@
[contactPropertiesObserverManager _updateAllAttributesOfObject:contact];
@@ -1229,8 +1183,6 @@
- (void)accountDidStopTrackingContact:(AIListContact *)inContact
- [[inContact retain] autorelease];
for (id<AIContainingObject> container in inContact.containingObjects) {
[container removeObjectAfterAccountStopsTracking:inContact];
@@ -1283,7 +1235,7 @@
AIListBookmark *bookmark = [self existingBookmarkForChat:inChat];
- bookmark = [[[AIListBookmark alloc] initWithChat:inChat] autorelease];
+ bookmark = [[AIListBookmark alloc] initWithChat:inChat]; if ([bookmarkDict objectForKey:bookmark.internalObjectID]) {
// In case we end up with two bookmarks with the same internalObjectID; this should be almost impossible.
@@ -1401,7 +1353,6 @@
AIAccount *account = [adium.accountController preferredAccountForSendingContentType:CONTENT_MESSAGE_TYPE
toContact:tempListContact];
- [tempListContact release];
return [self contactWithService:theService account:account UID:inUID];
@@ -1458,7 +1409,6 @@
//Add to the contact list
[contactList addObject:group];
[self _didChangeContainer:contactList object:group];
@@ -1507,11 +1457,9 @@
//Then, procede to delete the group
[containingObject removeObject:group];
[groupDict removeObjectForKey:[group.UID lowercaseString]];
[self _didChangeContainer:containingObject object:group];
- (void)requestAddContactWithUID:(NSString *)contactUID service:(AIService *)inService account:(AIAccount *)inAccount
@@ -1594,7 +1542,6 @@
static NSInteger count = 0;
AIContactList *list = [[AIContactList alloc] initWithUID:[NSString stringWithFormat:@"Detached%ld",count++]];
[contactLists addObject:list];
--- a/Source/AIContactIdlePlugin.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Source/AIContactIdlePlugin.m Sun Sep 09 12:24:39 2012 -0400
@@ -55,21 +55,11 @@
//Stop tracking all idle handles
- [idleObjectTimer invalidate]; [idleObjectTimer release]; idleObjectTimer = nil;
+ [idleObjectTimer invalidate]; idleObjectTimer = nil; [[AIContactObserverManager sharedManager] unregisterListObjectObserver:self];
- [idleObjectArray release]; idleObjectArray = nil;
* @brief Update list object
* When the idleSince property changes, we start or stop tracking the object as appropriate.
@@ -87,11 +77,11 @@
idleObjectArray = [[NSMutableArray alloc] init];
- idleObjectTimer = [[NSTimer scheduledTimerWithTimeInterval:IDLE_UPDATE_INTERVAL
+ idleObjectTimer = [NSTimer scheduledTimerWithTimeInterval:IDLE_UPDATE_INTERVAL selector:@selector(updateIdleObjectsTimer:)
[idleObjectArray addObject:inObject];
@@ -103,8 +93,8 @@
//Stop tracking the handle
[idleObjectArray removeObject:inObject];
if ([idleObjectArray count] == 0) {
- [idleObjectTimer invalidate]; [idleObjectTimer release]; idleObjectTimer = nil;
- [idleObjectArray release]; idleObjectArray = nil;
+ [idleObjectTimer invalidate]; idleObjectTimer = nil; //Set the correct idle value
@@ -200,7 +190,7 @@
entry = [[NSAttributedString alloc] initWithString:[NSDateFormatter stringForTimeInterval:(idleMinutes * 60.0)]];
- return [entry autorelease];
- (BOOL)shouldDisplayInContactInspector
--- a/Source/AIContactInfoContentController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Source/AIContactInfoContentController.m Sun Sep 09 12:24:39 2012 -0400
@@ -24,7 +24,7 @@
+ (AIContactInfoContentController *)defaultInfoContentController
- return [[[self alloc] initWithContentPanes:[self defaultPanes]] autorelease];
+ return [[self alloc] initWithContentPanes:[self defaultPanes]]; - (id)initWithContentPanes:(NSArray *)panes
@@ -36,12 +36,6 @@
@@ -58,8 +52,7 @@
if (loadedPanes != newPanes)
- loadedPanes = [newPanes retain];
+ loadedPanes = newPanes; @@ -76,7 +69,7 @@
- [contentArray addObject:[[[paneClass alloc] init] autorelease]];
+ [contentArray addObject:[[paneClass alloc] init]]; [self _setLoadedPanes:contentArray];
--- a/Source/AIContactInfoImageViewWithImagePicker.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Source/AIContactInfoImageViewWithImagePicker.m Sun Sep 09 12:24:39 2012 -0400
@@ -55,8 +55,6 @@
[self removeTrackingRect:resetImageTrackingTag];
resetImageTrackingTag = -1;
--- a/Source/AIContactInfoWindowController.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Source/AIContactInfoWindowController.m Sun Sep 09 12:24:39 2012 -0400
@@ -122,7 +122,7 @@
if (sharedContactInfoInstance) {
[sharedContactInfoInstance closeWindow:nil];
- [sharedContactInfoInstance release]; sharedContactInfoInstance = nil;
+ sharedContactInfoInstance = nil; @@ -133,13 +133,11 @@
[self setDisplayedListObject:nil];
- [displayedObject release]; displayedObject = nil;
- [loadedContent release]; loadedContent = nil;
- [contentController release]; contentController = nil;
+ contentController = nil; [[NSNotificationCenter defaultCenter] removeObserver:self];
@@ -154,11 +152,11 @@
//If we are on Leopard, we want our panel to have a finder-esque look.
- contentController = [[AIContactInfoContentController defaultInfoContentController] retain];
+ contentController = [AIContactInfoContentController defaultInfoContentController]; //Load the content array from the content controller.
- loadedContent = [[contentController loadedPanes] retain];
+ loadedContent = [contentController loadedPanes]; //Monitor the selected contact
@@ -201,7 +199,7 @@
forKey:KEY_INFO_SELECTED_CATEGORY
group:PREF_GROUP_WINDOW_POSITIONS];
- [sharedContactInfoInstance autorelease]; sharedContactInfoInstance = nil;
+ sharedContactInfoInstance = nil; [super windowWillClose:inNotification];
@@ -268,9 +266,8 @@
[notificationUserInfo setObject:inObject
forKey:KEY_NEW_INSPECTED_OBJECT];
- [displayedObject release];
- displayedObject = [inObject retain];
+ displayedObject = inObject; //Ensure our window is loaded
@@ -353,7 +350,6 @@
[viewAnim startAnimation];
-(void)animateViewOut:(NSView *)aView;
@@ -376,8 +372,6 @@
[viewAnim startAnimation];
--- a/Source/AIContactInfoWindowPlugin.m Thu Sep 06 21:09:42 2012 +0200
+++ b/Source/AIContactInfoWindowPlugin.m Sun Sep 09 12:24:39 2012 -0400
@@ -132,21 +132,21 @@
- (void)prepareContactInfo
//Add our get info contextual menu item
- menuItem_getInfoContextualContact = [[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:VIEW_CONTACTS_INFO
+ menuItem_getInfoContextualContact = [[NSMenuItem alloc] initWithTitle:VIEW_CONTACTS_INFO action:@selector(showContactInfo:)
[adium.menuController addContextualMenuItem:menuItem_getInfoContextualContact
toLocation:Context_Contact_Manage];
- menuItem_getInfoContextualGroup = [[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:VIEW_CONTACTS_INFO
+ menuItem_getInfoContextualGroup = [[NSMenuItem alloc] initWithTitle:VIEW_CONTACTS_INFO action:@selector(showContactInfo:)
[adium.menuController addContextualMenuItem:menuItem_getInfoContextualGroup
toLocation:Context_Group_Manage];
- menuItem_getInfoContextualGroupChat = [[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:VIEW_BOOKMARK_GET_INFO
+ menuItem_getInfoContextualGroupChat = [[NSMenuItem alloc] initWithTitle:VIEW_BOOKMARK_GET_INFO action:@selector(showBookmarkInfo:)
@@ -154,7 +154,7 @@
//Install the standard Get Info menu item which will always be command-shift-I
- menuItem_getInfo = [[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:VIEW_CONTACTS_INFO
+ menuItem_getInfo = [[NSMenuItem alloc] initWithTitle:VIEW_CONTACTS_INFO action:@selector(showContactInfo:)
@@ -164,7 +164,7 @@
/* Install the alternate Get Info menu item which will be alternately command-I and command-shift-I, in the contact list