shell: fix regression for moveItemToTrash on mac

This commit is contained in:
deepak1556 2015-04-08 19:31:46 +05:30
parent fb00c28026
commit 175f397173

View file

@ -131,7 +131,7 @@ bool MoveItemToTrash(const base::FilePath& full_path) {
NSString* path_string = base::SysUTF8ToNSString(full_path.value()); NSString* path_string = base::SysUTF8ToNSString(full_path.value());
NSArray* file_array = NSArray* file_array =
[NSArray arrayWithObject:[path_string lastPathComponent]]; [NSArray arrayWithObject:[path_string lastPathComponent]];
int status = [[NSWorkspace sharedWorkspace] BOOL status = [[NSWorkspace sharedWorkspace]
performFileOperation:NSWorkspaceRecycleOperation performFileOperation:NSWorkspaceRecycleOperation
source:[path_string stringByDeletingLastPathComponent] source:[path_string stringByDeletingLastPathComponent]
destination:@"" destination:@""
@ -140,7 +140,7 @@ bool MoveItemToTrash(const base::FilePath& full_path) {
if (!path_string || !file_array || !status) if (!path_string || !file_array || !status)
LOG(WARNING) << "NSWorkspace failed to move file " << full_path.value() LOG(WARNING) << "NSWorkspace failed to move file " << full_path.value()
<< " to trash"; << " to trash";
return (status == 0); return status;
} }
void Beep() { void Beep() {