mContext = context;\r
mAccount = AccountUtils.getCurrentOwnCloudAccount(mContext);\r
mTransferServiceGetter = transferServiceGetter;\r
- swapDirectory(file);\r
+ swapDirectory(file, mStorageManager);\r
/*mFile = file;\r
mFiles = mStorageManager.getDirectoryContent(mFile);*/\r
}\r
\r
/**\r
* Change the adapted directory for a new one\r
- * @param directory New file to adapt. Can be NULL, meaning "no content to adapt".\r
+ * @param directory New file to adapt. Can be NULL, meaning "no content to adapt".\r
+ * @param updatedStorageManager Optional updated storage manager; used to replace mStorageManager if is different (and not NULL)\r
*/\r
- public void swapDirectory(OCFile directory) {\r
+ public void swapDirectory(OCFile directory, DataStorageManager updatedStorageManager) {\r
mFile = directory;\r
+ if (updatedStorageManager != null && updatedStorageManager != mStorageManager) {\r
+ mStorageManager = updatedStorageManager;\r
+ mAccount = AccountUtils.getCurrentOwnCloudAccount(mContext);\r
+ }\r
if (mStorageManager != null) {\r
mFiles = mStorageManager.getDirectoryContent(mFile);\r
} else {\r