From ccb796173b51981988f4cf6f20d2429df2faa2b0 Mon Sep 17 00:00:00 2001 From: "David A. Velasco" Date: Wed, 21 Nov 2012 16:28:20 +0100 Subject: [PATCH] Fixed bug: renaming a folder could miss-update the storage path of children not-down files if a download file is in the folder --- src/com/owncloud/android/datamodel/FileDataStorageManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/owncloud/android/datamodel/FileDataStorageManager.java b/src/com/owncloud/android/datamodel/FileDataStorageManager.java index be01655510..4ed425e1bd 100644 --- a/src/com/owncloud/android/datamodel/FileDataStorageManager.java +++ b/src/com/owncloud/android/datamodel/FileDataStorageManager.java @@ -533,12 +533,12 @@ public class FileDataStorageManager implements DataStorageManager { /// 2. prepare a batch of update operations to change all the descendants ArrayList operations = new ArrayList(c.getCount()); - ContentValues cv = new ContentValues(); int lengthOfOldPath = dir.getRemotePath().length(); String defaultSavePath = FileDownloader.getSavePath(mAccount.name); int lengthOfOldStoragePath = defaultSavePath.length() + lengthOfOldPath; if (c.moveToFirst()) { do { + ContentValues cv = new ContentValues(); // don't take the constructor out of the loop and clear the object OCFile child = createFileInstance(c); cv.put(ProviderTableMeta.FILE_PATH, newPath + child.getRemotePath().substring(lengthOfOldPath)); if (child.getStoragePath() != null && child.getStoragePath().startsWith(defaultSavePath)) {