adium 2164:7e801114ebf5: Assorted cleanup. Fast enumeration, ear...

commits at adium.im commits at adium.im
Tue May 12 23:55:48 UTC 2009


details:	http://hg.adium.im/adium/rev/7e801114ebf5
revision:	2164:7e801114ebf5
author:		David Smith <catfish.man at gmail.com>
date:		Fri May 08 21:54:27 2009 -0700

Assorted cleanup. Fast enumeration, early returns, indenting, simplification
Subject: adium 2165:8b455a7d180d: Remove sound caching

details:	http://hg.adium.im/adium/rev/8b455a7d180d
revision:	2165:8b455a7d180d
author:		David Smith <catfish.man at gmail.com>
date:		Sun May 10 15:45:25 2009 -0700

Remove sound caching
Subject: adium 2166:e81e915ee81e: Make sure that bookmarks really end up in the right group on creation; fixes groups appearing when creating bookmarks with groups turned off

details:	http://hg.adium.im/adium/rev/e81e915ee81e
revision:	2166:e81e915ee81e
author:		David Smith <catfish.man at gmail.com>
date:		Sun May 10 19:08:41 2009 -0700

Make sure that bookmarks really end up in the right group on creation; fixes groups appearing when creating bookmarks with groups turned off
Subject: adium 2167:4f6047ac9ac3: Remove unused functions

details:	http://hg.adium.im/adium/rev/4f6047ac9ac3
revision:	2167:4f6047ac9ac3
author:		David Smith <catfish.man at gmail.com>
date:		Sun May 10 19:15:04 2009 -0700

Remove unused functions
Subject: adium 2168:01f117b212fd: Switch back to NSOperationQueue, now that it's fixed (in 10.5.7)

details:	http://hg.adium.im/adium/rev/01f117b212fd
revision:	2168:01f117b212fd
author:		David Smith <catfish.man at gmail.com>
date:		Tue May 12 15:58:06 2009 -0700

Switch back to NSOperationQueue, now that it's fixed (in 10.5.7)

diffstat:

 Adium.xcodeproj/project.pbxproj                                             |   40 -
 Frameworks/AIUtilities Framework/Source/AIDictionaryAdditions.m             |    4 +-
 Frameworks/AIUtilities Framework/Source/AIFunctions.m                       |   48 --
 Frameworks/AIUtilities Framework/Source/AIObjectAdditions.h                 |    5 -
 Frameworks/AIUtilities Framework/Source/AISharedWriterQueue.h               |    4 +-
 Frameworks/AIUtilities Framework/Source/AISharedWriterQueue.m               |   22 +-
 Frameworks/AIUtilities Framework/Source/AITableViewAdditions.h              |    2 +-
 Frameworks/AIUtilities Framework/Source/AITableViewAdditions.m              |    2 +-
 Frameworks/AIUtilities Framework/Source/RAOperationQueue/RAAtomicList.h     |   21 -
 Frameworks/AIUtilities Framework/Source/RAOperationQueue/RAAtomicList.m     |   74 ---
 Frameworks/AIUtilities Framework/Source/RAOperationQueue/RALatchTrigger.h   |   49 --
 Frameworks/AIUtilities Framework/Source/RAOperationQueue/RALatchTrigger.m   |   82 ---
 Frameworks/AIUtilities Framework/Source/RAOperationQueue/RAOperation.h      |   41 -
 Frameworks/AIUtilities Framework/Source/RAOperationQueue/RAOperation.m      |   99 ----
 Frameworks/AIUtilities Framework/Source/RAOperationQueue/RAOperationQueue.h |   22 -
 Frameworks/AIUtilities Framework/Source/RAOperationQueue/RAOperationQueue.m |  182 --------
 Frameworks/Adium Framework/Source/AIAddressBookController.m                 |    3 +-
 Frameworks/Adium Framework/Source/AIContactControllerProtocol.h             |    2 +-
 Frameworks/Adium Framework/Source/AIListBookmark.m                          |   25 +-
 Frameworks/Adium Framework/Source/AIMetaContact.m                           |   65 +--
 Frameworks/Adium Framework/Source/AISoundControllerProtocol.h               |    4 +-
 Plugins/Emoticons/AIEmoticonPreferences.m                                   |  217 ++++-----
 Plugins/Twitter Plugin/AITwitterAccount.m                                   |    3 +-
 Source/AIAddBookmarkPlugin.m                                                |    4 +-
 Source/AIContactController.m                                                |   11 +-
 Source/AIEventSoundsPlugin.m                                                |    8 +-
 Source/AILogViewerWindowController.m                                        |    4 +-
 Source/AISoundController.m                                                  |   10 +-
 Source/AIXMLAppender.m                                                      |   10 +-
 Source/AdiumSound.h                                                         |   14 +-
 Source/AdiumSound.m                                                         |  200 ++------
 Source/ESAwayStatusWindowController.m                                       |    2 +-
 Source/ESEventSoundAlertDetailPane.m                                        |    7 +-
 Source/ESGlobalEventsPreferences.m                                          |   15 +-
 Source/LNAboutBoxController.m                                               |    4 +-
 35 files changed, 251 insertions(+), 1054 deletions(-)

diffs (truncated from 2005 to 1000 lines):

diff -r 2cc01561d768 -r 01f117b212fd Adium.xcodeproj/project.pbxproj
--- a/Adium.xcodeproj/project.pbxproj	Tue May 12 14:21:30 2009 -0400
+++ b/Adium.xcodeproj/project.pbxproj	Tue May 12 15:58:06 2009 -0700
@@ -1239,14 +1239,6 @@
 		633400640F9C14C2003C77A9 /* AIScaledImageCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 6334FF910F9C14C0003C77A9 /* AIScaledImageCell.m */; };
 		633400650F9C14C2003C77A9 /* AIVerticallyCenteredTextCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 6334FF930F9C14C0003C77A9 /* AIVerticallyCenteredTextCell.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		633400660F9C14C2003C77A9 /* AIVerticallyCenteredTextCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 6334FF940F9C14C0003C77A9 /* AIVerticallyCenteredTextCell.m */; };
