Index: chrome/browser/resources/file_manager/js/file_copy_manager.js |
diff --git a/chrome/browser/resources/file_manager/js/file_copy_manager.js b/chrome/browser/resources/file_manager/js/file_copy_manager.js |
index 9ca7903d538980646e6250b0e0dbe9c3ca035e31..8ba24876ab695623696089c5f600ed092b2644e6 100644 |
--- a/chrome/browser/resources/file_manager/js/file_copy_manager.js |
+++ b/chrome/browser/resources/file_manager/js/file_copy_manager.js |
@@ -491,6 +491,23 @@ FileCopyManager.prototype.serviceNextTaskEntry_ = function( |
var targetDirEntry = task.targetDirEntry; |
var originalPath = sourceEntry.fullPath.substr(sourcePath.length + 1); |
+ |
+ // If the source entry is GData search result, we should not use the file name |
+ // we get from file entry (this will be in format |
+ // resource_id.original_file_name). Instead, we should use original_file_name. |
+ // Note that if the entry is GData search result, it can only be imediate |
dgozman
2012/05/03 11:21:47
typo: imediate
tbarzic
2012/05/03 19:16:02
Done.
|
+ // child of |task.sourceDirEntry|, so originalPath should be equal to |
+ // gdataSearchResult.fileName. |
+ var gdataSearchResult = |
+ util.getFileAndDisplayNameForGDataSearchResult(sourceEntry.fullPath); |
+ if (gdataSearchResult && originalPath == gdataSearchResult.fileName) { |
+ if (sourceEntry.isDirectory) { |
+ task.registerRename(gdataSearchResult.fileName, |
dgozman
2012/05/03 11:21:47
I think, you have to register full paths here inst
tbarzic
2012/05/03 19:16:02
Don't we register paths relative to sourceDir. Sin
|
+ gdataSearchResult.displayName); |
+ } |
+ originalPath = gdataSearchResult.displayName; |
dgozman
2012/05/03 11:21:47
For directory, you do:
1. register rename
2. chang
tbarzic
2012/05/03 19:16:02
registered rename paths are automatically appended
|
+ } |
+ |
originalPath = task.applyRenames(originalPath); |
var targetRelativePrefix = originalPath; |