projects
/
pub
/
Android
/
ownCloud.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a2aa047
)
Removed conflict badge when conflict is solved
author
David A. Velasco
<dvelasco@solidgear.es>
Fri, 21 Aug 2015 09:35:04 +0000
(11:35 +0200)
committer
David A. Velasco
<dvelasco@solidgear.es>
Fri, 25 Sep 2015 13:13:49 +0000
(15:13 +0200)
src/com/owncloud/android/datamodel/FileDataStorageManager.java
patch
|
blob
|
blame
|
history
src/com/owncloud/android/files/services/FileDownloader.java
patch
|
blob
|
blame
|
history
src/com/owncloud/android/files/services/FileUploader.java
patch
|
blob
|
blame
|
history
diff --git
a/src/com/owncloud/android/datamodel/FileDataStorageManager.java
b/src/com/owncloud/android/datamodel/FileDataStorageManager.java
index
2c513c4
..
e6c35f7
100644
(file)
--- a/
src/com/owncloud/android/datamodel/FileDataStorageManager.java
+++ b/
src/com/owncloud/android/datamodel/FileDataStorageManager.java
@@
-509,6
+509,7
@@
public class FileDataStorageManager {
// maybe unnecessary, but should be checked TODO remove if unnecessary
file.setStoragePath(null);
saveFile(file);
// 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) {
}
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;
ContentValues cv = new ContentValues();
cv.put(ProviderTableMeta.FILE_IN_CONFLICT, inConflict);
int updated = 0;
diff --git
a/src/com/owncloud/android/files/services/FileDownloader.java
b/src/com/owncloud/android/files/services/FileDownloader.java
index
797053d
..
3057e5a
100644
(file)
--- a/
src/com/owncloud/android/files/services/FileDownloader.java
+++ b/
src/com/owncloud/android/files/services/FileDownloader.java
@@
-466,6
+466,8
@@
public class FileDownloader extends Service
/**
* Updates the OC File after a successful download.
/**
* Updates the OC File after a successful download.
+ *
+ * TODO move to DownloadFileOperation
*/
private void saveDownloadedFile() {
OCFile file = mStorageManager.getFileById(mCurrentDownload.getFile().getFileId());
*/
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());
file.setRemoteId(mCurrentDownload.getFile().getRemoteId());
mStorageManager.saveFile(file);
mStorageManager.triggerMediaScan(file.getStoragePath());
+ mStorageManager.saveConflict(file, false);
}
/**
}
/**
diff --git
a/src/com/owncloud/android/files/services/FileUploader.java
b/src/com/owncloud/android/files/services/FileUploader.java
index
2695b77
..
7c36996
100644
(file)
--- a/
src/com/owncloud/android/files/services/FileUploader.java
+++ b/
src/com/owncloud/android/files/services/FileUploader.java
@@
-670,7
+670,7
@@
public class FileUploader extends Service
* synchronized with the server, specially the modification time and Etag
* (where available)
*
* 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();
*/
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);
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
} // 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);
}
file.setNeedsUpdateThumbnail(true);
mStorageManager.saveFile(file);
+ mStorageManager.saveConflict(file, false);
}
private void updateOCFile(OCFile file, RemoteFile remoteFile) {
}
private void updateOCFile(OCFile file, RemoteFile remoteFile) {