~jose-exposito89/ubuntuone-ios-files/Bug-1050848

« back to all changes in this revision

Viewing changes to Files/U1FolderViewController.m

  • Committer: Jason Foreman
  • Date: 2011-12-09 20:43:32 UTC
  • mfrom: (37.1.2 orange-navbar)
  • Revision ID: jason.foreman@canonical.com-20111209204332-rere6u5psiu3eu8e
MergeĀ lp:~threeve/ubuntuone-ios-files/orange-navbar

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
        UIBarButtonItem *uploadItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(uploadImage:)];
66
66
        [self.navigationItem setRightBarButtonItem:uploadItem];
67
67
        
68
 
        UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 20)];
69
 
        // TODO: Ubuntu font
70
 
        [titleLabel setFont:[UIFont boldSystemFontOfSize:18.f]];
71
 
        [titleLabel setTextColor:[UIColor blackColor]];
72
 
        [titleLabel setShadowColor:[UIColor whiteColor]];
73
 
        [titleLabel setShadowOffset:CGSizeMake(-1, -1)];
74
 
        [titleLabel setText:self.title];
75
 
        [titleLabel sizeToFit];
76
 
        [titleLabel setOpaque:NO];
77
 
        [titleLabel setBackgroundColor:[UIColor clearColor]];
78
 
        [self.navigationItem setTitleView:titleLabel];
79
 
        [titleLabel release];
80
68
        [uploadItem release];
81
69
        
82
70
        return self;
253
241
                                           NSString *filename = [NSString stringWithFormat:@"%@ %@.%@", assetType, [dateFormatter stringFromDate:assetDate], ext];
254
242
                                           [dateFormatter release];
255
243
                                           
256
 
                                           // TODO: fix!
257
 
                                           U1Asset *u1asset = [autoUploadsManager createU1AssetWithAsset:asset group:nil URLString:[imageURL absoluteString] fileName:filename inFolder:self.node context:nil];
 
244
                                           __block U1Asset *u1asset = nil;
 
245
                                           [[U1DataRepository sharedDataRepository] dispatchBlockWithMainContext:^(NSManagedObjectContext *context) {
 
246
                                                   u1asset = [[autoUploadsManager createU1AssetWithAsset:asset group:nil URLString:[imageURL absoluteString] fileName:filename inFolder:self.node context:context] retain];
 
247
                                           }];
 
248
                                           [u1asset autorelease];
258
249
                                           
259
250
                                           if (u1asset.generation == nil) // Prevent duplicate uploading to the same folder
260
251
                                           {