X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/dc06df15c8c9b54b845f06cb4253a1b8af7d8f75..d38a69abc1ba78df70fee65fc2434fc80b6be93b:/src/com/owncloud/android/operations/SynchronizeFolderOperation.java diff --git a/src/com/owncloud/android/operations/SynchronizeFolderOperation.java b/src/com/owncloud/android/operations/SynchronizeFolderOperation.java index 2fc9d28b..e93736c4 100644 --- a/src/com/owncloud/android/operations/SynchronizeFolderOperation.java +++ b/src/com/owncloud/android/operations/SynchronizeFolderOperation.java @@ -249,9 +249,7 @@ public class SynchronizeFolderOperation extends RemoteOperation { Log_OC.d(TAG, "Synchronizing " + mAccount.name + remotePath); if (result.isSuccess()) { - RemoteFile folder = result.getFile(); - ArrayList files = result.getData(); - synchronizeData(folder, files, client); + synchronizeData(result.getData(), client); if (mConflictsFound > 0 || mFailsInFavouritesFound > 0) { result = new RemoteOperationResult(ResultCode.SYNC_CONFLICT); // should be different result, but will do the job } @@ -278,26 +276,24 @@ public class SynchronizeFolderOperation extends RemoteOperation { * * Grants that mChildren is updated with fresh data after execution. * - * @param folder Remote Folder to synchronize - * - * @param files Remote Files in Folder + * @param folderAndFiles Remote folder and children files in Folder * * @param client Client instance to the remote server where the data were * retrieved. * @return 'True' when any change was made in the local data, 'false' otherwise. */ - private void synchronizeData(RemoteFile folder, ArrayList files, WebdavClient client) { + private void synchronizeData(ArrayList folderAndFiles, WebdavClient client) { // get 'fresh data' from the database mLocalFolder = mStorageManager.getFileByPath(mLocalFolder.getRemotePath()); // parse data from remote folder - OCFile remoteFolder = fillOCFile(folder); + OCFile remoteFolder = fillOCFile(folderAndFiles.get(0)); remoteFolder.setParentId(mLocalFolder.getParentId()); remoteFolder.setFileId(mLocalFolder.getFileId()); Log_OC.d(TAG, "Remote folder " + mLocalFolder.getRemotePath() + " changed - starting update of local data "); - List updatedFiles = new Vector(files.size()); + List updatedFiles = new Vector(folderAndFiles.size() - 1); List filesToSyncContents = new Vector(); // get current data about local contents of the folder to synchronize @@ -309,9 +305,9 @@ public class SynchronizeFolderOperation extends RemoteOperation { // loop to update every child OCFile remoteFile = null, localFile = null; - for (RemoteFile file: files) { + for (int i=1; i