X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/a9981ac0b4faf980a21e8f856067b62780feed80..cea1a76f48ceb400136e64b4fb921a3f92aee6e4:/src/com/owncloud/android/operations/GetSharesOperation.java diff --git a/src/com/owncloud/android/operations/GetSharesOperation.java b/src/com/owncloud/android/operations/GetSharesOperation.java index 64942c09..4cbee02a 100644 --- a/src/com/owncloud/android/operations/GetSharesOperation.java +++ b/src/com/owncloud/android/operations/GetSharesOperation.java @@ -62,34 +62,29 @@ public class GetSharesOperation extends SyncOperation { } private void saveSharesDB(ArrayList shares) { - - if (shares.size() > 0) { - // Save share file - getStorageManager().saveShares(shares); - - ArrayList sharedFiles = new ArrayList(); - - for (OCShare share : shares) { - // Get the path - String path = share.getPath(); - if (share.isDirectory()) { - path = path + FileUtils.PATH_SEPARATOR; - } - - // Update OCFile with data from share: ShareByLink ¿and publicLink? - OCFile file = getStorageManager().getFileByPath(path); - if (file != null) { - if (share.getShareType().equals(ShareType.PUBLIC_LINK)) { - file.setShareByLink(true); - sharedFiles.add(file); - } - } - } - - if (sharedFiles.size() > 0) { - getStorageManager().updateSharedFiles(sharedFiles); - } + // Save share file + getStorageManager().saveShares(shares); + + ArrayList sharedFiles = new ArrayList(); + + for (OCShare share : shares) { + // Get the path + String path = share.getPath(); + if (share.isDirectory()) { + path = path + FileUtils.PATH_SEPARATOR; + } + + // Update OCFile with data from share: ShareByLink ¿and publicLink? + OCFile file = getStorageManager().getFileByPath(path); + if (file != null) { + if (share.getShareType().equals(ShareType.PUBLIC_LINK)) { + file.setShareByLink(true); + sharedFiles.add(file); + } + } } + + getStorageManager().updateSharedFiles(sharedFiles); } }