From 363cad2addd1d00c55baaad021356481ace68058 Mon Sep 17 00:00:00 2001 From: "David A. Velasco" Date: Tue, 7 Oct 2014 12:54:31 +0200 Subject: [PATCH] On refersh of a folder, remove from the local file system the child folders that were deleted in the server --- src/com/owncloud/android/datamodel/FileDataStorageManager.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/com/owncloud/android/datamodel/FileDataStorageManager.java b/src/com/owncloud/android/datamodel/FileDataStorageManager.java index 795004a1..77d363ce 100644 --- a/src/com/owncloud/android/datamodel/FileDataStorageManager.java +++ b/src/com/owncloud/android/datamodel/FileDataStorageManager.java @@ -317,14 +317,17 @@ public class FileDataStorageManager { 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(); - // TODO move the deletion of local contents after success of deletions } } } -- 2.11.0