X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/8981be0c716430d58ac00955c6b1db367e60efcd..ac685690a2bf019d2978082debe62ec6aea0a69f:/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 6bf1ef82..75e193af 100644 --- a/src/com/owncloud/android/operations/SynchronizeFolderOperation.java +++ b/src/com/owncloud/android/operations/SynchronizeFolderOperation.java @@ -99,7 +99,7 @@ public class SynchronizeFolderOperation extends SyncOperation { private List mFilesToSyncContentsWithoutUpload; // this will go out when 'folder synchronization' replaces 'folder download'; step by step - private List mFavouriteFilesToSyncContents; + private List mFilesToSyncContents; // this will be used for every file when 'folder synchronization' replaces 'folder download' private final AtomicBoolean mCancellationRequested; @@ -121,7 +121,7 @@ public class SynchronizeFolderOperation extends SyncOperation { mRemoteFolderChanged = false; mFilesForDirectDownload = new Vector(); mFilesToSyncContentsWithoutUpload = new Vector(); - mFavouriteFilesToSyncContents = new Vector(); + mFilesToSyncContents = new Vector(); mCancellationRequested = new AtomicBoolean(false); } @@ -291,7 +291,7 @@ public class SynchronizeFolderOperation extends SyncOperation { List updatedFiles = new Vector(folderAndFiles.size() - 1); mFilesForDirectDownload.clear(); mFilesToSyncContentsWithoutUpload.clear(); - mFavouriteFilesToSyncContents.clear(); + mFilesToSyncContents.clear(); if (mCancellationRequested.get()) { throw new OperationCancelledException(); @@ -321,7 +321,7 @@ public class SynchronizeFolderOperation extends SyncOperation { if (localFile != null) { // some properties of local state are kept unmodified remoteFile.setFileId(localFile.getFileId()); - remoteFile.setKeepInSync(localFile.keepInSync()); + remoteFile.setFavorite(localFile.isFavorite()); remoteFile.setLastSyncDateForData(localFile.getLastSyncDateForData()); remoteFile.setModificationTimestampAtLastSyncForData( localFile.getModificationTimestampAtLastSyncForData() @@ -353,14 +353,15 @@ public class SynchronizeFolderOperation extends SyncOperation { /// classify file to sync/download contents later if (remoteFile.isFolder()) { /// to download children files recursively - synchronized(mCancellationRequested) { + synchronized (mCancellationRequested) { if (mCancellationRequested.get()) { throw new OperationCancelledException(); } startSyncFolderOperation(remoteFile.getRemotePath()); } - } else if (remoteFile.keepInSync()) { + //} else if (remoteFile.isFavorite()) { + } else { /// prepare content synchronization for kept-in-sync files SynchronizeFileOperation operation = new SynchronizeFileOperation( localFile, @@ -369,9 +370,9 @@ public class SynchronizeFolderOperation extends SyncOperation { true, mContext ); - mFavouriteFilesToSyncContents.add(operation); + mFilesToSyncContents.add(operation); - } else { + /*} else { /// prepare limited synchronization for regular files SynchronizeFileOperation operation = new SynchronizeFileOperation( localFile, @@ -381,7 +382,7 @@ public class SynchronizeFolderOperation extends SyncOperation { false, mContext ); - mFilesToSyncContentsWithoutUpload.add(operation); + mFilesToSyncContentsWithoutUpload.add(operation);*/ } updatedFiles.add(remoteFile); @@ -411,7 +412,20 @@ public class SynchronizeFolderOperation extends SyncOperation { /// prepare limited synchronization for regular files if (!child.isDown()) { mFilesForDirectDownload.add(child); + + } else { + /// this should result in direct upload of files that were locally modified + SynchronizeFileOperation operation = new SynchronizeFileOperation( + child, + child, // cheating with the remote file to get an upadte to server; to refactor + mAccount, + true, + mContext + ); + mFilesToSyncContents.add(operation); + } + } } } @@ -420,7 +434,7 @@ public class SynchronizeFolderOperation extends SyncOperation { private void syncContents(OwnCloudClient client) throws OperationCancelledException { startDirectDownloads(); startContentSynchronizations(mFilesToSyncContentsWithoutUpload, client); - startContentSynchronizations(mFavouriteFilesToSyncContents, client); + startContentSynchronizations(mFilesToSyncContents, client); }