From 02735663649dfde40b64f23abe4cc346295574ec Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Mon, 14 Mar 2011 04:45:42 -0700 Subject: Try to avoid jumbling source icons. --- MobileCydia.mm | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/MobileCydia.mm b/MobileCydia.mm index ab8dab3..ca07872 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -7996,6 +7996,7 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { @interface SourceCell : CyteTableViewCell < CyteTableViewCellDelegate > { + _H url_; _H icon_; _H origin_; _H label_; @@ -8007,9 +8008,11 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { @implementation SourceCell -- (void) _setImage:(UIImage *)image { - icon_ = image; - [content_ setNeedsDisplay]; +- (void) _setImage:(NSArray *)data { + if ([url_ isEqual:[data objectAtIndex:0]]) { + icon_ = [data objectAtIndex:1]; + [content_ setNeedsDisplay]; + } } - (void) _setSource:(NSURL *) url { @@ -8026,7 +8029,7 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { error:NULL ]) if (UIImage *image = [UIImage imageWithData:data]) - [self performSelectorOnMainThread:@selector(_setImage:) withObject:image waitUntilDone:NO]; + [self performSelectorOnMainThread:@selector(_setImage:) withObject:[NSArray arrayWithObjects:url, image, nil] waitUntilDone:NO]; [pool release]; } @@ -8039,8 +8042,8 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { [content_ setNeedsDisplay]; - if (NSURL *url = [source iconURL]) - [NSThread detachNewThreadSelector:@selector(_setSource:) toTarget:self withObject:url]; + url_ = [source iconURL]; + [NSThread detachNewThreadSelector:@selector(_setSource:) toTarget:self withObject:url_]; } - (SourceCell *) initWithFrame:(CGRect)frame reuseIdentifier:(NSString *)reuseIdentifier { -- cgit v1.2.3