adium 2184:cc8010b0d09a: Add appropriate class checks for all ou...

commits at adium.im commits at adium.im
Thu May 14 09:08:16 UTC 2009


details:	http://hg.adium.im/adium/rev/cc8010b0d09a
revision:	2184:cc8010b0d09a
author:		David Smith <catfish.man at gmail.com>
date:		Thu May 14 02:08:03 2009 -0700

Add appropriate class checks for all our +initialize impls that lacked them. I don't *think* this fixes anything, but it does make a few things subclassing-safe that weren't

diffstat:

 Frameworks/AIUtilities Framework/Source/AIPlasticButton.m     |  3 ++-
 Frameworks/AIUtilities Framework/Source/AISleepNotification.m |  3 +++
 Frameworks/AIUtilities Framework/Source/AITooltipUtilities.m  |  2 ++
 Frameworks/Adium Framework/Source/AIListOutlineView.m         |  2 ++
 Frameworks/Adium Framework/Source/AIProxyListObject.m         |  3 ++-
 Plugins/Bonjour/libezv/Simple HTTP Server/HTTPServer.m        |  2 ++
 Plugins/Purple Service/AMPurpleJabberAdHocServer.m            |  3 ++-
 Source/AIHoveringPopUpButton.m                                |  3 ++-
 Source/ESContactAlertsController.h                            |  1 +
 Source/ESContactAlertsController.m                            |  2 ++
 10 files changed, 20 insertions(+), 4 deletions(-)

diffs (124 lines):

diff -r 69aa3bfc0963 -r cc8010b0d09a Frameworks/AIUtilities Framework/Source/AIPlasticButton.m
--- a/Frameworks/AIUtilities Framework/Source/AIPlasticButton.m	Thu May 14 00:09:23 2009 -0400
+++ b/Frameworks/AIUtilities Framework/Source/AIPlasticButton.m	Thu May 14 02:08:03 2009 -0700
@@ -15,7 +15,8 @@
 @implementation AIPlasticButton
 
 + (void)initialize {
-	[self setCellClass:[AIPlasticButtonCell class]];
+	if (self == [AIPlasticButton class])
+		[self setCellClass:[AIPlasticButtonCell class]];
 }
 
 - (id)copyWithZone:(NSZone *)zone
