X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/35ace0b97335cdb8d45b5b2be94c41e17fe9e040..10f07d62f560fae5369d1ec893b956bcc24b4565:/src/eu/alefzero/owncloud/datamodel/FileDataStorageManager.java diff --git a/src/eu/alefzero/owncloud/datamodel/FileDataStorageManager.java b/src/eu/alefzero/owncloud/datamodel/FileDataStorageManager.java index 0e527850..1feb424b 100644 --- a/src/eu/alefzero/owncloud/datamodel/FileDataStorageManager.java +++ b/src/eu/alefzero/owncloud/datamodel/FileDataStorageManager.java @@ -59,8 +59,8 @@ public class FileDataStorageManager implements DataStorageManager { OCFile file = null; if (c.moveToFirst()) { file = createFileInstance(c); - c.close(); } + c.close(); return file; } @@ -70,8 +70,8 @@ public class FileDataStorageManager implements DataStorageManager { OCFile file = null; if (c.moveToFirst()) { file = createFileInstance(c); - c.close(); } + c.close(); return file; } @@ -101,6 +101,7 @@ public class FileDataStorageManager implements DataStorageManager { cv.put(ProviderTableMeta.FILE_STORAGE_PATH, file.getStoragePath()); cv.put(ProviderTableMeta.FILE_ACCOUNT_OWNER, mAccount.name); cv.put(ProviderTableMeta.FILE_LAST_SYNC_DATE, file.getLastSyncDate()); + cv.put(ProviderTableMeta.FILE_KEEP_IN_SYNC, file.keepInSync() ? 1 : 0); if (fileExists(file.getRemotePath())) { OCFile tmpfile = getFileByPath(file.getRemotePath()); @@ -288,9 +289,9 @@ public class FileDataStorageManager implements DataStorageManager { file.setStoragePath(c.getString(c .getColumnIndex(ProviderTableMeta.FILE_STORAGE_PATH))); if (file.getStoragePath() == null) { - // try to find exisiting file and bind it with current account + // try to find existing file and bind it with current account File sdCard = Environment.getExternalStorageDirectory(); - File f = new File(sdCard.getAbsolutePath() + "/owncloud/" + mAccount.name + file.getRemotePath()); + File f = new File(sdCard.getAbsolutePath() + "/owncloud/" + mAccount.name + file.getURLDecodedRemotePath()); if (f.exists()) file.setStoragePath(f.getAbsolutePath()); } @@ -303,6 +304,8 @@ public class FileDataStorageManager implements DataStorageManager { .getColumnIndex(ProviderTableMeta.FILE_MODIFIED))); file.setLastSyncDate(c.getLong(c .getColumnIndex(ProviderTableMeta.FILE_LAST_SYNC_DATE))); + file.setKeepInSync(c.getInt( + c.getColumnIndex(ProviderTableMeta.FILE_KEEP_IN_SYNC)) == 1 ? true : false); } return file; }