On refersh of a folder, remove from the local file system the child folders that...
authorDavid A. Velasco <dvelasco@solidgear.es>
Tue, 7 Oct 2014 10:54:31 +0000 (12:54 +0200)
committerDavid A. Velasco <dvelasco@solidgear.es>
Tue, 7 Oct 2014 10:54:31 +0000 (12:54 +0200)
src/com/owncloud/android/datamodel/FileDataStorageManager.java

index 795004a..77d363c 100644 (file)
@@ -317,14 +317,17 @@ public class FileDataStorageManager {
                     operations.add(ContentProviderOperation
                                     .newDelete(ContentUris.withAppendedId(ProviderTableMeta.CONTENT_URI_DIR, file.getFileId())).withSelection(where, whereArgs)
                                         .build());
                     operations.add(ContentProviderOperation
                                     .newDelete(ContentUris.withAppendedId(ProviderTableMeta.CONTENT_URI_DIR, file.getFileId())).withSelection(where, whereArgs)
                                         .build());
-                    // TODO remove local folder
+                    File localFolder = 
+                            new File(FileStorageUtils.getDefaultSavePathFor(mAccount.name, file));
+                    if (localFolder.exists()) {
+                        removeLocalFolder(localFolder);
+                    }
                 } else {
                     operations.add(ContentProviderOperation
                                     .newDelete(ContentUris.withAppendedId(ProviderTableMeta.CONTENT_URI_FILE, file.getFileId())).withSelection(where, whereArgs)
                                         .build());
                     if (file.isDown()) {
                         new File(file.getStoragePath()).delete();
                 } else {
                     operations.add(ContentProviderOperation
                                     .newDelete(ContentUris.withAppendedId(ProviderTableMeta.CONTENT_URI_FILE, file.getFileId())).withSelection(where, whereArgs)
                                         .build());
                     if (file.isDown()) {
                         new File(file.getStoragePath()).delete();
-                        // TODO move the deletion of local contents after success of deletions
                     }
                 }
             }
                     }
                 }
             }