From: David A. Velasco Date: Tue, 7 Oct 2014 10:54:31 +0000 (+0200) Subject: On refersh of a folder, remove from the local file system the child folders that... X-Git-Tag: oc-android-1.7.0_signed~15^2~27 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/363cad2addd1d00c55baaad021356481ace68058?hp=--cc On refersh of a folder, remove from the local file system the child folders that were deleted in the server --- 363cad2addd1d00c55baaad021356481ace68058 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 } } }