Sfoglia il codice sorgente

Merge pull request #206 from nextcloud/descendIntoFolder

descend into folder after creating it in uploader
Tobias Kaminsky 8 anni fa
parent
commit
166b8262d3

+ 4 - 0
src/com/owncloud/android/operations/CreateFolderOperation.java

@@ -121,4 +121,8 @@ public class CreateFolderOperation extends SyncOperation implements OnRemoteOper
             Log_OC.d(TAG, "Create directory " + mRemotePath + " in Database");
         }
     }
+
+    public String getRemotePath() {
+        return mRemotePath;
+    }
 }

+ 3 - 0
src/com/owncloud/android/ui/activity/ReceiveExternalFilesActivity.java

@@ -611,6 +611,9 @@ public class ReceiveExternalFilesActivity extends FileActivity
     private void onCreateFolderOperationFinish(CreateFolderOperation operation,
                                                RemoteOperationResult result) {
         if (result.isSuccess()) {
+            String remotePath = operation.getRemotePath().substring(0, operation.getRemotePath().length() - 1);
+            String newFolder = remotePath.substring(remotePath.lastIndexOf("/") + 1);
+            mParents.push(newFolder);
             populateDirectoryList();
         } else {
             try {