-		633400670F9C14C2003C77A9 /* RAOperationQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = 6334FF970F9C14C0003C77A9 /* RAOperationQueue.m */; };
-		633400680F9C14C2003C77A9 /* RAOperationQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = 6334FF980F9C14C0003C77A9 /* RAOperationQueue.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		633400690F9C14C2003C77A9 /* RAOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 6334FF990F9C14C0003C77A9 /* RAOperation.m */; };
-		6334006A0F9C14C2003C77A9 /* RAOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = 6334FF9A0F9C14C0003C77A9 /* RAOperation.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		6334006B0F9C14C2003C77A9 /* RALatchTrigger.m in Sources */ = {isa = PBXBuildFile; fileRef = 6334FF9B0F9C14C0003C77A9 /* RALatchTrigger.m */; };
-		6334006C0F9C14C2003C77A9 /* RALatchTrigger.h in Headers */ = {isa = PBXBuildFile; fileRef = 6334FF9C0F9C14C0003C77A9 /* RALatchTrigger.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		6334006D0F9C14C2003C77A9 /* RAAtomicList.m in Sources */ = {isa = PBXBuildFile; fileRef = 6334FF9D0F9C14C0003C77A9 /* RAAtomicList.m */; };
-		6334006E0F9C14C2003C77A9 /* RAAtomicList.h in Headers */ = {isa = PBXBuildFile; fileRef = 6334FF9E0F9C14C0003C77A9 /* RAAtomicList.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		633400710F9C14C2003C77A9 /* AISendingTextView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6334FFA30F9C14C0003C77A9 /* AISendingTextView.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		633400720F9C14C2003C77A9 /* AISendingTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6334FFA40F9C14C0003C77A9 /* AISendingTextView.m */; };
 		633400730F9C14C2003C77A9 /* AIAutoScrollView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6334FFA70F9C14C0003C77A9 /* AIAutoScrollView.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -4198,14 +4190,6 @@
 		6334FF910F9C14C0003C77A9 /* AIScaledImageCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AIScaledImageCell.m; path = "Frameworks/AIUtilities Framework/Source/AIScaledImageCell.m"; sourceTree = "<group>"; };
 		6334FF930F9C14C0003C77A9 /* AIVerticallyCenteredTextCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AIVerticallyCenteredTextCell.h; path = "Frameworks/AIUtilities Framework/Source/AIVerticallyCenteredTextCell.h"; sourceTree = "<group>"; };
 		6334FF940F9C14C0003C77A9 /* AIVerticallyCenteredTextCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AIVerticallyCenteredTextCell.m; path = "Frameworks/AIUtilities Framework/Source/AIVerticallyCenteredTextCell.m"; sourceTree = "<group>"; };
-		6334FF970F9C14C0003C77A9 /* RAOperationQueue.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RAOperationQueue.m; path = "Frameworks/AIUtilities Framework/Source/RAOperationQueue/RAOperationQueue.m"; sourceTree = "<group>"; };
-		6334FF980F9C14C0003C77A9 /* RAOperationQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RAOperationQueue.h; path = "Frameworks/AIUtilities Framework/Source/RAOperationQueue/RAOperationQueue.h"; sourceTree = "<group>"; };
-		6334FF990F9C14C0003C77A9 /* RAOperation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RAOperation.m; path = "Frameworks/AIUtilities Framework/Source/RAOperationQueue/RAOperation.m"; sourceTree = "<group>"; };
-		6334FF9A0F9C14C0003C77A9 /* RAOperation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RAOperation.h; path = "Frameworks/AIUtilities Framework/Source/RAOperationQueue/RAOperation.h"; sourceTree = "<group>"; };
-		6334FF9B0F9C14C0003C77A9 /* RALatchTrigger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RALatchTrigger.m; path = "Frameworks/AIUtilities Framework/Source/RAOperationQueue/RALatchTrigger.m"; sourceTree = "<group>"; };
-		6334FF9C0F9C14C0003C77A9 /* RALatchTrigger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RALatchTrigger.h; path = "Frameworks/AIUtilities Framework/Source/RAOperationQueue/RALatchTrigger.h"; sourceTree = "<group>"; };
-		6334FF9D0F9C14C0003C77A9 /* RAAtomicList.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RAAtomicList.m; path = "Frameworks/AIUtilities Framework/Source/RAOperationQueue/RAAtomicList.m"; sourceTree = "<group>"; };
-		6334FF9E0F9C14C0003C77A9 /* RAAtomicList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RAAtomicList.h; path = "Frameworks/AIUtilities Framework/Source/RAOperationQueue/RAAtomicList.h"; sourceTree = "<group>"; };
 		6334FFA30F9C14C0003C77A9 /* AISendingTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AISendingTextView.h; path = "Frameworks/AIUtilities Framework/Source/AISendingTextView.h"; sourceTree = "<group>"; };
 		6334FFA40F9C14C0003C77A9 /* AISendingTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AISendingTextView.m; path = "Frameworks/AIUtilities Framework/Source/AISendingTextView.m"; sourceTree = "<group>"; };
 		6334FFA70F9C14C0003C77A9 /* AIAutoScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AIAutoScrollView.h; path = "Frameworks/AIUtilities Framework/Source/AIAutoScrollView.h"; sourceTree = "<group>"; };
@@ -7754,26 +7738,10 @@
 			isa = PBXGroup;
 			children = (
 				6334FFA20F9C14C0003C77A9 /* Text view observing return & enter */,
-				6334FF960F9C14C0003C77A9 /* Operation queue that doesn't crash so much */,
 			);
 			name = "Working Around System Bugs";
 			sourceTree = "<group>";
 		};
