adium 2532:700469827eee: Minor code cleanup to make this shorter...

commits at adium.im commits at adium.im
Mon Jun 29 04:09:33 UTC 2009


details:	http://hg.adium.im/adium/rev/700469827eee
revision:	2532:700469827eee
author:		David Smith <catfish.man at gmail.com>
date:		Sun Jun 28 21:09:24 2009 -0700

Minor code cleanup to make this shorter in preparation for Colin and me hacking on it a bit

diffs (53 lines):

diff -r 1b797e2e9b8e -r 700469827eee Plugins/WebKit Message View/AIWebKitMessageViewController.m
--- a/Plugins/WebKit Message View/AIWebKitMessageViewController.m	Sat Jun 27 01:47:48 2009 -0700
+++ b/Plugins/WebKit Message View/AIWebKitMessageViewController.m	Sun Jun 28 21:09:24 2009 -0700
@@ -576,20 +576,20 @@
  */
 - (void)processQueuedContent
 {
-	NSUInteger	contentQueueCount, objectsAdded = 0;
-	BOOL		willAddMoreContentObjects = NO;
+	/* If the webview isn't ready, assume we have at least one piece of content left to display */
+	NSUInteger	contentQueueCount = 1;
+	NSUInteger	objectsAdded = 0;
 	
 	if (webViewIsReady) {
-		contentQueueCount = [contentQueue count];
+		contentQueueCount = contentQueue.count;
 
 		while (contentQueueCount > 0) {
-			AIContentObject *content;
-
-			willAddMoreContentObjects = (contentQueueCount > 1);
+			BOOL willAddMoreContent = (contentQueueCount > 1);
 			
 			//Display the content
-			content = [contentQueue objectAtIndex:0];
-			[self _processContentObject:content willAddMoreContentObjects:willAddMoreContentObjects];
+			AIContentObject *content = [contentQueue objectAtIndex:0];
+			[self _processContentObject:content 
+			  willAddMoreContentObjects:willAddMoreContent];
 
 			//If we are going to reflect preference changes, store this content object
 			if (shouldReflectPreferenceChanges) {
@@ -601,18 +601,15 @@
 			objectsAdded++;
 			contentQueueCount--;
 		}
-	} else {
-		/* If the webview isn't ready, assume we have at least one piece of content left to display */
-		contentQueueCount = 1;
 	}
 	
 	/* If we added two or more objects, we may want to scroll to the bottom now, having not done it as each object
 	 * was added.
 	 */
 	if (objectsAdded > 1) {
-		NSString	*scrollToBottomScript;
+		NSString	*scrollToBottomScript = [messageStyle scriptForScrollingAfterAddingMultipleContentObjects];
 		
-		if ((scrollToBottomScript = [messageStyle scriptForScrollingAfterAddingMultipleContentObjects])) {
+		if (scrollToBottomScript) {
 			[webView stringByEvaluatingJavaScriptFromString:scrollToBottomScript];
 		}
 	}




More information about the commits mailing list