adium 2477:a37aad955c03: Convert the unused idleTime property in...

commits at adium.im commits at adium.im
Wed Jun 10 05:28:14 UTC 2009


details:	http://hg.adium.im/adium/rev/a37aad955c03
revision:	2477:a37aad955c03
author:		David Smith <catfish.man at gmail.com>
date:		Tue Jun 09 22:28:06 2009 -0700

Convert the unused idleTime property into an accessor for something we actually use, and move the callsites over to using it

diffs (68 lines):

diff -r ed69be5ac6da -r a37aad955c03 Frameworks/Adium Framework/Source/AIListObject.h
--- a/Frameworks/Adium Framework/Source/AIListObject.h	Tue Jun 09 21:56:03 2009 -0700
+++ b/Frameworks/Adium Framework/Source/AIListObject.h	Tue Jun 09 22:28:06 2009 -0700
@@ -151,7 +151,7 @@
 
 @property (readwrite, nonatomic, retain) NSString *notes;
 
- at property (readonly, nonatomic) NSNumber *idleTime;
+ at property (readonly, nonatomic) NSInteger *idleTime;
 
 @property (readonly, nonatomic) NSImage *userIcon;
 @property (readonly, nonatomic) NSImage *menuIcon;
diff -r ed69be5ac6da -r a37aad955c03 Frameworks/Adium Framework/Source/AIListObject.m
--- a/Frameworks/Adium Framework/Source/AIListObject.m	Tue Jun 09 21:56:03 2009 -0700
+++ b/Frameworks/Adium Framework/Source/AIListObject.m	Tue Jun 09 22:28:06 2009 -0700
@@ -450,10 +450,9 @@
 	[AIUserIcons setManuallySetUserIconData:inData forObject:self];
 }
 
-- (NSNumber *)idleTime
+- (NSInteger)idleTime
 {
-	NSNumber *idleNumber = [self valueForProperty:@"Idle"];
-	return (idleNumber ? idleNumber : [NSNumber numberWithInt:0]);
+	return [self integerValueForProperty:@"Idle"];
 }
 
 //A standard listObject is never a stranger
diff -r ed69be5ac6da -r a37aad955c03 Source/AIContactIdlePlugin.m
--- a/Source/AIContactIdlePlugin.m	Tue Jun 09 21:56:03 2009 -0700
+++ b/Source/AIContactIdlePlugin.m	Tue Jun 09 22:28:06 2009 -0700
@@ -171,7 +171,7 @@
  */
 - (NSString *)labelForObject:(AIListObject *)inObject
 {
-	NSInteger 		idle = [inObject integerValueForProperty:@"Idle"];
+	NSInteger 		idle = inObject.idleTime;
 	NSString	*entry = nil;
 
 	if ((idle > 599400) || (idle == -1)) { //Cap idle at 999 Hours (999*60*60 seconds)
diff -r ed69be5ac6da -r a37aad955c03 Source/AIExtendedStatusPlugin.m
--- a/Source/AIExtendedStatusPlugin.m	Tue Jun 09 21:56:03 2009 -0700
+++ b/Source/AIExtendedStatusPlugin.m	Tue Jun 09 22:28:06 2009 -0700
@@ -127,7 +127,7 @@
 			[statusMessage convertNewlinesToSlashes];	
 		}
 
-		idle = (showIdle ? [inObject integerValueForProperty:@"Idle"] : 0);
+		idle = (showIdle ? inObject.idleTime : 0);
 
 		//
 		NSString *idleString = ((idle > 0) ? [self idleStringForMinutes:idle] : nil);
diff -r ed69be5ac6da -r a37aad955c03 Source/ESStatusSort.m
--- a/Source/ESStatusSort.m	Tue Jun 09 21:56:03 2009 -0700
+++ b/Source/ESStatusSort.m	Tue Jun 09 22:28:06 2009 -0700
@@ -610,10 +610,10 @@
 			away[1] = ((statusSummaryB == AIAwayStatus) || (statusSummaryB == AIAwayAndIdleStatus));
 			
 			idle[0] = (((statusSummaryA == AIIdleStatus) || (statusSummaryA == AIAwayAndIdleStatus)) ?
-					   [objectA integerValueForProperty:@"Idle"] :
+					   objectA.idleTime :
 					   0);
 			idle[1] = (((statusSummaryB == AIIdleStatus) || (statusSummaryB == AIAwayAndIdleStatus)) ?
-					   [objectB integerValueForProperty:@"Idle"] :
+					   objectB.idleTime :
 					   0);
 			
 			if (groupMobile) {




More information about the commits mailing list