X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/5f41bb14d370e0c9c0a8003e4ed122f466b0ce71..1e59a632bcedc56845e6494f244e79d76a1f8b8a:/src/com/owncloud/android/files/services/FileUploader.java diff --git a/src/com/owncloud/android/files/services/FileUploader.java b/src/com/owncloud/android/files/services/FileUploader.java index 2695b773..14909344 100644 --- a/src/com/owncloud/android/files/services/FileUploader.java +++ b/src/com/owncloud/android/files/services/FileUploader.java @@ -590,8 +590,18 @@ public class FileUploader extends Service } finally { Log_OC.v("NOW " + TAG + ", thread " + Thread.currentThread().getName(), "Removing payload " + mCurrentUpload.getRemotePath()); - Pair removeResult = - mPendingUploads.removePayload(mCurrentAccount, mCurrentUpload.getRemotePath()); + Pair removeResult; + if (mCurrentUpload.wasRenamed()) { + removeResult = mPendingUploads.removePayload( + mCurrentAccount, + mCurrentUpload.getOldFile().getRemotePath() + ); + } else { + removeResult = mPendingUploads.removePayload( + mCurrentAccount, + mCurrentUpload.getRemotePath() + ); + } /// notify result notifyUploadResult(mCurrentUpload, uploadResult); @@ -670,7 +680,7 @@ public class FileUploader extends Service * synchronized with the server, specially the modification time and Etag * (where available) * - * TODO refactor this ugly thing + * TODO move into UploadFileOperation */ private void saveUploadedFile() { OCFile file = mCurrentUpload.getFile(); @@ -699,6 +709,7 @@ public class FileUploader extends Service if (oldFile.fileExists()) { oldFile.setStoragePath(null); mStorageManager.saveFile(oldFile); + mStorageManager.saveConflict(oldFile, false); } // else: it was just an automatic renaming due to a name // coincidence; nothing else is needed, the storagePath is right @@ -706,6 +717,7 @@ public class FileUploader extends Service } file.setNeedsUpdateThumbnail(true); mStorageManager.saveFile(file); + mStorageManager.saveConflict(file, false); } private void updateOCFile(OCFile file, RemoteFile remoteFile) {