-		6334FF960F9C14C0003C77A9 /* Operation queue that doesn't crash so much */ = {
-			isa = PBXGroup;
-			children = (
-				6334FF970F9C14C0003C77A9 /* RAOperationQueue.m */,
-				6334FF980F9C14C0003C77A9 /* RAOperationQueue.h */,
-				6334FF990F9C14C0003C77A9 /* RAOperation.m */,
-				6334FF9A0F9C14C0003C77A9 /* RAOperation.h */,
-				6334FF9B0F9C14C0003C77A9 /* RALatchTrigger.m */,
-				6334FF9C0F9C14C0003C77A9 /* RALatchTrigger.h */,
-				6334FF9D0F9C14C0003C77A9 /* RAAtomicList.m */,
-				6334FF9E0F9C14C0003C77A9 /* RAAtomicList.h */,
-			);
-			name = "Operation queue that doesn't crash so much";
-			sourceTree = "<group>";
-		};
 		6334FFA20F9C14C0003C77A9 /* Text view observing return & enter */ = {
 			isa = PBXGroup;
 			children = (
@@ -9060,10 +9028,6 @@
 				633400610F9C14C2003C77A9 /* AIImageTextCell.h in Headers */,
 				633400630F9C14C2003C77A9 /* AIScaledImageCell.h in Headers */,
 				633400650F9C14C2003C77A9 /* AIVerticallyCenteredTextCell.h in Headers */,
-				633400680F9C14C2003C77A9 /* RAOperationQueue.h in Headers */,
-				6334006A0F9C14C2003C77A9 /* RAOperation.h in Headers */,
-				6334006C0F9C14C2003C77A9 /* RALatchTrigger.h in Headers */,
-				6334006E0F9C14C2003C77A9 /* RAAtomicList.h in Headers */,
 				633400710F9C14C2003C77A9 /* AISendingTextView.h in Headers */,
 				633400730F9C14C2003C77A9 /* AIAutoScrollView.h in Headers */,
 				633400770F9C14C2003C77A9 /* AIApplicationAdditions.h in Headers */,
@@ -10557,10 +10521,6 @@
 				633400620F9C14C2003C77A9 /* AIImageTextCell.m in Sources */,
 				633400640F9C14C2003C77A9 /* AIScaledImageCell.m in Sources */,
 				633400660F9C14C2003C77A9 /* AIVerticallyCenteredTextCell.m in Sources */,
-				633400670F9C14C2003C77A9 /* RAOperationQueue.m in Sources */,
-				633400690F9C14C2003C77A9 /* RAOperation.m in Sources */,
-				6334006B0F9C14C2003C77A9 /* RALatchTrigger.m in Sources */,
-				6334006D0F9C14C2003C77A9 /* RAAtomicList.m in Sources */,
 				633400720F9C14C2003C77A9 /* AISendingTextView.m in Sources */,
 				633400740F9C14C2003C77A9 /* AIAutoScrollView.m in Sources */,
 				633400780F9C14C2003C77A9 /* AIApplicationAdditions.m in Sources */,
diff -r 2cc01561d768 -r 01f117b212fd Frameworks/AIUtilities Framework/Source/AIDictionaryAdditions.m
--- a/Frameworks/AIUtilities Framework/Source/AIDictionaryAdditions.m	Tue May 12 14:21:30 2009 -0400
+++ b/Frameworks/AIUtilities Framework/Source/AIDictionaryAdditions.m	Tue May 12 15:58:06 2009 -0700
@@ -21,7 +21,7 @@
 #import "AIFileManagerAdditions.h"
 #import "AISharedWriterQueue.h"
 
- at interface AIWriteDictionaryOperation : RAOperation 
+ at interface AIWriteDictionaryOperation : NSOperation 
 {
 	NSString *path;
 	NSString *name;
@@ -52,7 +52,7 @@
 	[super dealloc];
 }
 
-- (void) run
+- (void) main
 {
 	[dict writeToPath:path withName:name];
 }
diff -r 2cc01561d768 -r 01f117b212fd Frameworks/AIUtilities Framework/Source/AIFunctions.m
--- a/Frameworks/AIUtilities Framework/Source/AIFunctions.m	Tue May 12 14:21:30 2009 -0400
+++ b/Frameworks/AIUtilities Framework/Source/AIFunctions.m	Tue May 12 15:58:06 2009 -0700
@@ -51,54 +51,6 @@
 	}
 }
 
-//this uses the algorithm employed by Darwin 7.x's rm(1).
-void AIWipeMemory(void *buf, size_t len)
-{
-	if (buf) {
-		char *buf_char = buf;
-		for (unsigned long i = 0; i < len; ++i) {
-			buf_char[i] = 0xff;
-			buf_char[i] = 0x00;
-			buf_char[i] = 0xff;
-		}
-	}
-}
-
-void *AIReallocWired(void *oldBuf, size_t newLen)
-{
-	void *newBuf = malloc(newLen);
-	if (!newBuf) {
-		NSLog(@"in AIReallocWired: could not allocate %lu bytes", (unsigned long)newLen);
-	} else {
-		int mlock_retval = mlock(newBuf, newLen);
-		if (mlock_retval < 0) {
-			NSLog(@"in AIReallocWired: could not wire %lu bytes", (unsigned long)newLen);
-			free(newBuf);
-			newBuf = NULL;
-		} else if (oldBuf) {
-			size_t  oldLen = malloc_size(oldBuf);
-			size_t copyLen = MIN(newLen, oldLen);
-
-			memcpy(newBuf, oldBuf, copyLen);
-
-			AIWipeMemory(oldBuf, oldLen);
-			munlock(oldBuf, oldLen);
-			free(oldBuf);
-		}
-	}
-	return newBuf;
-}
-
-void AISetRangeInMemory(void *buf, NSRange range, int ch)
-{
-	unsigned i     = range.location;
-	unsigned i_max = range.location + range.length;
-	char *buf_ch = buf;
-	while (i < i_max) {
-		buf_ch[i++] = ch;
-	}
-}
-
 #pragma mark Rect utilities
 
 float AICoordinateForRect_edge_(const NSRect rect, const NSRectEdge edge)
diff -r 2cc01561d768 -r 01f117b212fd Frameworks/AIUtilities Framework/Source/AIObjectAdditions.h
--- a/Frameworks/AIUtilities Framework/Source/AIObjectAdditions.h	Tue May 12 14:21:30 2009 -0400
+++ b/Frameworks/AIUtilities Framework/Source/AIObjectAdditions.h	Tue May 12 15:58:06 2009 -0700
@@ -6,11 +6,6 @@
 //  Copyright (c) 2003-2005 The Adium Team. All rights reserved.
 //
 
