瀏覽代碼

Rename remote path upon renaming

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
tobiasKaminsky 3 年之前
父節點
當前提交
ef25d41342
共有 1 個文件被更改,包括 6 次插入2 次删除
  1. 6 2
      src/main/java/com/owncloud/android/operations/RenameFileOperation.java

+ 6 - 2
src/main/java/com/owncloud/android/operations/RenameFileOperation.java

@@ -103,7 +103,7 @@ public class RenameFileOperation extends SyncOperation {
                     //saveLocalDirectory();
 
                 } else {
-                    saveLocalFile();
+                    saveLocalFile(newRemotePath);
                 }
             }
 
@@ -116,9 +116,13 @@ public class RenameFileOperation extends SyncOperation {
         return result;
     }
 
-    private void saveLocalFile() {
+    private void saveLocalFile(String newRemotePath) {
         file.setFileName(newName);
 
+        if (!file.isEncrypted()) {
+            file.setDecryptedRemotePath(newRemotePath);
+        }
+
         // try to rename the local copy of the file
         if (file.isDown()) {
             String oldPath = file.getStoragePath();