diff -r 69aa3bfc0963 -r cc8010b0d09a Frameworks/AIUtilities Framework/Source/AISleepNotification.m
--- a/Frameworks/AIUtilities Framework/Source/AISleepNotification.m	Thu May 14 00:09:23 2009 -0400
+++ b/Frameworks/AIUtilities Framework/Source/AISleepNotification.m	Thu May 14 02:08:03 2009 -0700
@@ -52,6 +52,9 @@
  */
 + (void)initialize
 {
+	if (self != [AISleepNotification class])
+		return;
+	
     IONotificationPortRef	notificationPort;
     io_object_t				notifier;
 	NSNotificationCenter	*defaultCenter = [NSNotificationCenter defaultCenter];
diff -r 69aa3bfc0963 -r cc8010b0d09a Frameworks/AIUtilities Framework/Source/AITooltipUtilities.m
--- a/Frameworks/AIUtilities Framework/Source/AITooltipUtilities.m	Thu May 14 00:09:23 2009 -0400
+++ b/Frameworks/AIUtilities Framework/Source/AITooltipUtilities.m	Thu May 14 02:08:03 2009 -0700
@@ -54,6 +54,8 @@
 
 + (void)initialize
 {
+	if (self != [AITooltipUtilities class])
+		return;
 	if (!titleAndBodyMarginLineColor) {
 		titleAndBodyMarginLineColor = [[[NSColor grayColor] colorWithAlphaComponent:.7] retain];
 	}
diff -r 69aa3bfc0963 -r cc8010b0d09a Frameworks/Adium Framework/Source/AIListOutlineView.m
--- a/Frameworks/Adium Framework/Source/AIListOutlineView.m	Thu May 14 00:09:23 2009 -0400
+++ b/Frameworks/Adium Framework/Source/AIListOutlineView.m	Thu May 14 02:08:03 2009 -0700
@@ -35,6 +35,8 @@
 
 + (void)initialize
 {
+	if (self != [AIListOutlineView class])
+		return;
 	[self exposeBinding:@"desiredHeight"];
 	[self exposeBinding:@"totalHeight"];
 }
diff -r 69aa3bfc0963 -r cc8010b0d09a Frameworks/Adium Framework/Source/AIProxyListObject.m
--- a/Frameworks/Adium Framework/Source/AIProxyListObject.m	Thu May 14 00:09:23 2009 -0400
+++ b/Frameworks/Adium Framework/Source/AIProxyListObject.m	Thu May 14 02:08:03 2009 -0700
@@ -22,7 +22,8 @@
 
 + (void)initialize
 {
-	proxyDict = [[NSMutableDictionary alloc] init];
+	if (self == [AIProxyListObject class])
+		proxyDict = [[NSMutableDictionary alloc] init];
 }
 
 + (AIProxyListObject *)proxyListObjectForListObject:(ESObjectWithProperties *)inListObject
diff -r 69aa3bfc0963 -r cc8010b0d09a Plugins/Bonjour/libezv/Simple HTTP Server/HTTPServer.m
--- a/Plugins/Bonjour/libezv/Simple HTTP Server/HTTPServer.m	Thu May 14 00:09:23 2009 -0400
+++ b/Plugins/Bonjour/libezv/Simple HTTP Server/HTTPServer.m	Thu May 14 02:08:03 2009 -0700
@@ -256,6 +256,8 @@
 **/
 + (void)initialize
 {
+	if (self != [HTTPConnection class])
+		return;
 	static BOOL initialized = NO;
 	if (!initialized)
 	{
diff -r 69aa3bfc0963 -r cc8010b0d09a Plugins/Purple Service/AMPurpleJabberAdHocServer.m
--- a/Plugins/Purple Service/AMPurpleJabberAdHocServer.m	Thu May 14 00:09:23 2009 -0400
+++ b/Plugins/Purple Service/AMPurpleJabberAdHocServer.m	Thu May 14 02:08:03 2009 -0700
@@ -66,7 +66,8 @@
 }
 
 + (void)initialize {
-	jabber_add_feature("http://jabber.org/protocol/commands", NULL);
+	if (self == [AMPurpleJabberAdHocServer class])
+		jabber_add_feature("http://jabber.org/protocol/commands", NULL);
 }
 
 - (id)initWithAccount:(ESPurpleJabberAccount*)_account {
diff -r 69aa3bfc0963 -r cc8010b0d09a Source/AIHoveringPopUpButton.m
--- a/Source/AIHoveringPopUpButton.m	Thu May 14 00:09:23 2009 -0400
+++ b/Source/AIHoveringPopUpButton.m	Thu May 14 02:08:03 2009 -0700
@@ -11,7 +11,8 @@
 @implementation AIHoveringPopUpButton
 
 + (void)initialize {
-	[self setCellClass:[AIHoveringPopUpButtonCell class]];
+	if (self == [AIHoveringPopUpButton class])
+		[self setCellClass:[AIHoveringPopUpButtonCell class]];
 }
 
 - (void)initHoveringPopUpButton
diff -r 69aa3bfc0963 -r cc8010b0d09a Source/ESContactAlertsController.h
--- a/Source/ESContactAlertsController.h	Thu May 14 00:09:23 2009 -0400
+++ b/Source/ESContactAlertsController.h	Thu May 14 02:08:03 2009 -0700
@@ -17,6 +17,7 @@
 #import <Adium/AIContactAlertsControllerProtocol.h>
 
 @interface ESContactAlertsController : NSObject <AIContactAlertsController> {
+ at private
 	NSMutableDictionary			*globalOnlyEventHandlers;
 	NSMutableDictionary			*eventHandlers;
 	NSMutableDictionary			*actionHandlers;
diff -r 69aa3bfc0963 -r cc8010b0d09a Source/ESContactAlertsController.m
--- a/Source/ESContactAlertsController.m	Thu May 14 00:09:23 2009 -0400
+++ b/Source/ESContactAlertsController.m	Thu May 14 02:08:03 2009 -0700
@@ -38,6 +38,8 @@
  */
 + (void)initialize
 {
+	if (self != [ESContactAlertsController class])
+		return;
 	static BOOL didInitialize = NO;
 	if (!didInitialize) {
 		for (NSInteger i = 0; i < EVENT_HANDLER_GROUP_COUNT; i++) {




More information about the commits mailing list