mirror of
https://github.com/nextcloud/android.git
synced 2024-11-23 21:55:48 +03:00
Fixed bug: renaming a folder could miss-update the storage path of children not-down files if a download file is in the folder
This commit is contained in:
parent
70c663008b
commit
ccb796173b
1 changed files with 1 additions and 1 deletions
|
@ -533,12 +533,12 @@ public class FileDataStorageManager implements DataStorageManager {
|
||||||
|
|
||||||
/// 2. prepare a batch of update operations to change all the descendants
|
/// 2. prepare a batch of update operations to change all the descendants
|
||||||
ArrayList<ContentProviderOperation> operations = new ArrayList<ContentProviderOperation>(c.getCount());
|
ArrayList<ContentProviderOperation> operations = new ArrayList<ContentProviderOperation>(c.getCount());
|
||||||
ContentValues cv = new ContentValues();
|
|
||||||
int lengthOfOldPath = dir.getRemotePath().length();
|
int lengthOfOldPath = dir.getRemotePath().length();
|
||||||
String defaultSavePath = FileDownloader.getSavePath(mAccount.name);
|
String defaultSavePath = FileDownloader.getSavePath(mAccount.name);
|
||||||
int lengthOfOldStoragePath = defaultSavePath.length() + lengthOfOldPath;
|
int lengthOfOldStoragePath = defaultSavePath.length() + lengthOfOldPath;
|
||||||
if (c.moveToFirst()) {
|
if (c.moveToFirst()) {
|
||||||
do {
|
do {
|
||||||
|
ContentValues cv = new ContentValues(); // don't take the constructor out of the loop and clear the object
|
||||||
OCFile child = createFileInstance(c);
|
OCFile child = createFileInstance(c);
|
||||||
cv.put(ProviderTableMeta.FILE_PATH, newPath + child.getRemotePath().substring(lengthOfOldPath));
|
cv.put(ProviderTableMeta.FILE_PATH, newPath + child.getRemotePath().substring(lengthOfOldPath));
|
||||||
if (child.getStoragePath() != null && child.getStoragePath().startsWith(defaultSavePath)) {
|
if (child.getStoragePath() != null && child.getStoragePath().startsWith(defaultSavePath)) {
|
||||||
|
|
Loading…
Reference in a new issue