Fix indentation tab/space

This commit is contained in:
Olivier Poitrey 2012-12-10 15:28:37 +01:00
parent 616d824dc7
commit 84fe4a6669
1 changed files with 31 additions and 31 deletions

View File

@ -51,12 +51,12 @@
{ {
dispatch_async(dispatch_get_main_queue(), ^ dispatch_async(dispatch_get_main_queue(), ^
{ {
if (self.isCancelled) if (self.isCancelled)
{ {
self.finished = YES; self.finished = YES;
[self reset]; [self reset];
return; return;
} }
self.executing = YES; self.executing = YES;
self.connection = [NSURLConnection.alloc initWithRequest:self.request delegate:self startImmediately:NO]; self.connection = [NSURLConnection.alloc initWithRequest:self.request delegate:self startImmediately:NO];
@ -147,16 +147,16 @@
{ {
if (![response respondsToSelector:@selector(statusCode)] || [((NSHTTPURLResponse *)response) statusCode] < 400) if (![response respondsToSelector:@selector(statusCode)] || [((NSHTTPURLResponse *)response) statusCode] < 400)
{ {
NSUInteger expected = response.expectedContentLength > 0 ? (NSUInteger)response.expectedContentLength : 0; NSUInteger expected = response.expectedContentLength > 0 ? (NSUInteger)response.expectedContentLength : 0;
self.expectedSize = expected; self.expectedSize = expected;
if (self.progressBlock) if (self.progressBlock)
{ {
self.progressBlock(0, expected); self.progressBlock(0, expected);
} }
dispatch_async(self.queue, ^ dispatch_async(self.queue, ^
{ {
self.imageData = [NSMutableData.alloc initWithCapacity:expected]; self.imageData = [NSMutableData.alloc initWithCapacity:expected];
}); });
} }
else else
@ -264,16 +264,16 @@
{ {
self.connection = nil; self.connection = nil;
[[NSNotificationCenter defaultCenter] postNotificationName:SDWebImageDownloadStopNotification object:nil]; [[NSNotificationCenter defaultCenter] postNotificationName:SDWebImageDownloadStopNotification object:nil];
SDWebImageDownloaderCompletedBlock completionBlock = self.completedBlock; SDWebImageDownloaderCompletedBlock completionBlock = self.completedBlock;
if (completionBlock) if (completionBlock)
{ {
dispatch_async(self.queue, ^ dispatch_async(self.queue, ^
{ {
UIImage *image = [UIImage decodedImageWithImage:SDScaledImageForPath(self.request.URL.absoluteString, self.imageData)]; UIImage *image = [UIImage decodedImageWithImage:SDScaledImageForPath(self.request.URL.absoluteString, self.imageData)];
dispatch_async(dispatch_get_main_queue(), ^ dispatch_async(dispatch_get_main_queue(), ^
{ {
if (CGSizeEqualToSize(image.size, CGSizeZero)) if (CGSizeEqualToSize(image.size, CGSizeZero))
{ {
completionBlock(nil, nil, [NSError errorWithDomain:@"SDWebImageErrorDomain" code:0 userInfo:@{NSLocalizedDescriptionKey: @"Downloaded image has 0 pixels"}], YES); completionBlock(nil, nil, [NSError errorWithDomain:@"SDWebImageErrorDomain" code:0 userInfo:@{NSLocalizedDescriptionKey: @"Downloaded image has 0 pixels"}], YES);
@ -282,15 +282,15 @@
{ {
completionBlock(image, self.imageData, nil, YES); completionBlock(image, self.imageData, nil, YES);
} }
self.completionBlock = nil; self.completionBlock = nil;
[self done]; [self done];
}); });
}); });
} }
else else
{ {
[self done]; [self done];
} }
} }
- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error