Summary: | moveFile should overwrite existing files | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Alex Christensen <achristensen> | ||||||
Component: | WebCore Misc. | Assignee: | Alex Christensen <achristensen> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | andersca, beidson | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Description
Alex Christensen
2015-04-20 15:12:16 PDT
Created attachment 251193 [details]
Patch
Comment on attachment 251193 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=251193&action=review > Source/WebCore/platform/mac/FileSystemMac.mm:44 > +@implementation WebFileManagerDelegate > +- (BOOL)fileManager:(NSFileManager *)fileManager shouldProceedAfterError:(NSError *)error movingItemAtURL:(NSURL *)srcURL toURL:(NSURL *)dstURL Add an empty line here please. Comment on attachment 251193 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=251193&action=review > Source/WebCore/platform/mac/FileSystemMac.mm:90 > + RetainPtr<WebFileManagerDelegate> delegate = adoptNS([[WebFileManagerDelegate alloc] init]); > + [[NSFileManager defaultManager] setDelegate:delegate.get()]; Don't set a custom delegate on the default manager, just create a new manager instead. Created attachment 251201 [details]
Patch
Comment on attachment 251201 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=251201&action=review > Source/WebCore/platform/mac/FileSystemMac.mm:50 > + return [error code] == NSFileWriteFileExistsError; Dot syntax. > Source/WebCore/platform/mac/FileSystemMac.mm:91 > + RetainPtr<NSFileManager> manager = adoptNS([[NSFileManager alloc] init]); > + RetainPtr<WebFileManagerDelegate> delegate = adoptNS([[WebFileManagerDelegate alloc] init]); Just use auto here. > Source/WebCore/platform/mac/FileSystemMac.mm:92 > + [manager.get() setDelegate:delegate.get()]; No need for .get() in manager.get(). > Source/WebCore/platform/mac/FileSystemMac.mm:94 > + return [manager.get() moveItemAtURL:[NSURL fileURLWithPath:oldPath] toURL:[NSURL fileURLWithPath:newPath] error:nil]; Same thing here. |