Merge lp:~threeve/ubuntuone-ios-files/polish-and-shine into lp:ubuntuone-ios-files
- polish-and-shine
- Merge into trunk
Proposed by
Jason Foreman
Status: | Merged |
---|---|
Approved by: | Zachery Bir |
Approved revision: | 50 |
Merged at revision: | 44 |
Proposed branch: | lp:~threeve/ubuntuone-ios-files/polish-and-shine |
Merge into: | lp:ubuntuone-ios-files |
Diff against target: |
640 lines (+304/-30) 13 files modified
Dependencies/RIButtonItem.m (+7/-0) Files.xcodeproj/project.pbxproj (+18/-6) Files/Files-Info.plist (+1/-1) Files/FilesAppDelegate.m (+1/-1) Files/U1AssetRepresenationDataProvider.m (+2/-2) Files/U1AutoUploadsManager.m (+4/-4) Files/U1FilesClient.m (+7/-6) Files/U1FilesService.m (+3/-2) Files/U1FolderViewController.m (+2/-2) Files/U1LoginController.m (+8/-5) Files/U1LoginController.xib (+245/-0) Files/U1SettingsViewController.m (+1/-0) Files/U1VolumesViewController.m (+5/-1) |
To merge this branch: | bzr merge lp:~threeve/ubuntuone-ios-files/polish-and-shine |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Zachery Bir | Approve | ||
Review via email: mp+85500@code.launchpad.net |
Commit message
Description of the change
Fixing leaks and warning, small visual tweaks
To post a comment you must log in.
Revision history for this message
Zachery Bir (urbanape) wrote : | # |
- 50. By Jason Foreman
-
Merge trunk
Revision history for this message
Zachery Bir (urbanape) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'Assets/ic_folder.png' |
2 | Binary files Assets/ic_folder.png 2011-08-31 14:56:30 +0000 and Assets/ic_folder.png 2011-12-13 16:37:23 +0000 differ |
3 | === modified file 'Assets/ic_folder@2x.png' |
4 | Binary files Assets/ic_folder@2x.png 2011-08-31 14:56:30 +0000 and Assets/ic_folder@2x.png 2011-12-13 16:37:23 +0000 differ |
5 | === added file 'Assets/u1_folder.png' |
6 | Binary files Assets/u1_folder.png 1970-01-01 00:00:00 +0000 and Assets/u1_folder.png 2011-12-13 16:37:23 +0000 differ |
7 | === added file 'Assets/u1_folder@2x.png' |
8 | Binary files Assets/u1_folder@2x.png 1970-01-01 00:00:00 +0000 and Assets/u1_folder@2x.png 2011-12-13 16:37:23 +0000 differ |
9 | === modified file 'Dependencies/RIButtonItem.m' |
10 | --- Dependencies/RIButtonItem.m 2011-10-31 17:16:15 +0000 |
11 | +++ Dependencies/RIButtonItem.m 2011-12-13 16:37:23 +0000 |
12 | @@ -24,5 +24,12 @@ |
13 | return newItem; |
14 | } |
15 | |
16 | +- (void)dealloc; |
17 | +{ |
18 | + [label release]; |
19 | + [action release]; |
20 | + [super dealloc]; |
21 | +} |
22 | + |
23 | @end |
24 | |
25 | |
26 | === modified file 'Files.xcodeproj/project.pbxproj' |
27 | --- Files.xcodeproj/project.pbxproj 2011-12-09 20:31:25 +0000 |
28 | +++ Files.xcodeproj/project.pbxproj 2011-12-13 16:37:23 +0000 |
29 | @@ -79,6 +79,7 @@ |
30 | 96733B10140DFD510074D545 /* SFHFKeychainUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 96733B0F140DFD510074D545 /* SFHFKeychainUtils.m */; }; |
31 | 96733B12140DFD6D0074D545 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 96733B11140DFD6D0074D545 /* Security.framework */; }; |
32 | 96733B15140E04940074D545 /* UIActionSheet+U1Additions.m in Sources */ = {isa = PBXBuildFile; fileRef = 96733B14140E04940074D545 /* UIActionSheet+U1Additions.m */; }; |
33 | + 96754B6E1496A7F3001D2A64 /* U1LoginController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 96754B6D1496A7F3001D2A64 /* U1LoginController.xib */; }; |
34 | 969EF22913F8C10C00CEF6CB /* U1VolumesViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 969EF22713F8C10C00CEF6CB /* U1VolumesViewController.m */; }; |
35 | 969EF22A13F8C10C00CEF6CB /* U1VolumesViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 969EF22813F8C10C00CEF6CB /* U1VolumesViewController.xib */; }; |
36 | 96A1699C1430C95E00E4C990 /* 04-eye.png in Resources */ = {isa = PBXBuildFile; fileRef = 96A1699A1430C95E00E4C990 /* 04-eye.png */; }; |
37 | @@ -91,6 +92,8 @@ |
38 | 96B20E6E145F6AAE00D8ED69 /* 218-trash2@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 96B20E6C145F6AAE00D8ED69 /* 218-trash2@2x.png */; }; |
39 | 96B20E78145F815500D8ED69 /* Reachability.m in Sources */ = {isa = PBXBuildFile; fileRef = 96B20E77145F815500D8ED69 /* Reachability.m */; }; |
40 | 96B20E7A145F819300D8ED69 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 96B20E79145F819200D8ED69 /* SystemConfiguration.framework */; }; |
41 | + 96B2B77B1497042D0078D952 /* u1_folder.png in Resources */ = {isa = PBXBuildFile; fileRef = 96B2B7791497042D0078D952 /* u1_folder.png */; }; |
42 | + 96B2B77C1497042D0078D952 /* u1_folder@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 96B2B77A1497042D0078D952 /* u1_folder@2x.png */; }; |
43 | 96C12F0114842F6300E53FCA /* U1FilePreviewViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 96C12EFF14842F6300E53FCA /* U1FilePreviewViewController.m */; }; |
44 | 96C12F0214842F6300E53FCA /* U1FilePreviewViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 96C12F0014842F6300E53FCA /* U1FilePreviewViewController.xib */; }; |
45 | 96CAD3C71457823B007A496C /* NSDictionary+U1Additions.m in Sources */ = {isa = PBXBuildFile; fileRef = 96CAD3C61457823B007A496C /* NSDictionary+U1Additions.m */; }; |
46 | @@ -277,6 +280,7 @@ |
47 | 96733B11140DFD6D0074D545 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; }; |
48 | 96733B13140E04940074D545 /* UIActionSheet+U1Additions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIActionSheet+U1Additions.h"; sourceTree = "<group>"; }; |
49 | 96733B14140E04940074D545 /* UIActionSheet+U1Additions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIActionSheet+U1Additions.m"; sourceTree = "<group>"; }; |
50 | + 96754B6D1496A7F3001D2A64 /* U1LoginController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = U1LoginController.xib; sourceTree = "<group>"; }; |
51 | 969EF22613F8C10C00CEF6CB /* U1VolumesViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = U1VolumesViewController.h; sourceTree = "<group>"; }; |
52 | 969EF22713F8C10C00CEF6CB /* U1VolumesViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = U1VolumesViewController.m; sourceTree = "<group>"; }; |
53 | 969EF22813F8C10C00CEF6CB /* U1VolumesViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = U1VolumesViewController.xib; sourceTree = "<group>"; }; |
54 | @@ -294,6 +298,8 @@ |
55 | 96B20E76145F815500D8ED69 /* Reachability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Reachability.h; sourceTree = "<group>"; }; |
56 | 96B20E77145F815500D8ED69 /* Reachability.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Reachability.m; sourceTree = "<group>"; }; |
57 | 96B20E79145F819200D8ED69 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; |
58 | + 96B2B7791497042D0078D952 /* u1_folder.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = u1_folder.png; path = Assets/u1_folder.png; sourceTree = "<group>"; }; |
59 | + 96B2B77A1497042D0078D952 /* u1_folder@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "u1_folder@2x.png"; path = "Assets/u1_folder@2x.png"; sourceTree = "<group>"; }; |
60 | 96C12EFE14842F6300E53FCA /* U1FilePreviewViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = U1FilePreviewViewController.h; sourceTree = "<group>"; }; |
61 | 96C12EFF14842F6300E53FCA /* U1FilePreviewViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = U1FilePreviewViewController.m; sourceTree = "<group>"; }; |
62 | 96C12F0014842F6300E53FCA /* U1FilePreviewViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = U1FilePreviewViewController.xib; sourceTree = "<group>"; }; |
63 | @@ -495,6 +501,7 @@ |
64 | 96733AEF140DFAC60074D545 /* UOSSOCredentialsViewController.xib */, |
65 | 96733AF0140DFAC60074D545 /* U1LoginController.h */, |
66 | 96733AF1140DFAC60074D545 /* U1LoginController.m */, |
67 | + 96754B6D1496A7F3001D2A64 /* U1LoginController.xib */, |
68 | 96733B0B140DFCCB0074D545 /* U1AccountManager.h */, |
69 | 96733B0C140DFCCB0074D545 /* U1AccountManager.m */, |
70 | ); |
71 | @@ -504,6 +511,8 @@ |
72 | 96783E6513F8ABC70092C6A1 /* Assets */ = { |
73 | isa = PBXGroup; |
74 | children = ( |
75 | + 96B2B7791497042D0078D952 /* u1_folder.png */, |
76 | + 96B2B77A1497042D0078D952 /* u1_folder@2x.png */, |
77 | 96327C041492A13100607EF3 /* navbar.png */, |
78 | 96327C051492A13100607EF3 /* navbar@2x.png */, |
79 | 91D403601461ADE7005C66A8 /* upload.png */, |
80 | @@ -824,9 +833,9 @@ |
81 | /* End PBXGroup section */ |
82 | |
83 | /* Begin PBXNativeTarget section */ |
84 | - 96E860B013F7251D0026783D /* Files */ = { |
85 | + 96E860B013F7251D0026783D /* U1Files */ = { |
86 | isa = PBXNativeTarget; |
87 | - buildConfigurationList = 96E860EE13F7251D0026783D /* Build configuration list for PBXNativeTarget "Files" */; |
88 | + buildConfigurationList = 96E860EE13F7251D0026783D /* Build configuration list for PBXNativeTarget "U1Files" */; |
89 | buildPhases = ( |
90 | 96E860AD13F7251D0026783D /* Sources */, |
91 | 96E860AE13F7251D0026783D /* Frameworks */, |
92 | @@ -837,7 +846,7 @@ |
93 | ); |
94 | dependencies = ( |
95 | ); |
96 | - name = Files; |
97 | + name = U1Files; |
98 | productName = Files; |
99 | productReference = 96E860B113F7251D0026783D /* Files.app */; |
100 | productType = "com.apple.product-type.application"; |
101 | @@ -881,7 +890,7 @@ |
102 | projectDirPath = ""; |
103 | projectRoot = ""; |
104 | targets = ( |
105 | - 96E860B013F7251D0026783D /* Files */, |
106 | + 96E860B013F7251D0026783D /* U1Files */, |
107 | 96E860D913F7251D0026783D /* FilesTests */, |
108 | ); |
109 | }; |
110 | @@ -937,6 +946,9 @@ |
111 | 96C12F0214842F6300E53FCA /* U1FilePreviewViewController.xib in Resources */, |
112 | 96327C061492A13100607EF3 /* navbar.png in Resources */, |
113 | 96327C071492A13100607EF3 /* navbar@2x.png in Resources */, |
114 | + 96754B6E1496A7F3001D2A64 /* U1LoginController.xib in Resources */, |
115 | + 96B2B77B1497042D0078D952 /* u1_folder.png in Resources */, |
116 | + 96B2B77C1497042D0078D952 /* u1_folder@2x.png in Resources */, |
117 | ); |
118 | runOnlyForDeploymentPostprocessing = 0; |
119 | }; |
120 | @@ -1076,7 +1088,7 @@ |
121 | /* Begin PBXTargetDependency section */ |
122 | 96E860E113F7251D0026783D /* PBXTargetDependency */ = { |
123 | isa = PBXTargetDependency; |
124 | - target = 96E860B013F7251D0026783D /* Files */; |
125 | + target = 96E860B013F7251D0026783D /* U1Files */; |
126 | targetProxy = 96E860E013F7251D0026783D /* PBXContainerItemProxy */; |
127 | }; |
128 | /* End PBXTargetDependency section */ |
129 | @@ -1268,7 +1280,7 @@ |
130 | defaultConfigurationIsVisible = 0; |
131 | defaultConfigurationName = Release; |
132 | }; |
133 | - 96E860EE13F7251D0026783D /* Build configuration list for PBXNativeTarget "Files" */ = { |
134 | + 96E860EE13F7251D0026783D /* Build configuration list for PBXNativeTarget "U1Files" */ = { |
135 | isa = XCConfigurationList; |
136 | buildConfigurations = ( |
137 | 96E860EF13F7251D0026783D /* Debug */, |
138 | |
139 | === modified file 'Files/Files-Info.plist' |
140 | --- Files/Files-Info.plist 2011-12-13 02:15:46 +0000 |
141 | +++ Files/Files-Info.plist 2011-12-13 16:37:23 +0000 |
142 | @@ -5,7 +5,7 @@ |
143 | <key>CFBundleDevelopmentRegion</key> |
144 | <string>en</string> |
145 | <key>CFBundleDisplayName</key> |
146 | - <string>${PRODUCT_NAME}</string> |
147 | + <string>U1 Files</string> |
148 | <key>CFBundleExecutable</key> |
149 | <string>${EXECUTABLE_NAME}</string> |
150 | <key>CFBundleIconFile</key> |
151 | |
152 | === modified file 'Files/FilesAppDelegate.m' |
153 | --- Files/FilesAppDelegate.m 2011-12-06 19:44:22 +0000 |
154 | +++ Files/FilesAppDelegate.m 2011-12-13 16:37:23 +0000 |
155 | @@ -156,7 +156,7 @@ |
156 | [self.volumesNavController setViewControllers:[NSArray arrayWithObject:volumesViewController]]; |
157 | U1UploadsPoolViewController *assetsViewController = [[[U1UploadsPoolViewController alloc] init] autorelease]; |
158 | [self.cameraNavController setViewControllers:[NSArray arrayWithObject:assetsViewController]]; |
159 | - U1SettingsViewController *settingsViewController = [[U1SettingsViewController alloc] initWithNibName:@"U1SettingsViewController" bundle:nil]; |
160 | + U1SettingsViewController *settingsViewController = [[[U1SettingsViewController alloc] initWithNibName:@"U1SettingsViewController" bundle:nil] autorelease]; |
161 | [self.settingsNavController setViewControllers:[NSArray arrayWithObject:settingsViewController]]; |
162 | } |
163 | |
164 | |
165 | === modified file 'Files/U1AssetRepresenationDataProvider.m' |
166 | --- Files/U1AssetRepresenationDataProvider.m 2011-12-08 14:17:47 +0000 |
167 | +++ Files/U1AssetRepresenationDataProvider.m 2011-12-13 16:37:23 +0000 |
168 | @@ -51,7 +51,7 @@ |
169 | if (block) |
170 | { |
171 | NSError *error = [NSError errorWithDomain:@"nonexistentAsset" code:1 userInfo:nil]; |
172 | - block(nil, nil, nil, error); |
173 | + block(nil, nil, 0, error); |
174 | } |
175 | } |
176 | else |
177 | @@ -60,7 +60,7 @@ |
178 | uint8_t *buffer = (uint8_t*)malloc(representation.size); |
179 | NSUInteger length = [representation getBytes:buffer fromOffset:0 length:representation.size error:nil]; |
180 | NSData *imageData = [NSData dataWithBytesNoCopy:buffer length:length freeWhenDone:YES]; |
181 | - NSString *mimeType = (id)UTTypeCopyPreferredTagWithClass((CFStringRef)[representation UTI], kUTTagClassMIMEType); |
182 | + NSString *mimeType = [(id)UTTypeCopyPreferredTagWithClass((CFStringRef)[representation UTI], kUTTagClassMIMEType) autorelease]; |
183 | NSInputStream *dataStream = [NSInputStream inputStreamWithData:imageData]; |
184 | if (block) |
185 | block(dataStream, mimeType, length, nil); |
186 | |
187 | === modified file 'Files/U1AutoUploadsManager.m' |
188 | --- Files/U1AutoUploadsManager.m 2011-12-12 23:06:17 +0000 |
189 | +++ Files/U1AutoUploadsManager.m 2011-12-13 16:37:23 +0000 |
190 | @@ -410,9 +410,9 @@ |
191 | else |
192 | { |
193 | ALAssetRepresentation *representation = [asset defaultRepresentation]; |
194 | - NSString *mimetype = (id)UTTypeCopyPreferredTagWithClass((CFStringRef)[representation UTI], kUTTagClassMIMEType); |
195 | + NSString *mimetype = [(id)UTTypeCopyPreferredTagWithClass((CFStringRef)[representation UTI], kUTTagClassMIMEType) autorelease]; |
196 | |
197 | - U1AssetRepresenationDataProvider *provider = [[U1AssetRepresenationDataProvider alloc] init]; |
198 | + U1AssetRepresenationDataProvider *provider = [[[U1AssetRepresenationDataProvider alloc] init] autorelease]; |
199 | provider.assetURL = imageURL; |
200 | |
201 | [self.filesClient uploadContentDataProvider:provider |
202 | @@ -457,7 +457,7 @@ |
203 | } |
204 | else |
205 | { |
206 | - NSString *ext = (id)UTTypeCopyPreferredTagWithClass((CFStringRef)[representation UTI], kUTTagClassFilenameExtension); |
207 | + NSString *ext = [(id)UTTypeCopyPreferredTagWithClass((CFStringRef)[representation UTI], kUTTagClassFilenameExtension) autorelease]; |
208 | filename = [NSString stringWithFormat:@"IMG_%d.%@", [self nextPictureNumber], ext]; |
209 | } |
210 | |
211 | @@ -512,7 +512,7 @@ |
212 | |
213 | if ((![self isPending:assetToUpload.filename]) && (assetToUpload.generation == nil)) |
214 | { |
215 | - U1AssetRepresenationDataProvider *provider = [[U1AssetRepresenationDataProvider alloc] init]; |
216 | + U1AssetRepresenationDataProvider *provider = [[[U1AssetRepresenationDataProvider alloc] init] autorelease]; |
217 | provider.assetURL = [NSURL URLWithString:assetToUpload.url]; |
218 | |
219 | // Let's create an operation! |
220 | |
221 | === modified file 'Files/U1FilesClient.m' |
222 | --- Files/U1FilesClient.m 2011-12-09 19:56:28 +0000 |
223 | +++ Files/U1FilesClient.m 2011-12-13 16:37:23 +0000 |
224 | @@ -375,6 +375,8 @@ |
225 | } |
226 | |
227 | U1UploadOperation *operation = [[U1UploadOperation alloc] init]; |
228 | + __block typeof(operation) operationRef = operation; |
229 | + |
230 | operation.dataProvider = dataProvider; |
231 | operation.fileNode = node; |
232 | operation.mimetype = contentType; |
233 | @@ -384,8 +386,8 @@ |
234 | dispatch_async(dispatch_get_main_queue(), ^{ |
235 | |
236 | NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys: |
237 | - operation.fileNode, @"node", |
238 | - operation.fileInfo, @"fileInfo", |
239 | + operationRef.fileNode, @"node", |
240 | + operationRef.fileInfo, @"fileInfo", |
241 | nil]; |
242 | [[NSNotificationCenter defaultCenter] postNotificationName:U1FilesClientNodeStatusChangedNotification object:self userInfo:userInfo]; |
243 | |
244 | @@ -396,18 +398,17 @@ |
245 | progressBlock(sent, total); |
246 | } |
247 | }; |
248 | - |
249 | [operation setQueuePriority:priority]; |
250 | [operation setCompletionBlock:^{ |
251 | dispatch_async(dispatch_get_main_queue(), ^(void) { |
252 | - if (operation.error == nil) // or the error is somehow unrecoverable (e.g., over quota) |
253 | + if (operationRef.error == nil) // or the error is somehow unrecoverable (e.g., over quota) |
254 | { |
255 | [[NSNotificationCenter defaultCenter] postNotificationName:@"imageUploaded" object:nil]; |
256 | - completionBlock(operation.fileNode, nil); |
257 | + completionBlock(operationRef.fileNode, nil); |
258 | } |
259 | else |
260 | { |
261 | - NSLog(@"Error trying to upload %@: %@", resourceName, operation.error); |
262 | + NSLog(@"Error trying to upload %@: %@", resourceName, operationRef.error); |
263 | // Try it again (this is brittle if the error isn't recoverable (e.g. over quota) |
264 | [self uploadContentDataProvider:dataProvider |
265 | toFolder:folderNode |
266 | |
267 | === modified file 'Files/U1FilesService.m' |
268 | --- Files/U1FilesService.m 2011-12-09 19:56:28 +0000 |
269 | +++ Files/U1FilesService.m 2011-12-13 16:37:23 +0000 |
270 | @@ -357,11 +357,12 @@ |
271 | U1HTTPRequestOperation *httpOperation = [[U1HTTPRequestOperation alloc] initWithRequest:request dataCollector:collector]; |
272 | [request release]; |
273 | |
274 | + __block typeof(httpOperation) operationRef = httpOperation; |
275 | [httpOperation setCompletionBlock:^(void) { |
276 | |
277 | id result = nil; |
278 | - NSHTTPURLResponse *response = httpOperation.response; |
279 | - NSError *error = httpOperation.error; |
280 | + NSHTTPURLResponse *response = operationRef.response; |
281 | + NSError *error = operationRef.error; |
282 | |
283 | if ([response statusCode] == 401) |
284 | { |
285 | |
286 | === modified file 'Files/U1FolderViewController.m' |
287 | --- Files/U1FolderViewController.m 2011-12-09 20:31:25 +0000 |
288 | +++ Files/U1FolderViewController.m 2011-12-13 16:37:23 +0000 |
289 | @@ -217,7 +217,7 @@ |
290 | resultBlock:^(ALAsset *asset) { |
291 | ALAssetRepresentation *representation = [asset defaultRepresentation]; |
292 | CFStringRef uti = (CFStringRef)[representation UTI]; |
293 | - NSString *mimetype = (id)UTTypeCopyPreferredTagWithClass(uti, kUTTagClassMIMEType); |
294 | + NSString *mimetype = [(id)UTTypeCopyPreferredTagWithClass(uti, kUTTagClassMIMEType) autorelease]; |
295 | NSString *assetType = nil; |
296 | if (UTTypeConformsTo(uti, kUTTypeImage)) |
297 | { |
298 | @@ -237,7 +237,7 @@ |
299 | [dateFormatter setDateStyle:NSDateFormatterMediumStyle]; |
300 | [dateFormatter setTimeStyle:NSDateFormatterMediumStyle]; |
301 | |
302 | - NSString *ext = (id)UTTypeCopyPreferredTagWithClass(uti, kUTTagClassFilenameExtension); |
303 | + NSString *ext = [(id)UTTypeCopyPreferredTagWithClass(uti, kUTTagClassFilenameExtension) autorelease]; |
304 | NSString *filename = [NSString stringWithFormat:@"%@ %@.%@", assetType, [dateFormatter stringFromDate:assetDate], ext]; |
305 | [dateFormatter release]; |
306 | |
307 | |
308 | === modified file 'Files/U1LoginController.m' |
309 | --- Files/U1LoginController.m 2011-12-06 18:38:47 +0000 |
310 | +++ Files/U1LoginController.m 2011-12-13 16:37:23 +0000 |
311 | @@ -31,7 +31,8 @@ |
312 | |
313 | |
314 | @interface U1LoginController () |
315 | -@property (retain) UIViewController *loginViewController; |
316 | +@property (retain) IBOutlet UIViewController *loginViewController; |
317 | +@property (retain) IBOutlet UOSSOCredentialsViewController *rootController; |
318 | @property (retain) NSOperationQueue *operationQueue; |
319 | - (void)loginWithUsername:(NSString*)username password:(NSString*)password; |
320 | - (void)handleError:(NSError*)error; |
321 | @@ -40,14 +41,15 @@ |
322 | |
323 | @implementation U1LoginController |
324 | |
325 | -@synthesize delegate, loginViewController, operationQueue; |
326 | +@synthesize delegate, loginViewController, rootController, operationQueue; |
327 | |
328 | - (id)init; |
329 | { |
330 | if (!(self = [super init])) |
331 | return nil; |
332 | |
333 | - UOSSOCredentialsViewController *rootController = [[[UOSSOCredentialsViewController alloc] initWithNibName:@"UOSSOCredentialsViewController" bundle:nil] autorelease]; |
334 | +// UOSSOCredentialsViewController *rootController = [[[UOSSOCredentialsViewController alloc] initWithNibName:@"UOSSOCredentialsViewController" bundle:nil] autorelease]; |
335 | + [[UINib nibWithNibName:@"U1LoginController" bundle:nil] instantiateWithOwner:self options:nil]; |
336 | rootController.title = NSLocalizedString(@"Log In to Ubuntu One", @""); |
337 | |
338 | __block id this = self; |
339 | @@ -56,10 +58,10 @@ |
340 | [this loginWithUsername:username password:password]; |
341 | }; |
342 | |
343 | - UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:rootController]; |
344 | +// UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:rootController]; |
345 | // navController.navigationBar.barStyle = UIBarStyleBlack; |
346 | // navController.navigationBarHidden = YES; |
347 | - loginViewController = navController; |
348 | +// loginViewController = navController; |
349 | |
350 | operationQueue = [[NSOperationQueue alloc] init]; |
351 | |
352 | @@ -70,6 +72,7 @@ |
353 | { |
354 | delegate = nil; |
355 | [loginViewController release]; |
356 | + [rootController release]; |
357 | [operationQueue release]; |
358 | [super dealloc]; |
359 | } |
360 | |
361 | === added file 'Files/U1LoginController.xib' |
362 | --- Files/U1LoginController.xib 1970-01-01 00:00:00 +0000 |
363 | +++ Files/U1LoginController.xib 2011-12-13 16:37:23 +0000 |
364 | @@ -0,0 +1,245 @@ |
365 | +<?xml version="1.0" encoding="UTF-8"?> |
366 | +<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00"> |
367 | + <data> |
368 | + <int key="IBDocument.SystemTarget">1280</int> |
369 | + <string key="IBDocument.SystemVersion">10K549</string> |
370 | + <string key="IBDocument.InterfaceBuilderVersion">1938</string> |
371 | + <string key="IBDocument.AppKitVersion">1038.36</string> |
372 | + <string key="IBDocument.HIToolboxVersion">461.00</string> |
373 | + <object class="NSMutableDictionary" key="IBDocument.PluginVersions"> |
374 | + <string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> |
375 | + <string key="NS.object.0">933</string> |
376 | + </object> |
377 | + <array key="IBDocument.IntegratedClassDependencies"> |
378 | + <string>IBUINavigationItem</string> |
379 | + <string>IBUIViewController</string> |
380 | + <string>IBUINavigationBar</string> |
381 | + <string>IBUINavigationController</string> |
382 | + <string>IBProxyObject</string> |
383 | + </array> |
384 | + <array key="IBDocument.PluginDependencies"> |
385 | + <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> |
386 | + </array> |
387 | + <object class="NSMutableDictionary" key="IBDocument.Metadata"> |
388 | + <string key="NS.key.0">PluginDependencyRecalculationVersion</string> |
389 | + <integer value="1" key="NS.object.0"/> |
390 | + </object> |
391 | + <array class="NSMutableArray" key="IBDocument.RootObjects" id="1000"> |
392 | + <object class="IBProxyObject" id="841351856"> |
393 | + <string key="IBProxiedObjectIdentifier">IBFilesOwner</string> |
394 | + <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string> |
395 | + </object> |
396 | + <object class="IBProxyObject" id="371349661"> |
397 | + <string key="IBProxiedObjectIdentifier">IBFirstResponder</string> |
398 | + <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string> |
399 | + </object> |
400 | + <object class="IBUINavigationController" id="497033572"> |
401 | + <object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/> |
402 | + <object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics"> |
403 | + <int key="IBUIInterfaceOrientation">1</int> |
404 | + <int key="interfaceOrientation">1</int> |
405 | + </object> |
406 | + <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string> |
407 | + <bool key="IBUIHorizontal">NO</bool> |
408 | + <object class="IBUINavigationBar" key="IBUINavigationBar" id="18568225"> |
409 | + <nil key="NSNextResponder"/> |
410 | + <int key="NSvFlags">256</int> |
411 | + <string key="NSFrameSize">{0, 0}</string> |
412 | + <bool key="IBUIOpaque">NO</bool> |
413 | + <bool key="IBUIClipsSubviews">YES</bool> |
414 | + <bool key="IBUIMultipleTouchEnabled">YES</bool> |
415 | + <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string> |
416 | + </object> |
417 | + <array class="NSMutableArray" key="IBUIViewControllers"> |
418 | + <object class="IBUIViewController" id="357211705"> |
419 | + <object class="IBUINavigationItem" key="IBUINavigationItem" id="866999870"> |
420 | + <reference key="IBUINavigationBar"/> |
421 | + <string key="IBUITitle"/> |
422 | + <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string> |
423 | + </object> |
424 | + <reference key="IBUIParentViewController" ref="497033572"/> |
425 | + <string key="IBUINibName">UOSSOCredentialsViewController</string> |
426 | + <object class="IBUISimulatedOrientationMetrics" key="IBUISimulatedOrientationMetrics"> |
427 | + <int key="IBUIInterfaceOrientation">1</int> |
428 | + <int key="interfaceOrientation">1</int> |
429 | + </object> |
430 | + <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string> |
431 | + <bool key="IBUIHorizontal">NO</bool> |
432 | + </object> |
433 | + </array> |
434 | + </object> |
435 | + </array> |
436 | + <object class="IBObjectContainer" key="IBDocument.Objects"> |
437 | + <array class="NSMutableArray" key="connectionRecords"> |
438 | + <object class="IBConnectionRecord"> |
439 | + <object class="IBCocoaTouchOutletConnection" key="connection"> |
440 | + <string key="label">loginViewController</string> |
441 | + <reference key="source" ref="841351856"/> |
442 | + <reference key="destination" ref="497033572"/> |
443 | + </object> |
444 | + <int key="connectionID">6</int> |
445 | + </object> |
446 | + <object class="IBConnectionRecord"> |
447 | + <object class="IBCocoaTouchOutletConnection" key="connection"> |
448 | + <string key="label">rootController</string> |
449 | + <reference key="source" ref="841351856"/> |
450 | + <reference key="destination" ref="357211705"/> |
451 | + </object> |
452 | + <int key="connectionID">7</int> |
453 | + </object> |
454 | + </array> |
455 | + <object class="IBMutableOrderedSet" key="objectRecords"> |
456 | + <array key="orderedObjects"> |
457 | + <object class="IBObjectRecord"> |
458 | + <int key="objectID">0</int> |
459 | + <array key="object" id="0"/> |
460 | + <reference key="children" ref="1000"/> |
461 | + <nil key="parent"/> |
462 | + </object> |
463 | + <object class="IBObjectRecord"> |
464 | + <int key="objectID">-1</int> |
465 | + <reference key="object" ref="841351856"/> |
466 | + <reference key="parent" ref="0"/> |
467 | + <string key="objectName">File's Owner</string> |
468 | + </object> |
469 | + <object class="IBObjectRecord"> |
470 | + <int key="objectID">-2</int> |
471 | + <reference key="object" ref="371349661"/> |
472 | + <reference key="parent" ref="0"/> |
473 | + </object> |
474 | + <object class="IBObjectRecord"> |
475 | + <int key="objectID">2</int> |
476 | + <reference key="object" ref="497033572"/> |
477 | + <array class="NSMutableArray" key="children"> |
478 | + <reference ref="18568225"/> |
479 | + <reference ref="357211705"/> |
480 | + </array> |
481 | + <reference key="parent" ref="0"/> |
482 | + </object> |
483 | + <object class="IBObjectRecord"> |
484 | + <int key="objectID">3</int> |
485 | + <reference key="object" ref="18568225"/> |
486 | + <reference key="parent" ref="497033572"/> |
487 | + </object> |
488 | + <object class="IBObjectRecord"> |
489 | + <int key="objectID">4</int> |
490 | + <reference key="object" ref="357211705"/> |
491 | + <array class="NSMutableArray" key="children"> |
492 | + <reference ref="866999870"/> |
493 | + </array> |
494 | + <reference key="parent" ref="497033572"/> |
495 | + </object> |
496 | + <object class="IBObjectRecord"> |
497 | + <int key="objectID">5</int> |
498 | + <reference key="object" ref="866999870"/> |
499 | + <reference key="parent" ref="357211705"/> |
500 | + </object> |
501 | + </array> |
502 | + </object> |
503 | + <dictionary class="NSMutableDictionary" key="flattenedProperties"> |
504 | + <string key="-1.CustomClassName">U1LoginController</string> |
505 | + <string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> |
506 | + <string key="-2.CustomClassName">UIResponder</string> |
507 | + <string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> |
508 | + <string key="2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> |
509 | + <string key="3.CustomClassName">U1NavigationBar</string> |
510 | + <string key="3.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> |
511 | + <string key="4.CustomClassName">UOSSOCredentialsViewController</string> |
512 | + <string key="4.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> |
513 | + <string key="5.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string> |
514 | + </dictionary> |
515 | + <dictionary class="NSMutableDictionary" key="unlocalizedProperties"/> |
516 | + <nil key="activeLocalization"/> |
517 | + <dictionary class="NSMutableDictionary" key="localizations"/> |
518 | + <nil key="sourceID"/> |
519 | + <int key="maxID">7</int> |
520 | + </object> |
521 | + <object class="IBClassDescriber" key="IBDocument.Classes"> |
522 | + <array class="NSMutableArray" key="referencedPartialClassDescriptions"> |
523 | + <object class="IBPartialClassDescription"> |
524 | + <string key="className">U1LoginController</string> |
525 | + <string key="superclassName">NSObject</string> |
526 | + <dictionary class="NSMutableDictionary" key="outlets"> |
527 | + <string key="loginViewController">UIViewController</string> |
528 | + <string key="rootController">UOSSOCredentialsViewController</string> |
529 | + </dictionary> |
530 | + <dictionary class="NSMutableDictionary" key="toOneOutletInfosByName"> |
531 | + <object class="IBToOneOutletInfo" key="loginViewController"> |
532 | + <string key="name">loginViewController</string> |
533 | + <string key="candidateClassName">UIViewController</string> |
534 | + </object> |
535 | + <object class="IBToOneOutletInfo" key="rootController"> |
536 | + <string key="name">rootController</string> |
537 | + <string key="candidateClassName">UOSSOCredentialsViewController</string> |
538 | + </object> |
539 | + </dictionary> |
540 | + <object class="IBClassDescriptionSource" key="sourceIdentifier"> |
541 | + <string key="majorKey">IBProjectSource</string> |
542 | + <string key="minorKey">./Classes/U1LoginController.h</string> |
543 | + </object> |
544 | + </object> |
545 | + <object class="IBPartialClassDescription"> |
546 | + <string key="className">U1NavigationBar</string> |
547 | + <string key="superclassName">UINavigationBar</string> |
548 | + <object class="IBClassDescriptionSource" key="sourceIdentifier"> |
549 | + <string key="majorKey">IBProjectSource</string> |
550 | + <string key="minorKey">./Classes/U1NavigationBar.h</string> |
551 | + </object> |
552 | + </object> |
553 | + <object class="IBPartialClassDescription"> |
554 | + <string key="className">UOSSOCredentialsViewController</string> |
555 | + <string key="superclassName">UIViewController</string> |
556 | + <object class="NSMutableDictionary" key="actions"> |
557 | + <string key="NS.key.0">logIn:</string> |
558 | + <string key="NS.object.0">id</string> |
559 | + </object> |
560 | + <object class="NSMutableDictionary" key="actionInfosByName"> |
561 | + <string key="NS.key.0">logIn:</string> |
562 | + <object class="IBActionInfo" key="NS.object.0"> |
563 | + <string key="name">logIn:</string> |
564 | + <string key="candidateClassName">id</string> |
565 | + </object> |
566 | + </object> |
567 | + <dictionary class="NSMutableDictionary" key="outlets"> |
568 | + <string key="emailField">UITextField</string> |
569 | + <string key="loginButton">UIButton</string> |
570 | + <string key="passwordField">UITextField</string> |
571 | + <string key="patternView">UIView</string> |
572 | + <string key="spinner">UIActivityIndicatorView</string> |
573 | + </dictionary> |
574 | + <dictionary class="NSMutableDictionary" key="toOneOutletInfosByName"> |
575 | + <object class="IBToOneOutletInfo" key="emailField"> |
576 | + <string key="name">emailField</string> |
577 | + <string key="candidateClassName">UITextField</string> |
578 | + </object> |
579 | + <object class="IBToOneOutletInfo" key="loginButton"> |
580 | + <string key="name">loginButton</string> |
581 | + <string key="candidateClassName">UIButton</string> |
582 | + </object> |
583 | + <object class="IBToOneOutletInfo" key="passwordField"> |
584 | + <string key="name">passwordField</string> |
585 | + <string key="candidateClassName">UITextField</string> |
586 | + </object> |
587 | + <object class="IBToOneOutletInfo" key="patternView"> |
588 | + <string key="name">patternView</string> |
589 | + <string key="candidateClassName">UIView</string> |
590 | + </object> |
591 | + <object class="IBToOneOutletInfo" key="spinner"> |
592 | + <string key="name">spinner</string> |
593 | + <string key="candidateClassName">UIActivityIndicatorView</string> |
594 | + </object> |
595 | + </dictionary> |
596 | + <object class="IBClassDescriptionSource" key="sourceIdentifier"> |
597 | + <string key="majorKey">IBProjectSource</string> |
598 | + <string key="minorKey">./Classes/UOSSOCredentialsViewController.h</string> |
599 | + </object> |
600 | + </object> |
601 | + </array> |
602 | + </object> |
603 | + <int key="IBDocument.localizationMode">0</int> |
604 | + <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string> |
605 | + <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool> |
606 | + <int key="IBDocument.defaultPropertyAccessControl">3</int> |
607 | + <string key="IBCocoaTouchPluginVersion">933</string> |
608 | + </data> |
609 | +</archive> |
610 | |
611 | === modified file 'Files/U1SettingsViewController.m' |
612 | --- Files/U1SettingsViewController.m 2011-12-09 20:31:25 +0000 |
613 | +++ Files/U1SettingsViewController.m 2011-12-13 16:37:23 +0000 |
614 | @@ -219,6 +219,7 @@ |
615 | NSString *usedString = [byteSizeTransformer transformedValue:[self.accountInfo objectForKey:@"used_bytes"]]; |
616 | NSString *totalString = [byteSizeTransformer transformedValue:[self.accountInfo objectForKey:@"max_bytes"]]; |
617 | [cell.detailTextLabel setText:[NSString stringWithFormat:storageFormat, usedString, totalString]]; |
618 | + [byteSizeTransformer release]; |
619 | break; |
620 | } |
621 | } |
622 | |
623 | === modified file 'Files/U1VolumesViewController.m' |
624 | --- Files/U1VolumesViewController.m 2011-12-09 20:31:25 +0000 |
625 | +++ Files/U1VolumesViewController.m 2011-12-13 16:37:23 +0000 |
626 | @@ -106,9 +106,13 @@ |
627 | cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"U1FolderCell"] autorelease]; |
628 | [cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator]; |
629 | [cell setSelectionStyle:UITableViewCellSelectionStyleGray]; |
630 | - [cell.imageView setImage:[UIImage imageNamed:@"ic_folder"]]; |
631 | } |
632 | U1Volume *volume = [self.cloudFoldersFetchController objectAtIndexPath:indexPath]; |
633 | + [cell.imageView setImage:[UIImage imageNamed:@"ic_folder"]]; |
634 | + if ([volume.kind isEqualToString:@"root"]) |
635 | + { |
636 | + [cell.imageView setImage:[UIImage imageNamed:@"u1_folder"]]; |
637 | + } |
638 | NSString *volumePath = volume.path; |
639 | if ([@"~/.ubuntuone/Purchased from Ubuntu One" isEqualToString:volumePath]) |
640 | volumePath = @"Purchased Music"; |
I like it, once the conflict gets resolved. Replace 206-215 with:
NSString *ext = [(id)UTTypeCopy PreferredTagWit hClass( (CFStringRef) [representation UTI], kUTTagClassFile nameExtension) autorelease]; t:@"IMG_ %d.%@", [self nextPictureNumber], ext];
filename = [NSString stringWithForma