match floppy icons with mac icons
Before Width: | Height: | Size: 265 B After Width: | Height: | Size: 241 B |
Before Width: | Height: | Size: 508 B After Width: | Height: | Size: 411 B |
Before Width: | Height: | Size: 798 B After Width: | Height: | Size: 661 B |
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "floppyV.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "floppyV@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"filename" : "floppyV@3x.png",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 279 B |
After Width: | Height: | Size: 467 B |
After Width: | Height: | Size: 731 B |
|
@ -523,13 +523,15 @@
|
|||
_filePath = filePath;
|
||||
NSString *fileName = filePath.lastPathComponent;
|
||||
self.textLabel.text = self.showExtension ? fileName : fileName.stringByDeletingPathExtension;
|
||||
NSDictionary *attributes = [[NSURL fileURLWithPath:filePath] resourceValuesForKeys:@[NSURLTotalFileSizeKey] error:NULL];
|
||||
NSDictionary *attributes = [[NSURL fileURLWithPath:filePath] resourceValuesForKeys:@[NSURLTotalFileSizeKey, NSURLFileSizeKey] error:NULL];
|
||||
if (attributes && attributes[NSURLTotalFileSizeKey]) {
|
||||
BOOL isDiskImage = [[AppDelegate sharedInstance].diskImageExtensions containsObject:fileName.pathExtension.lowercaseString];
|
||||
if (isDiskImage) {
|
||||
UIImage *icon = [UIImage imageWithIconForDiskImage:filePath];
|
||||
if (icon == nil) {
|
||||
icon = [UIImage imageNamed:@"floppy"];
|
||||
NSInteger fileSize = [attributes[NSURLTotalFileSizeKey] integerValue];
|
||||
NSInteger numBlocks = fileSize / 512;
|
||||
icon = [UIImage imageNamed:numBlocks == 800 || numBlocks == 1600 ? @"floppy" : @"floppyV"];
|
||||
}
|
||||
self.imageView.image = icon;
|
||||
} else {
|
||||
|
|