Removed conflict badge when conflict is solved

This commit is contained in:
David A. Velasco 2015-08-21 11:35:04 +02:00
parent a2aa0479fc
commit 7399508e05
3 changed files with 10 additions and 1 deletions

View file

@ -509,6 +509,7 @@ public class FileDataStorageManager {
// maybe unnecessary, but should be checked TODO remove if unnecessary
file.setStoragePath(null);
saveFile(file);
saveConflict(file, false);
}
}
}
@ -1589,6 +1590,9 @@ public class FileDataStorageManager {
}
public void saveConflict(OCFile file, boolean inConflict) {
if (!file.isDown()) {
inConflict = false;
}
ContentValues cv = new ContentValues();
cv.put(ProviderTableMeta.FILE_IN_CONFLICT, inConflict);
int updated = 0;

View file

@ -466,6 +466,8 @@ public class FileDownloader extends Service
/**
* Updates the OC File after a successful download.
*
* TODO move to DownloadFileOperation
*/
private void saveDownloadedFile() {
OCFile file = mStorageManager.getFileById(mCurrentDownload.getFile().getFileId());
@ -482,6 +484,7 @@ public class FileDownloader extends Service
file.setRemoteId(mCurrentDownload.getFile().getRemoteId());
mStorageManager.saveFile(file);
mStorageManager.triggerMediaScan(file.getStoragePath());
mStorageManager.saveConflict(file, false);
}
/**

View file

@ -670,7 +670,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 +699,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 +707,7 @@ public class FileUploader extends Service
}
file.setNeedsUpdateThumbnail(true);
mStorageManager.saveFile(file);
mStorageManager.saveConflict(file, false);
}
private void updateOCFile(OCFile file, RemoteFile remoteFile) {