projects
/
pub
/
Android
/
ownCloud.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #324 from owncloud/last_minute_release-1.5.2
[pub/Android/ownCloud.git]
/
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
2fc9d28
..
e93736c
100644
(file)
--- 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()) {
Log_OC.d(TAG, "Synchronizing " + mAccount.name + remotePath);
if (result.isSuccess()) {
- RemoteFile folder = result.getFile();
- ArrayList<RemoteFile> 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
}
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.
*
*
* 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.
*/
*
* @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<RemoteFile> f
iles, WebdavClient client) {
+ private void synchronizeData(
ArrayList<RemoteFile> folderAndF
iles, WebdavClient client) {
// get 'fresh data' from the database
mLocalFolder = mStorageManager.getFileByPath(mLocalFolder.getRemotePath());
// parse data from remote folder
// get 'fresh data' from the database
mLocalFolder = mStorageManager.getFileByPath(mLocalFolder.getRemotePath());
// parse data from remote folder
- OCFile remoteFolder = fillOCFile(folder);
+ OCFile remoteFolder = fillOCFile(folder
AndFiles.get(0)
);
remoteFolder.setParentId(mLocalFolder.getParentId());
remoteFolder.setFileId(mLocalFolder.getFileId());
Log_OC.d(TAG, "Remote folder " + mLocalFolder.getRemotePath() + " changed - starting update of local data ");
remoteFolder.setParentId(mLocalFolder.getParentId());
remoteFolder.setFileId(mLocalFolder.getFileId());
Log_OC.d(TAG, "Remote folder " + mLocalFolder.getRemotePath() + " changed - starting update of local data ");
- List<OCFile> updatedFiles = new Vector<OCFile>(f
iles.size()
);
+ List<OCFile> updatedFiles = new Vector<OCFile>(f
olderAndFiles.size() - 1
);
List<SynchronizeFileOperation> filesToSyncContents = new Vector<SynchronizeFileOperation>();
// get current data about local contents of the folder to synchronize
List<SynchronizeFileOperation> filesToSyncContents = new Vector<SynchronizeFileOperation>();
// 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;
// loop to update every child
OCFile remoteFile = null, localFile = null;
- for (
RemoteFile file: files) {
+ for (
int i=1; i<folderAndFiles.size(); i++) {
/// new OCFile instance with the data from the server
/// new OCFile instance with the data from the server
- remoteFile = fillOCFile(f
ile
);
+ remoteFile = fillOCFile(f
olderAndFiles.get(i)
);
remoteFile.setParentId(mLocalFolder.getFileId());
/// retrieve local data for the read file
remoteFile.setParentId(mLocalFolder.getFileId());
/// retrieve local data for the read file