allow account deleting from account picker
[pub/Android/ownCloud.git] / src / eu / alefzero / owncloud / datamodel / FileDataStorageManager.java
index 7757551..ee874d0 100644 (file)
@@ -98,7 +98,11 @@ public class FileDataStorageManager implements DataStorageManager {
     cv.put(ProviderTableMeta.FILE_ACCOUNT_OWNER, mAccount.name);
 
     if (fileExists(file.getPath())) {
-      file.setFileId(getFileByPath(file.getPath()).getFileId());
+      OCFile tmpfile = getFileByPath(file.getPath());
+      file.setStoragePath(tmpfile.getStoragePath());
+      cv.put(ProviderTableMeta.FILE_STORAGE_PATH, file.getStoragePath());
+      file.setFileId(tmpfile.getFileId());
+      
       overriden = true;
       if (getContentResolver() != null) {
         getContentResolver().update(ProviderTableMeta.CONTENT_URI,