X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/ee6f2e7217a201c1c683b4662038a8bdc44adb35..639d12272170721020b345abbcfd8bfa0b4416d7:/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 cdf12823..ff30bd0a 100644 --- a/src/com/owncloud/android/operations/SynchronizeFolderOperation.java +++ b/src/com/owncloud/android/operations/SynchronizeFolderOperation.java @@ -33,6 +33,7 @@ import org.apache.http.HttpStatus; import android.accounts.Account; import android.content.Context; import android.content.Intent; +import android.util.Log; //import android.support.v4.content.LocalBroadcastManager; import com.owncloud.android.datamodel.FileDataStorageManager; @@ -323,9 +324,11 @@ public class SynchronizeFolderOperation extends RemoteOperation { * @return 'True' when any change was made in the local data, 'false' otherwise */ private void synchronizeData(ArrayList folderAndFiles, OwnCloudClient client) { + Vector mImageFiles = mStorageManager.getFolderImages(mLocalFolder); + // get 'fresh data' from the database mLocalFolder = mStorageManager.getFileByPath(mLocalFolder.getRemotePath()); - + // parse data from remote folder OCFile remoteFolder = fillOCFile((RemoteFile)folderAndFiles.get(0)); remoteFolder.setParentId(mLocalFolder.getParentId()); @@ -372,6 +375,15 @@ public class SynchronizeFolderOperation extends RemoteOperation { if (remoteFile.isFolder()) { remoteFile.setFileLength(localFile.getFileLength()); // TODO move operations about size of folders to FileContentProvider + } else if (mRemoteFolderChanged && remoteFile.isImage()) { + // If image has been updated on the server, set for updating the thumbnail + for (OCFile fileImage: mImageFiles) { + if (remoteFile.getRemoteId().equals(fileImage.getRemoteId()) && + remoteFile.getModificationTimestamp() > fileImage.getModificationTimestamp()) { + remoteFile.setNeedsUpdateThumbnail(true); + Log.d(TAG, "Image " + remoteFile.getFileName() + " updated on the server"); + } + } } remoteFile.setPublicLink(localFile.getPublicLink()); remoteFile.setShareByLink(localFile.isShareByLink());