-
- at interface NSObject (HashingAdditions)
-- (NSUInteger)hash;
- at end
-
 @interface NSObject (RunLoopMessenger)
 - (void)mainPerformSelector:(SEL)aSelector;
 - (id)mainPerformSelector:(SEL)aSelector returnValue:(BOOL)flag;
diff -r 2cc01561d768 -r 01f117b212fd Frameworks/AIUtilities Framework/Source/AISharedWriterQueue.h
--- a/Frameworks/AIUtilities Framework/Source/AISharedWriterQueue.h	Tue May 12 14:21:30 2009 -0400
+++ b/Frameworks/AIUtilities Framework/Source/AISharedWriterQueue.h	Tue May 12 15:58:06 2009 -0700
@@ -14,9 +14,7 @@
  * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
 
-#import "RAOperation.h"
-
 @interface AISharedWriterQueue : NSObject {}
-+ (void) addOperation:(RAOperation *)op;
++ (void) addOperation:(NSOperation *)op;
 + (void) waitUntilAllOperationsAreFinished;
 @end
diff -r 2cc01561d768 -r 01f117b212fd Frameworks/AIUtilities Framework/Source/AISharedWriterQueue.m
--- a/Frameworks/AIUtilities Framework/Source/AISharedWriterQueue.m	Tue May 12 14:21:30 2009 -0400
+++ b/Frameworks/AIUtilities Framework/Source/AISharedWriterQueue.m	Tue May 12 15:58:06 2009 -0700
@@ -14,32 +14,28 @@
  * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
 #import "AISharedWriterQueue.h"
-#import "RAOperationQueue.h"
 
 @interface AISharedWriterQueue()
-+ (RAOperationQueue *)queue;
-+ (void) dummy;
++ (NSOperationQueue *)queue;
 @end
 
 @implementation AISharedWriterQueue
 
