|
@@ -292,6 +292,35 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+#pragma --------------------------------------------------------------------------------------------
|
|
|
+#pragma mark - ==== download Thumbnail ====
|
|
|
+#pragma --------------------------------------------------------------------------------------------
|
|
|
+
|
|
|
+- (void)downloadThumbnailSuccess:(CCMetadataNet *)metadataNet
|
|
|
+{
|
|
|
+ __block CCTransfersCell *cell;
|
|
|
+
|
|
|
+ NSIndexPath *indexPath = [_sectionDataSource.fileIDIndexPath objectForKey:metadataNet.fileID];
|
|
|
+
|
|
|
+ if (indexPath && [[NSFileManager defaultManager] fileExistsAtPath:[NSString stringWithFormat:@"%@/%@.ico", app.directoryUser, metadataNet.fileID]]) {
|
|
|
+
|
|
|
+ cell = [self.tableView cellForRowAtIndexPath:indexPath];
|
|
|
+
|
|
|
+ cell.fileImageView.image = [app.icoImagesCache objectForKey:metadataNet.fileID];
|
|
|
+
|
|
|
+ if (cell.fileImageView.image == nil) {
|
|
|
+
|
|
|
+ dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{
|
|
|
+
|
|
|
+ UIImage *image = [UIImage imageWithContentsOfFile:[NSString stringWithFormat:@"%@/%@.ico", app.directoryUser, metadataNet.fileID]];
|
|
|
+
|
|
|
+ [app.icoImagesCache setObject:image forKey:metadataNet.fileID];
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
#pragma --------------------------------------------------------------------------------------------
|
|
|
#pragma mark - ==== Datasource ====
|
|
|
#pragma --------------------------------------------------------------------------------------------
|
|
@@ -607,6 +636,9 @@
|
|
|
} else {
|
|
|
|
|
|
cell.fileImageView.image = [UIImage imageNamed:metadata.iconName];
|
|
|
+
|
|
|
+ if (metadata.thumbnailExists)
|
|
|
+ [[CCActions sharedInstance] downloadTumbnail:metadata delegate:self];
|
|
|
}
|
|
|
|
|
|
// ----------------------------------------------------------------------------------------------------------
|