adium 2482:aa7b47dddae7: Backing out the online caching pt1, it ...
commits at adium.im
commits at adium.im
Wed Jun 10 06:28:36 UTC 2009
details: http://hg.adium.im/adium/rev/aa7b47dddae7
revision: 2482:aa7b47dddae7
author: David Smith <catfish.man at gmail.com>
date: Tue Jun 09 23:25:47 2009 -0700
Backing out the online caching pt1, it is buggy
Subject: adium 2483:a89cf712e139: Backout pt2
details: http://hg.adium.im/adium/rev/a89cf712e139
revision: 2483:a89cf712e139
author: David Smith <catfish.man at gmail.com>
date: Tue Jun 09 23:27:23 2009 -0700
Backout pt2
Subject: adium 2484:abf338a68f33: Merge backout...
details: http://hg.adium.im/adium/rev/abf338a68f33
revision: 2484:abf338a68f33
author: David Smith <catfish.man at gmail.com>
date: Tue Jun 09 23:27:55 2009 -0700
Merge backout...
Subject: adium 2485:ea6a9624f030: Merge backout
details: http://hg.adium.im/adium/rev/ea6a9624f030
revision: 2485:ea6a9624f030
author: David Smith <catfish.man at gmail.com>
date: Tue Jun 09 23:28:09 2009 -0700
Merge backout
diffs (297 lines):
diff -r ed69be5ac6da -r ea6a9624f030 Frameworks/Adium Framework/Source/AIAbstractAccount.m
--- a/Frameworks/Adium Framework/Source/AIAbstractAccount.m Tue Jun 09 21:56:03 2009 -0700
+++ b/Frameworks/Adium Framework/Source/AIAbstractAccount.m Tue Jun 09 23:28:09 2009 -0700
@@ -463,7 +463,7 @@
*/
- (void)updateCommonStatusForKey:(NSString *)key
{
- BOOL areOnline = self.online;
+ BOOL areOnline = [self boolValueForProperty:@"Online"];
//Online status changed
//Call connect or disconnect as appropriate
@@ -651,7 +651,7 @@
- (AIStatus *)statusState
{
- if (self.online) {
+ if ([self boolValueForProperty:@"Online"]) {
AIStatus *statusState = [self valueForProperty:@"StatusState"];
if (!statusState) {
statusState = [adium.statusController defaultInitialStatusState];
@@ -742,7 +742,7 @@
forProperty:@"Prompt For Password On Next Connect"
notify:NotifyNever];
- if (!self.online && ![self valueForProperty:@"Connecting"]) {
+ if (![self boolValueForProperty:@"Online"] && ![self valueForProperty:@"Connecting"]) {
[self setPasswordTemporarily:inPassword];
//Time to connect!
@@ -1308,7 +1308,7 @@
- (void)didDisconnect
{
//If we were online, display a status message in all of our open chats noting our disconnection
- if (self.online) {
+ if ([self boolValueForProperty:@"Online"]) {
for (AIChat *chat in adium.interfaceController.openChats) {
if (chat.account != self || !chat.isOpen)
continue;
diff -r ed69be5ac6da -r ea6a9624f030 Frameworks/Adium Framework/Source/AIListContact.m
--- a/Frameworks/Adium Framework/Source/AIListContact.m Tue Jun 09 21:56:03 2009 -0700
+++ b/Frameworks/Adium Framework/Source/AIListContact.m Tue Jun 09 23:28:09 2009 -0700
@@ -342,8 +342,8 @@
{
if (online != self.online) {
[self setValue:[NSNumber numberWithBool:online]
- forProperty:@"Online"
- notify:notify];
+ forProperty:@"Online"
+ notify:notify];
if (!silent) {
[self setValue:[NSNumber numberWithBool:YES]
diff -r ed69be5ac6da -r ea6a9624f030 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 23:28:09 2009 -0700
@@ -86,12 +86,10 @@
NSString *internalObjectID;
//Grouping, Manual ordering
- NSMutableSet *m_groups; //The AIContainingObjects that this object is in; currently always has only 1
+ NSMutableSet *m_groups; //The AIContainingObjects that this object is in
CGFloat cachedSmallestOrder;
CGFloat cachedLargestOrder;
-
- BOOL m_online;
}
- (id)initWithUID:(NSString *)inUID service:(AIService *)inService;
@@ -151,7 +149,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 ea6a9624f030 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 23:28:09 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
@@ -624,15 +623,11 @@
if (notify) [self notifyOfChangedPropertiesSilently:NO];
}
-- (void) setValue:(id)value forProperty:(NSString *)key notify:(NotifyTiming)notify
+- (BOOL)online
{
- if ([key isEqualToString:@"Online"])
- m_online = value ? [value boolValue] : NO;
- [super setValue:value forProperty:key notify:notify];
+ return [self boolValueForProperty:@"Online"];
}
- at synthesize online = m_online;
-
- (AIStatusSummary)statusSummary
{
if (self.online) {
diff -r ed69be5ac6da -r ea6a9624f030 Plugins/Bonjour/AWBonjourAccount.m
--- a/Plugins/Bonjour/AWBonjourAccount.m Tue Jun 09 21:56:03 2009 -0700
+++ b/Plugins/Bonjour/AWBonjourAccount.m Tue Jun 09 23:28:09 2009 -0700
@@ -382,7 +382,7 @@
- (void)updateStatusForKey:(NSString *)key
{
[super updateStatusForKey:key];
- BOOL areOnline = self.online;
+ BOOL areOnline = [[self valueForProperty:@"Online"] boolValue];
//Now look at keys which only make sense while online
if (areOnline) {
diff -r ed69be5ac6da -r ea6a9624f030 Plugins/Contact Status Dock Overlays/AIContactStatusDockOverlaysPlugin.m
--- a/Plugins/Contact Status Dock Overlays/AIContactStatusDockOverlaysPlugin.m Tue Jun 09 21:56:03 2009 -0700
+++ b/Plugins/Contact Status Dock Overlays/AIContactStatusDockOverlaysPlugin.m Tue Jun 09 23:28:09 2009 -0700
@@ -256,22 +256,23 @@
- (NSSet *)updateListObject:(AIListObject *)inObject keys:(NSSet *)inModifiedKeys silent:(BOOL)silent
{
- //When an account signs on or off, force an overlay update as it may have silently changed
- //contacts' statuses
- if ([inObject isKindOfClass:[AIAccount class]] && [inModifiedKeys containsObject:@"Online"]) {
-
- BOOL madeChanges = NO;
-
- for (AIListObject *listObject in [[overlayObjectsArray copy] autorelease]) {
- if (([listObject respondsToSelector:@selector(account)]) &&
- ([(id)listObject account] == inObject) &&
- ([overlayObjectsArray containsObjectIdenticalTo:listObject])) {
- [overlayObjectsArray removeObject:listObject];
- madeChanges = YES;
+ if ([inObject isKindOfClass:[AIAccount class]]) {
+ //When an account signs on or off, force an overlay update as it may have silently changed
+ //contacts' statuses
+ if ([inModifiedKeys containsObject:@"Online"]) {
+ BOOL madeChanges = NO;
+
+ for (AIListObject *listObject in [[overlayObjectsArray copy] autorelease]) {
+ if (([listObject respondsToSelector:@selector(account)]) &&
+ ([(id)listObject account] == inObject) &&
+ ([overlayObjectsArray containsObjectIdenticalTo:listObject])) {
+ [overlayObjectsArray removeObject:listObject];
+ madeChanges = YES;
+ }
}
+
+ if (madeChanges) [self _setOverlay];
}
-
- if (madeChanges) [self _setOverlay];
}
return nil;
diff -r ed69be5ac6da -r ea6a9624f030 Source/AIAccountListPreferences.m
--- a/Source/AIAccountListPreferences.m Tue Jun 09 21:56:03 2009 -0700
+++ b/Source/AIAccountListPreferences.m Tue Jun 09 23:28:09 2009 -0700
@@ -694,7 +694,7 @@
if ([account valueForProperty:@"ConnectionProgressString"] && [account boolValueForProperty:@"Connecting"]) {
// Connection status if we're currently connecting, with the percent at the end
statusMessage = [[account valueForProperty:@"ConnectionProgressString"] stringByAppendingFormat:@" (%2.f%%)", [[account valueForProperty:@"ConnectionProgressPercent"] doubleValue]*100.0];
- } else if ([account lastDisconnectionError] && !account.online && ![account boolValueForProperty:@"Connecting"]) {
+ } else if ([account lastDisconnectionError] && ![account boolValueForProperty:@"Online"] && ![account boolValueForProperty:@"Connecting"]) {
// If there's an error and we're not online and not connecting
NSMutableString *returnedMessage = [[[account lastDisconnectionError] mutableCopy] autorelease];
@@ -834,7 +834,7 @@
title = AILocalizedString(@"Connecting",nil);
} else if ([account boolValueForProperty:@"Disconnecting"]) {
title = AILocalizedString(@"Disconnecting",nil);
- } else if (account.online) {
+ } else if ([account boolValueForProperty:@"Online"]) {
title = AILocalizedString(@"Online",nil);
//XXX: why is this valueForProperty instead of boolValueForProperty?
@@ -931,7 +931,7 @@
[cell setEnabled:([account boolValueForProperty:@"Connecting"] ||
[account valueForProperty:@"Waiting to Reconnect"] ||
[account boolValueForProperty:@"Disconnecting"] ||
- account.online)];
+ [account boolValueForProperty:@"Online"])];
} else if ([identifier isEqualToString:@"statusicon"]) {
[cell accessibilitySetOverrideValue:@" "
diff -r ed69be5ac6da -r ea6a9624f030 Source/AIContactIdlePlugin.m
--- a/Source/AIContactIdlePlugin.m Tue Jun 09 21:56:03 2009 -0700
+++ b/Source/AIContactIdlePlugin.m Tue Jun 09 23:28:09 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 ea6a9624f030 Source/AIContactStatusEventsPlugin.m
--- a/Source/AIContactStatusEventsPlugin.m Tue Jun 09 21:56:03 2009 -0700
+++ b/Source/AIContactStatusEventsPlugin.m Tue Jun 09 23:28:09 2009 -0700
@@ -398,7 +398,7 @@
/* Events which are irrelevent if the contact is not online - these changes occur when we are
* just doing bookkeeping e.g. an away contact signs off, we clear the away flag, but they didn't actually
* come back from away. */
- if (inObject.online) {
+ if ([[inObject numberValueForProperty:@"Online"] boolValue]) {
if ([inModifiedKeys containsObject:@"StatusMessage"] || [inModifiedKeys containsObject:@"StatusType"]) {
NSNumber *newAwayNumber;
NSString *newStatusMessage;
diff -r ed69be5ac6da -r ea6a9624f030 Source/AIExtendedStatusPlugin.m
--- a/Source/AIExtendedStatusPlugin.m Tue Jun 09 21:56:03 2009 -0700
+++ b/Source/AIExtendedStatusPlugin.m Tue Jun 09 23:28:09 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 ea6a9624f030 Source/ESAccountEvents.m
--- a/Source/ESAccountEvents.m Tue Jun 09 21:56:03 2009 -0700
+++ b/Source/ESAccountEvents.m Tue Jun 09 23:28:09 2009 -0700
@@ -205,7 +205,7 @@
if ([inObject isKindOfClass:[AIAccount class]]) { //We only care about accounts
if ([inModifiedKeys containsObject:@"Online"]) {
- if (inObject.online) {
+ if ([[inObject numberValueForProperty:@"Online"] boolValue]) {
if (accountConnectionStatusGroupingOnlineTimer) {
[accountConnectionStatusGroupingOnlineTimer invalidate]; [accountConnectionStatusGroupingOnlineTimer release];
}
diff -r ed69be5ac6da -r ea6a9624f030 Source/ESFileTransferProgressView.m
--- a/Source/ESFileTransferProgressView.m Tue Jun 09 21:56:03 2009 -0700
+++ b/Source/ESFileTransferProgressView.m Tue Jun 09 23:28:09 2009 -0700
@@ -121,10 +121,7 @@
[progressIndicator setDisplayedWhenStopped:NO];
[progressIndicator setIndeterminate:YES];
[progressIndicator stopAnimation:self];
-
- //I don't trust setDisplayedWhenStopped... call me crazy.
- [progressIndicator setFrame:NSZeroRect];
- [progressIndicator setNeedsDisplay:YES];
+ [progressIndicator setHidden:YES];
//Top objects moving down
{
@@ -152,9 +149,6 @@
[box_transferStatusFrame setFrame:frame];
}
}
-
- //Display immediately
- [[self window] display];
}
}
diff -r ed69be5ac6da -r ea6a9624f030 Source/ESStatusSort.m
--- a/Source/ESStatusSort.m Tue Jun 09 21:56:03 2009 -0700
+++ b/Source/ESStatusSort.m Tue Jun 09 23:28:09 2009 -0700
@@ -567,8 +567,10 @@
*
* It's magic... but it's efficient magic!
*/
-NSInteger statusSort(id objectA, id objectB, BOOL groups, id<AIContainingObject> container)
+NSInteger statusSort(id objA, id objB, BOOL groups, id<AIContainingObject> container)
{
+ AIListObject *objectA = (AIListObject *)objA;
+ AIListObject *objectB = (AIListObject *)objB;
if (groups) {
if (sortGroupsAlphabetically) {
return [((AIListObject *)objectA).displayName compare:((AIListObject *)objectB).displayName];
@@ -610,10 +612,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