Revision 72744ed1

b/Classes/FolderViewController.m
27 27
#import "JSON.h"
28 28
#import "APICallback.h"
29 29
#import "OpenStackAppDelegate.h"
30
#import <MobileCoreServices/MobileCoreServices.h>
30 31

  
31 32

  
32 33
@implementation FolderViewController
......
211 212
            cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
212 213
        }
213 214
        
214
        id item = [[self.folder sortedContents] objectAtIndex:indexPath.row];    
215
        id item = [[self.folder sortedContents] objectAtIndex:indexPath.row];
216
        [cell.textLabel setLineBreakMode:UILineBreakModeTailTruncation];
215 217
        cell.textLabel.text = [item name];
216 218
        
217 219
        if ([[item class] isEqual:[Folder class]]) {
......
236 238
            }
237 239
            cell.detailTextLabel.text = [NSString stringWithFormat:@"%@%@", folderString, objectString];
238 240
        } else if ([[item class] isEqual:[StorageObject class]]) {
241
            [cell.textLabel setLineBreakMode:UILineBreakModeMiddleTruncation];
239 242
            cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
240 243
            
241 244
            StorageObject *object = item;
242
            OpenStackAppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
243
            NSString *filePath = [appDelegate.cachedObjectsDictionary objectForKey:object.hash];
244
            if ([[NSFileManager defaultManager] fileExistsAtPath:filePath]) {
245
                UIDocumentInteractionController *udic = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:filePath]];
246
                if ([udic.icons count] > 0) {
247
                    cell.imageView.image = [udic.icons objectAtIndex:0];                    
248
                }
249
            } else {
250
                NSString *emptyPath = [[NSBundle mainBundle] pathForResource:@"empty-file" ofType:@""];
251
                UIDocumentInteractionController *udic = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:emptyPath]];
252
                if ([udic.icons count] > 0) {
253
                    cell.imageView.image = [udic.icons objectAtIndex:0]; //[UIImage imageNamed:@"file-icon.png"];        
254
                }
255
            }
245
            CFStringRef mimeType = (CFStringRef)object.contentType;
246
            CFStringRef uti = UTTypeCreatePreferredIdentifierForTag(kUTTagClassMIMEType, mimeType, NULL);
247
            NSString *emptyPath = [[NSBundle mainBundle] pathForResource:@"empty-file" ofType:@""];
248
            UIDocumentInteractionController *udic = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:emptyPath]];
249
            if (((NSString *)uti).length > 0)
250
                udic.UTI = (NSString *)uti;
251
            if ([udic.icons count] > 0) 
252
                cell.imageView.image = [udic.icons objectAtIndex:0];
256 253
            cell.detailTextLabel.text = [NSString stringWithFormat:@"%@, %@", [item humanizedBytes], [item contentType]];
257 254
        }
258 255
        
b/OpenStack-Info.plist
43 43
	<key>CFBundlePackageType</key>
44 44
	<string>APPL</string>
45 45
	<key>CFBundleShortVersionString</key>
46
	<string>1.0.3</string>
46
	<string>1.0.4</string>
47 47
	<key>CFBundleSignature</key>
48 48
	<string>????</string>
49 49
	<key>CFBundleURLTypes</key>
......
58 58
		</dict>
59 59
	</array>
60 60
	<key>CFBundleVersion</key>
61
	<string>20120423.0</string>
61
	<string>20120529.0</string>
62 62
	<key>LSRequiresIPhoneOS</key>
63 63
	<true/>
64 64
	<key>NSMainNibFile</key>

Also available in: Unified diff