-+ (void) addOperation:(RAOperation *)op {
++ (void) addOperation:(NSOperation *)op {
 	[[self queue] addOperation:op];
 }
 
 + (void) waitUntilAllOperationsAreFinished {
-	RAWaitableSelectorOperation *nop = [[[RAWaitableSelectorOperation alloc] initWithTarget:self selector:@selector(dummy) object:nil] autorelease];
-	[self addOperation:nop];
-	[nop waitUntilDone];
+	[[self queue] waitUntilAllOperationsAreFinished];
 }
 
-+ (void) dummy {}
-
-+ (RAOperationQueue *)queue {
++ (NSOperationQueue *)queue {
 	NSAssert([NSThread currentThread] == [NSThread mainThread], @"Do not try to use AISharedWriterQueue from non-main threads");
-	static RAOperationQueue *sharedWriterQueue = nil;
-	if (!sharedWriterQueue)
-		sharedWriterQueue = [[RAOperationQueue alloc] init];
+	static NSOperationQueue *sharedWriterQueue = nil;
+	if (!sharedWriterQueue) {
+		sharedWriterQueue = [[NSOperationQueue alloc] init];
+		[sharedWriterQueue setMaxConcurrentOperationCount:1];
+	}
 	return sharedWriterQueue;
 }
 
diff -r 2cc01561d768 -r 01f117b212fd Frameworks/AIUtilities Framework/Source/AITableViewAdditions.h
--- a/Frameworks/AIUtilities Framework/Source/AITableViewAdditions.h	Tue May 12 14:21:30 2009 -0400
+++ b/Frameworks/AIUtilities Framework/Source/AITableViewAdditions.h	Tue May 12 15:58:06 2009 -0700
@@ -14,7 +14,7 @@
  \------------------------------------------------------------------------------------------------------ */
 
 @interface NSTableView (AITableViewAdditions)
-- (NSArray *)arrayOfSelectedItemsUsingSourceArray:(NSArray *)sourceArray;
+- (NSArray *)selectedItemsFromArray:(NSArray *)sourceArray;
 - (void)selectItemsInArray:(NSArray *)selectedItems usingSourceArray:(NSArray *)sourceArray;
 @end
 
diff -r 2cc01561d768 -r 01f117b212fd Frameworks/AIUtilities Framework/Source/AITableViewAdditions.m
--- a/Frameworks/AIUtilities Framework/Source/AITableViewAdditions.m	Tue May 12 14:21:30 2009 -0400
+++ b/Frameworks/AIUtilities Framework/Source/AITableViewAdditions.m	Tue May 12 15:58:06 2009 -0700
@@ -21,7 +21,7 @@
 
 //Return an array of items which are currently selected. SourceArray should be an array from which to pull the items;
 //its count must be the same as the number of rows
-- (NSArray *)arrayOfSelectedItemsUsingSourceArray:(NSArray *)sourceArray
+- (NSArray *)selectedItemsFromArray:(NSArray *)sourceArray
 {
 	NSParameterAssert([sourceArray count] >= [self numberOfRows]);
 
diff -r 2cc01561d768 -r 01f117b212fd Frameworks/AIUtilities Framework/Source/RAOperationQueue/RAAtomicList.h
--- a/Frameworks/AIUtilities Framework/Source/RAOperationQueue/RAAtomicList.h	Tue May 12 14:21:30 2009 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-//
-//  RAAtomicList.h
-//  AudioHijackKit2
-//
-//  Created by Michael Ash on 11/9/08.
-//  Copyright 2008 Rogue Amoeba Software, LLC. All rights reserved.
-//
-
-// thread safe linked list utilities
-// a NULL list is considered empty
-typedef struct RAAtomicListNode *RAAtomicListRef;
-
-
-// thread safe functions: may be called on a shared list from multiple threads with no locking
-void RAAtomicListInsert( RAAtomicListRef *listPtr, void *elt );
-RAAtomicListRef RAAtomicListSteal( RAAtomicListRef *listPtr );
-
-// thread unsafe functions: must be called only on lists which other threads cannot access
-void RAAtomicListReverse( RAAtomicListRef *listPtr );
-void *RAAtomicListPop( RAAtomicListRef *listPtr); // returns NULL on empty list
-
diff -r 2cc01561d768 -r 01f117b212fd Frameworks/AIUtilities Framework/Source/RAOperationQueue/RAAtomicList.m
--- a/Frameworks/AIUtilities Framework/Source/RAOperationQueue/RAAtomicList.m	Tue May 12 14:21:30 2009 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-//
-//  RAAtomicList.m
-//  AudioHijackKit2
-//
-//  Created by Michael Ash on 11/9/08.
-//  Copyright 2008 Rogue Amoeba Software, LLC. All rights reserved.
-//
-
-#import "RAAtomicList.h"
-
-#import <libkern/OSAtomic.h>
-
-
-struct RAAtomicListNode
-{
-	struct RAAtomicListNode *next;
-	void *elt;
-};
-
-void RAAtomicListInsert( RAAtomicListRef *listPtr, void *elt )
-{
-	struct RAAtomicListNode *node = malloc( sizeof( *node ) );
-	node->elt = elt;
-	
-	do {
-		node->next = *listPtr;
-	} while( !OSAtomicCompareAndSwapPtrBarrier( node->next, node, (void **)listPtr ) );
-}
-
-RAAtomicListRef RAAtomicListSteal( RAAtomicListRef *listPtr )
-{
-	RAAtomicListRef ret;
-	do {
-		ret = *listPtr;
-	} while( !OSAtomicCompareAndSwapPtrBarrier( ret, NULL, (void **)listPtr ) );
-	return ret;
-}
-
-void RAAtomicListReverse( RAAtomicListRef *listPtr )
-{
-	struct RAAtomicListNode *cur = *listPtr;
-	struct RAAtomicListNode *prev = NULL;
-	struct RAAtomicListNode *next = NULL;
-	
-	if( !cur )
-		return;
-	
-	do {
-		next = cur->next;
-		cur->next = prev;
-		
-		if( next )
-		{
-			prev = cur;
-			cur = next;
-		}
-	} while( next );
-	
-	*listPtr = cur;
-}
-
-void *RAAtomicListPop( RAAtomicListRef *listPtr)
-{
-	struct RAAtomicListNode *node = *listPtr;
-	if( !node )
-		return NULL;
-	
-	*listPtr = node->next;
-	
-	void *elt = node->elt;
-	free( node );
-	return elt;
-}
-
diff -r 2cc01561d768 -r 01f117b212fd Frameworks/AIUtilities Framework/Source/RAOperationQueue/RALatchTrigger.h
--- a/Frameworks/AIUtilities Framework/Source/RAOperationQueue/RALatchTrigger.h	Tue May 12 14:21:30 2009 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-//
-//  RALatchTrigger.h
-//  AudioHijackKit2
-//
-//  Created by Michael Ash on 11/7/08.
-//  Copyright 2008 Rogue Amoeba Software, LLC. All rights reserved.
-//
-
-#import <mach/port.h>
-
-/*
- 
- A lockless mostly non-blocking latching trigger class.
- 
- This class allows one thread to wait on actions from other threads. It is
- latching, meaning that a signal which arrives when nothing is waiting will
- cause the next waiter to immediately proceed. Multiple signals that are sent
- in succession when no thread is waiting will still only un-block a thread once.
- A signal sent when the latch is already triggered does nothing.
- 
- A signaling thread is guaranteed never to block. A waiting thread only
- blocks if no signal has been sent. In other words, it is non-blocking
- except in cases where a thread really does have to wait.
- 
- Examples:
- 
- thread A waits, no signal has been sent so it blocks
- thread B signals, so thread A returns from waiting
- 
- thread B signals
- thread A waits, sees the signal, and immediately returns
- 
- thread B signals
- thread B signals again
- thread A waits, sees the signal, and immediately returns
- thread A waits again, and blocks waiting for a signal
- 
- */
- at interface RALatchTrigger : NSObject
-{
-	mach_port_t			_triggerPort;
-}
-
-- (id)init;
-
-- (void)signal;
-- (void)wait;
-
- at end
diff -r 2cc01561d768 -r 01f117b212fd Frameworks/AIUtilities Framework/Source/RAOperationQueue/RALatchTrigger.m
--- a/Frameworks/AIUtilities Framework/Source/RAOperationQueue/RALatchTrigger.m	Tue May 12 14:21:30 2009 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-//
-//  RALatchTrigger.m
-//  AudioHijackKit2
-//
-//  Created by Michael Ash on 11/7/08.
-//  Copyright 2008 Rogue Amoeba Software, LLC. All rights reserved.
-//
-
-#import "RALatchTrigger.h"
-
-#import <libkern/OSAtomic.h>
-#import <mach/mach.h>
-#import <mach/port.h>
-
-
- at implementation RALatchTrigger
-
-- (id)init
-{
-	if( (self = [super init]) )
-	{
-		kern_return_t ret;
-		ret = mach_port_allocate( mach_task_self(), MACH_PORT_RIGHT_RECEIVE, &_triggerPort );
-		if( ret == KERN_SUCCESS )
-		{
-			mach_port_limits_t limits = { 1 };
-			ret = mach_port_set_attributes( mach_task_self(), _triggerPort, MACH_PORT_LIMITS_INFO, (mach_port_info_t)&limits, sizeof( limits ) / sizeof( natural_t ) );
-		}
-		if( ret != KERN_SUCCESS )
-		{
-			NSString *reason = [NSString stringWithFormat: @"RALatchTrigger: could not allocate mach port: %x", ret];
-			@throw [NSException exceptionWithName: NSInternalInconsistencyException reason: reason userInfo: nil];
-		}
-	}
-	return self;
-}
-
-- (void)dealloc
-{
-	kern_return_t ret = mach_port_mod_refs( mach_task_self(), _triggerPort, MACH_PORT_RIGHT_RECEIVE, -1 );
-	if( ret != KERN_SUCCESS )
-		abort();
-	
-	[super dealloc];
-}
-
-- (void)signal
-{
-	kern_return_t result;
-	mach_msg_header_t header;
-	header.msgh_bits = MACH_MSGH_BITS_REMOTE(MACH_MSG_TYPE_MAKE_SEND);
-	header.msgh_size = sizeof( header );
-	header.msgh_remote_port = _triggerPort;
-	header.msgh_local_port = MACH_PORT_NULL;
-	header.msgh_id = 0;
-	result = mach_msg(&header, MACH_SEND_MSG | MACH_SEND_TIMEOUT, header.msgh_size, 0, MACH_PORT_NULL, 0, MACH_PORT_NULL);
-	if( result != MACH_MSG_SUCCESS && result != MACH_SEND_TIMED_OUT )
-	{
-		NSString *reason = [NSString stringWithFormat: @"RALatchTrigger: mach port send failed with code %x", result];
-		@throw [NSException exceptionWithName: NSInternalInconsistencyException reason: reason userInfo: nil];
-	}
-}
-
-- (void)wait
-{
-	struct
-	{
-		mach_msg_header_t header;
-		mach_msg_trailer_t trailer;
-	} msg;
-	
-	msg.header.msgh_size = sizeof( msg );
-	kern_return_t result = mach_msg(&msg.header, MACH_RCV_MSG, 0, msg.header.msgh_size, _triggerPort, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
-	
-	if( result != MACH_MSG_SUCCESS && result != MACH_RCV_TOO_LARGE )
-	{
-		NSString *reason = [NSString stringWithFormat: @"RALatchTrigger: mach port receive failed with code %x", result];
-		@throw [NSException exceptionWithName: NSInternalInconsistencyException reason: reason userInfo: nil];
-	}
-}
-
- at end
diff -r 2cc01561d768 -r 01f117b212fd Frameworks/AIUtilities Framework/Source/RAOperationQueue/RAOperation.h
--- a/Frameworks/AIUtilities Framework/Source/RAOperationQueue/RAOperation.h	Tue May 12 14:21:30 2009 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-//
-//  RAOperation.h
-//  AudioHijackKit2
-//
-//  Created by Michael Ash on 11/9/08.
-//  Copyright 2008 Rogue Amoeba Software, LLC. All rights reserved.
-//
-
- at interface RAOperation : NSObject
-{
-}
-
-// abstract, override this to create a concrete subclass, don't call super
-- (void)run;
-
- at end
-
- at interface RASelectorOperation : RAOperation
-{
-	id	_obj;
-	SEL	_sel;
-	id	_arg;
-	
-	id	_result;
-}
-
-- (id)initWithTarget: (id)obj selector: (SEL)sel object: (id)arg;
-
-- (id)result;
-
- at end
-
- at class RALatchTrigger;
- at interface RAWaitableSelectorOperation : RASelectorOperation
-{
-	RALatchTrigger*	_trigger;
-}
-
-- (void)waitUntilDone;
-
- at end
diff -r 2cc01561d768 -r 01f117b212fd Frameworks/AIUtilities Framework/Source/RAOperationQueue/RAOperation.m
--- a/Frameworks/AIUtilities Framework/Source/RAOperationQueue/RAOperation.m	Tue May 12 14:21:30 2009 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,99 +0,0 @@
-//
-//  RAOperation.m
-//  AudioHijackKit2
-//
-//  Created by Michael Ash on 11/9/08.
-//  Copyright 2008 Rogue Amoeba Software, LLC. All rights reserved.
-//
-
-#import "RAOperation.h"
-
-#import <objc/message.h>
-
-#import "RALatchTrigger.h"
-
-
- at implementation RAOperation
-
-- (void)run
-{
-	NSLog( @"RAOperation is an abstract class, implement -[%@ %@]", [self class], NSStringFromSelector( _cmd ) );
-	[self doesNotRecognizeSelector: _cmd];
-}
-
- at end
-
- at implementation RASelectorOperation
-
-- (id)initWithTarget: (id)obj selector: (SEL)sel object: (id)arg
-{
-	if( (self = [super init]) )
-	{
-		_obj = [obj retain];
-		_sel = sel;
-		_arg = [arg retain];
-	}
-	return self;
-}
-
-- (void)dealloc
-{
-	[_obj release];
-	[_arg release];
-	[_result release];
-	
-	[super dealloc];
-}
-
-- (NSString *)description
-{
-	return [NSString stringWithFormat: @"<%@:%p: %@ %@ %@>", [self class], self, _obj, NSStringFromSelector( _sel ), _arg];
-}
-
-- (void)run
-{
-	NSMethodSignature *sig = [_obj methodSignatureForSelector: _sel];
-	if( [sig methodReturnType][0] == '@' )
-		_result = [((id (*)(id, SEL, id))objc_msgSend)( _obj, _sel, _arg ) retain];
-	else
-		((void (*)(id, SEL, id))objc_msgSend)( _obj, _sel, _arg );
-}
-
-- (id)result
-{
-	return _result;
-}
-
- at end
-
- at implementation RAWaitableSelectorOperation
-
-- (id)initWithTarget: (id)obj selector: (SEL)sel object: (id)arg
-{
-	if( (self = [super initWithTarget: obj selector: sel object: arg]) )
-	{
-		_trigger = [[RALatchTrigger alloc] init];
-	}
-	return self;
-}
-
-- (void)dealloc
-{
-	[_trigger release];
-	
-	[super dealloc];
-}
-
-- (void)run
-{
-	[super run];
-	[_trigger signal];
-}
-
-- (void)waitUntilDone
-{
-	[_trigger wait];
-}
-
- at end
-
diff -r 2cc01561d768 -r 01f117b212fd Frameworks/AIUtilities Framework/Source/RAOperationQueue/RAOperationQueue.h
--- a/Frameworks/AIUtilities Framework/Source/RAOperationQueue/RAOperationQueue.h	Tue May 12 14:21:30 2009 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,22 +0,0 @@
-//
-//  RAOperationQueue.h
-//  AudioHijackKit2
-//
-//  Created by Michael Ash on 11/9/08.
-//  Copyright 2008 Rogue Amoeba Software, LLC. All rights reserved.
-//
-
- at class RAOperation;
- at class RAOperationQueueImpl;
-
- at interface RAOperationQueue : NSObject
-{
-	RAOperationQueueImpl*	_impl;
-}
-
-- (id)init;
-
-- (void)addOperation: (RAOperation *)op;
-- (void)addHighPriorityOperation: (RAOperation *)op;
-
- at end
diff -r 2cc01561d768 -r 01f117b212fd Frameworks/AIUtilities Framework/Source/RAOperationQueue/RAOperationQueue.m
--- a/Frameworks/AIUtilities Framework/Source/RAOperationQueue/RAOperationQueue.m	Tue May 12 14:21:30 2009 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,182 +0,0 @@
-//
-//  RAOperationQueue.m
-//  AudioHijackKit2
-//
-//  Created by Michael Ash on 11/9/08.
-//  Copyright 2008 Rogue Amoeba Software, LLC. All rights reserved.
-//
-
-#import "RAOperationQueue.h"
-
-#import "RAAtomicList.h"
-#import "RALatchTrigger.h"
-
-
- at interface RAOperationQueueImpl : NSObject
-{
-	NSThread*		_thread;
-	
-	RALatchTrigger*	_trigger;
-	
-	// NOTE: operations in lists are explicitly retained, must be released when popping
-	RAAtomicListRef	_operationList;
-	RAAtomicListRef	_highPriorityOperationList;
-}
-
-- (void)addOperation: (RAOperation *)op;
-- (void)addHighPriorityOperation: (RAOperation *)op;
-- (void)stop;
-
- at end
-
- at implementation RAOperationQueueImpl
-
-- (id)init
-{
-	if( (self = [super init]) )
-	{
-		_trigger = [[RALatchTrigger alloc] init];
-		
-		_thread = [[NSThread alloc] initWithTarget: self selector: @selector( _workThread ) object: nil];
-		[_thread start];
-	}
-	return self;
-}
-
-- (RAOperation *)_popOperation: (RAAtomicListRef *)listPtr
-{
-	return [(id)RAAtomicListPop( listPtr ) autorelease];
-}
-
-- (void)dealloc
-{
-	[_thread release];
-	[_trigger release];
-	
-	while( [self _popOperation: &_operationList] )
-		;
-	while( [self _popOperation: &_highPriorityOperationList] )
-		;
-	
-	[super dealloc];
-}
-
-- (void)_addOperation: (RAOperation *)op toList: (RAAtomicListRef *)listPtr
-{
-	RAAtomicListInsert( listPtr, [op retain] );
-	[_trigger signal];
-}
-
-- (void)addOperation: (RAOperation *)op
-{
-	[self _addOperation: op toList: &_operationList];
-}
-
-- (void)addHighPriorityOperation: (RAOperation *)op
-{
-	[self _addOperation: op toList: &_highPriorityOperationList];
-}
-
-- (void)stop
-{
-	[_thread cancel];
-	[_trigger signal];
-}
-
-#pragma mark -
-
-// pop an operation from the given list and run it
-// if the list is empty, steal the source list into the given list and run an operation from it
-// if both are empty, do nothing
-// returns YES if an operation was executed, NO otherwise
-- (BOOL)_runOperationFromList: (RAAtomicListRef *)listPtr sourceList: (RAAtomicListRef *)sourceListPtr
-{
-	RAOperation *op = [self _popOperation: listPtr];
-	if( !op )
-	{
-		*listPtr = RAAtomicListSteal( sourceListPtr );
-		// source lists are in LIFO order, but we want to execute operations in the order they were enqueued
-		// so we reverse the list before we do anything with it
-		RAAtomicListReverse( listPtr );
-		op = [self _popOperation: listPtr];
-	}
-	
-	if( op )
-		[op run];
-	
-	return op != nil;
-}
-
-- (void)_workThread
-{
-	NSAutoreleasePool *outerPool = [[NSAutoreleasePool alloc] init];
-	
-	NSThread *thread = [NSThread currentThread];
-	
-	RAAtomicListRef operations = NULL;
-	RAAtomicListRef highPriorityOperations = NULL;
-	
-	NSAutoreleasePool *innerPool = [[NSAutoreleasePool alloc] init];
-	
-	BOOL didRun = NO;
-	while( ![thread isCancelled] )
-	{
-		if( !didRun )
-			[_trigger wait];
-		
-		// first attempt to run a high-priority operation
-		didRun = [self _runOperationFromList: &highPriorityOperations
-									   sourceList: &_highPriorityOperationList];
-		// if no high priority operation could be run, then attempt to run a low-priority operation
-		if( !didRun )
-			didRun = [self _runOperationFromList: &operations
-									  sourceList: &_operationList];
-		
-		[innerPool release];
-		innerPool = [[NSAutoreleasePool alloc] init];
-		
-	}
-	
-	[innerPool release];
-	
-	while( [self _popOperation: &operations] )
-		;
-	while( [self _popOperation: &highPriorityOperations] )
-		;
-	
-	[outerPool release];
-}
-
- at end
-
-
- at implementation RAOperationQueue
-
-- (id)init
-{
-	if( (self = [super init]) )
-	{
-		_impl = [[RAOperationQueueImpl alloc] init];
-	}
-	return self;
-}
-
-- (void)dealloc
-{
-	[_impl stop];
-	[_impl release];
-	
-	[super dealloc];
-}
-
-- (void)addOperation: (RAOperation *)op
-{
-	[_impl addOperation: op];
-}
-
-- (void)addHighPriorityOperation: (RAOperation *)op
-{
-	[_impl addHighPriorityOperation: op];
-}
-
- at end
diff -r 2cc01561d768 -r 01f117b212fd Frameworks/Adium Framework/Source/AIAddressBookController.m
--- a/Frameworks/Adium Framework/Source/AIAddressBookController.m	Tue May 12 14:21:30 2009 -0400
+++ b/Frameworks/Adium Framework/Source/AIAddressBookController.m	Tue May 12 15:58:06 2009 -0700
@@ -1280,8 +1280,9 @@
 			[person setValue:[contact phoneticName] forKey:kABFirstNamePhoneticProperty];
 
 		NSString				*UID = contact.formattedUID;
+		NSArray *cs = [contact isKindOfClass:[AIMetaContact class]] ? [(AIMetaContact *)contact uniqueContainedObjects] : [NSArray arrayWithObject:contact];
 			
-		for (AIListObject *c in [contact isKindOfClass:[AIMetaContact class]] ? [(AIMetaContact *)contact uniqueContainedObjects] : [NSArray arrayWithObject:contact])	{
+		for (AIListObject *c in cs)	{
 			ABMutableMultiValue *multiValue = [[ABMutableMultiValue alloc] init];
 			UID = c.formattedUID;
 			serviceProperty = [AIAddressBookController propertyFromService:c.service];
diff -r 2cc01561d768 -r 01f117b212fd Frameworks/Adium Framework/Source/AIContactControllerProtocol.h
--- a/Frameworks/Adium Framework/Source/AIContactControllerProtocol.h	Tue May 12 14:21:30 2009 -0400
+++ b/Frameworks/Adium Framework/Source/AIContactControllerProtocol.h	Tue May 12 15:58:06 2009 -0700
@@ -93,7 +93,7 @@
 - (AIListBookmark *)existingBookmarkForChatName:(NSString *)inName
 									  onAccount:(AIAccount *)inAccount
 							   chatCreationInfo:(NSDictionary *)inCreationInfo;
-- (AIListBookmark *)bookmarkForChat:(AIChat *)inChat;
+- (AIListBookmark *)bookmarkForChat:(AIChat *)inChat inGroup:(AIListGroup *)group;
 - (void)removeBookmark:(AIListBookmark *)listBookmark;
 
 - (AIMetaContact *)knownMetaContactForGroupingUIDs:(NSArray *)UIDsArray forServices:(NSArray *)servicesArray;
diff -r 2cc01561d768 -r 01f117b212fd Frameworks/Adium Framework/Source/AIListBookmark.m
--- a/Frameworks/Adium Framework/Source/AIListBookmark.m	Tue May 12 14:21:30 2009 -0400
+++ b/Frameworks/Adium Framework/Source/AIListBookmark.m	Tue May 12 15:58:06 2009 -0700
@@ -46,8 +46,6 @@
 		chatCreationDictionary = [inChatCreationDictionary copy];
 		name = [inName copy];
 		
-		[self restoreGrouping];
-		
 		[adium.chatController registerChatObserver:self];
 		
 		[self.account addObserver:self
@@ -89,11 +87,14 @@
 		return nil;
 	}
 	
-	return [self initWithUID:[decoder decodeObjectForKey:@"UID"]
-					 account:myAccount
-					 service:[adium.accountController firstServiceWithServiceID:[decoder decodeObjectForKey:@"ServiceID"]]
-				  dictionary:[decoder decodeObjectForKey:@"chatCreationDictionary"]
-						name:[decoder decodeObjectForKey:@"name"]];
+	if ((self = [self initWithUID:[decoder decodeObjectForKey:@"UID"]
+						  account:myAccount
+						  service:[adium.accountController firstServiceWithServiceID:[decoder decodeObjectForKey:@"ServiceID"]]
+					   dictionary:[decoder decodeObjectForKey:@"chatCreationDictionary"]
+							 name:[decoder decodeObjectForKey:@"name"]])) {
+		[self restoreGrouping];
+	}
+	return self;
 }
 
 
@@ -188,6 +189,16 @@
 }
 
 /*!
+ * @brief For a newly created bookmark, set the group that -restoreGrouping will move us to. This is saved, so has no use on existing bookmarks
+ */
+- (void)setInitialGroup:(AIListGroup *)inGroup
+{
+	[self setPreference:inGroup.UID
+				 forKey:KEY_CONTAINING_OBJECT_UID
+				  group:OBJECT_STATUS_CACHE];	
+}
+
+/*!
  * @brief Add a containing group
  *
  * When adding a containing group, save the group's UID so that we can rejoin the group next time.
diff -r 2cc01561d768 -r 01f117b212fd Frameworks/Adium Framework/Source/AIMetaContact.m
--- a/Frameworks/Adium Framework/Source/AIMetaContact.m	Tue May 12 14:21:30 2009 -0400
+++ b/Frameworks/Adium Framework/Source/AIMetaContact.m	Tue May 12 15:58:06 2009 -0700
@@ -36,9 +36,9 @@
 @end
 
 @interface AIMetaContact ()
-- (void)_updateAllPropertiesForObject:(AIListObject *)inObject;
+- (void)updateAllPropertiesForObject:(AIListObject *)inObject;
 
-- (void)_determineIfWeShouldAppearToContainOnlyOneContact;
+- (void)determineIfWeShouldAppearToContainOnlyOneContact;
 
 - (NSArray *)uniqueContainedListContactsIncludingOfflineAccounts:(BOOL)includeOfflineAccounts visibleOnly:(BOOL)visibleOnly;
 
@@ -51,12 +51,10 @@
 
 NSComparisonResult containedContactSort(AIListContact *objectA, AIListContact *objectB, void *context);
 
-//init
 - (id)initWithObjectID:(NSNumber *)inObjectID
 {
-	objectID = [inObjectID retain];
-
 	if ((self = [super initWithUID:[inObjectID stringValue] service:nil])) {
+		objectID = [inObjectID retain];
 		_preferredContact = nil;
 		_listContacts = nil;
 		_listContactsIncludingOfflineAccounts = nil;
@@ -85,10 +83,7 @@
 	[super dealloc];
 }
 
-- (NSNumber *)objectID
-{
-	return objectID;
-}
+ at synthesize objectID;
 
 - (NSString *)internalObjectID
 {
@@ -100,7 +95,7 @@
 
 + (NSString *)internalObjectIDFromObjectID:(NSNumber *)inObjectID
 {
-	return ([NSString stringWithFormat:@"MetaContact-%i",[inObjectID intValue]]);
+	return [NSString stringWithFormat:@"MetaContact-%i", [inObjectID intValue]];
 }
 
 //A metaContact's internalObjectID is completely unique to it, so return that for interalUniqueObjectID
@@ -260,12 +255,12 @@
 		//If we were unique before, check if we will still be unique after adding this contact.
 		//If we were not, no checking needed.
 		if (containsOnlyOneUniqueContact) {
-			[self _determineIfWeShouldAppearToContainOnlyOneContact];
+			[self determineIfWeShouldAppearToContainOnlyOneContact];
 		}
 
 		//Add the object from our status cache, notifying of the changes (silently) as appropriate
 		if (inObject == [self preferredContact]) {
-			[self _updateAllPropertiesForObject:inObject];
+			[self updateAllPropertiesForObject:inObject];
 		}
 		




More information about the commits mailing list