adium 2928:f1eb7d4192c6: Changes in manual ordering must be rela...

commits at adium.im commits at adium.im
Sun Nov 22 01:04:11 UTC 2009


details:	http://hg.adium.im/adium/rev/f1eb7d4192c6
revision:	2928:f1eb7d4192c6
author:		Evan Schoenberg
date:		Sat Nov 21 19:07:24 2009 -0600

Changes in manual ordering must be relative to the visible objects within a group, not all of them, or the results wrong. I'm not sure how this was ever working; I suspect that it was relying on a sorting bug elsewhere in Adium which has been fixed in 1.4. Fixes #12096

diffs (23 lines):

diff -r a69b09404fae -r f1eb7d4192c6 Frameworks/Adium Framework/Source/AIListObject.m
--- a/Frameworks/Adium Framework/Source/AIListObject.m	Sat Nov 21 19:00:31 2009 -0600
+++ b/Frameworks/Adium Framework/Source/AIListObject.m	Sat Nov 21 19:07:24 2009 -0600
@@ -220,8 +220,8 @@
 		
 	} else {
 		//Moved somewhere in the middle.  New index is the average of the next largest and smallest index
-		AIListObject	*previousObject = [container.containedObjects objectAtIndex:index-1];
-		AIListObject	*nextObject = [container.containedObjects objectAtIndex:index];
+		AIListObject	*previousObject = [container.visibleContainedObjects objectAtIndex:index-1];
+		AIListObject	*nextObject = [container.visibleContainedObjects objectAtIndex:index];
 		CGFloat nextLowest = [container orderIndexForObject:previousObject];
 		CGFloat nextHighest = [container orderIndexForObject:nextObject];
 		
@@ -239,7 +239,7 @@
 		 * 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 %@)",
-						   container, listObject, container.containedObjects, index, 
+						   container, listObject, container.visibleContainedObjects, index, 
 						   (nextHighest + nextLowest) / 2.0, nextObject, previousObject);
 		[container listObject: listObject didSetOrderIndex: (nextHighest + nextLowest) / 2.0];
 	}	



More information about the commits mailing list