summaryrefslogtreecommitdiff
path: root/MobileCydia.mm
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2011-03-14 04:45:42 -0700
committerJay Freeman (saurik) <saurik@saurik.com>2011-03-14 05:09:12 -0700
commit02735663649dfde40b64f23abe4cc346295574ec (patch)
tree08ecd810939901bc6217ecc8c759d8ab8fb58796 /MobileCydia.mm
parentb57de6bc1062b5e966d13539d53f9528c8db739d (diff)
Try to avoid jumbling source icons.
Diffstat (limited to 'MobileCydia.mm')
-rw-r--r--MobileCydia.mm15
1 files 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<NSURL> url_;
_H<UIImage> icon_;
_H<NSString> origin_;
_H<NSString> 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 {