adium 3143:01935f3e945b: Perform icon mask calculation off the m...
commits at adium.im
commits at adium.im
Sun Feb 28 23:33:18 UTC 2010
details: http://hg.adium.im/adium/rev/01935f3e945b
revision: 3143:01935f3e945b
author: Stephen Holt <sholt at adium.im>
date: Sun Feb 28 18:25:41 2010 -0500
Perform icon mask calculation off the main thread, which can block with I/O delays.
diffs (38 lines):
diff -r 5670afd3014c -r 01935f3e945b Plugins/WebKit Message View/AIWebKitMessageViewController.m
--- a/Plugins/WebKit Message View/AIWebKitMessageViewController.m Sun Feb 28 14:01:50 2010 -0500
+++ b/Plugins/WebKit Message View/AIWebKitMessageViewController.m Sun Feb 28 18:25:41 2010 -0500
@@ -50,6 +50,7 @@
#import <AIUtilities/AIStringAdditions.h>
#import <AIUtilities/AIAttributedStringAdditions.h>
#import <AIUtilities/JVMarkedScroller.h>
+#import <AIUtilities/AISharedWriterQueue.h>
#import <objc/objc-runtime.h>
#define KEY_WEBKIT_CHATS_USING_CACHED_ICON @"WebKit:Chats Using Cached Icon"
@@ -73,6 +74,7 @@
- (void)releaseCurrentWebKitUserIconForObject:(AIListObject *)inObject;
- (void)releaseAllCachedIcons;
- (void)updateUserIconForObject:(AIListObject *)inObject;
+- (void)_updateUserIconForObject:(AIListObject *)inObject;
- (void)userIconForObjectDidChange:(AIListObject *)inObject;
- (void)updateServiceIcon;
- (void)updateTopic;
@@ -1219,10 +1221,17 @@
}
}
+- (void)updateUserIconForObject:(AIListObject *)inObject
+{
+ [AISharedWriterQueue addOperation:
+ [[[NSInvocationOperation alloc] initWithTarget:self
+ selector:@selector(_updateUserIconForObject:)
+ object:inObject] autorelease]];
+}
/*!
* @brief Generate an updated masked user icon for the passed list object
*/
-- (void)updateUserIconForObject:(AIListObject *)inObject
+- (void)_updateUserIconForObject:(AIListObject *)inObject
{
AIListObject *iconSourceObject = ([inObject isKindOfClass:[AIListContact class]] ?
[(AIListContact *)inObject parentContact] :
More information about the commits
mailing list