From: masensio Date: Fri, 21 Feb 2014 13:46:09 +0000 (+0100) Subject: OC-3049: Remove the database update for the folder size data X-Git-Tag: oc-android-1.5.5~32^2~4 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/049f659f7710ba18299af5fa28d80f67c6548f88 OC-3049: Remove the database update for the folder size data --- diff --git a/src/com/owncloud/android/datamodel/FileDataStorageManager.java b/src/com/owncloud/android/datamodel/FileDataStorageManager.java index a65833cd..4ef1ba1e 100644 --- a/src/com/owncloud/android/datamodel/FileDataStorageManager.java +++ b/src/com/owncloud/android/datamodel/FileDataStorageManager.java @@ -237,11 +237,11 @@ public class FileDataStorageManager { } } - if (file.isFolder()) { - updateFolderSize(file.getFileId()); - } else { - updateFolderSize(file.getParentId()); - } +// if (file.isFolder()) { +// updateFolderSize(file.getFileId()); +// } else { +// updateFolderSize(file.getParentId()); +// } return overriden; } @@ -388,38 +388,38 @@ public class FileDataStorageManager { } } - updateFolderSize(folder.getFileId()); + //updateFolderSize(folder.getFileId()); } - /** - * - * @param id - */ - private void updateFolderSize(long id) { - if (id > FileDataStorageManager.ROOT_PARENT_ID) { - Log_OC.d(TAG, "Updating size of " + id); - if (getContentResolver() != null) { - getContentResolver().update(ProviderTableMeta.CONTENT_URI_DIR, - new ContentValues(), // won't be used, but cannot be null; crashes in KLP - ProviderTableMeta._ID + "=?", - new String[] { String.valueOf(id) }); - } else { - try { - getContentProviderClient().update(ProviderTableMeta.CONTENT_URI_DIR, - new ContentValues(), // won't be used, but cannot be null; crashes in KLP - ProviderTableMeta._ID + "=?", - new String[] { String.valueOf(id) }); - - } catch (RemoteException e) { - Log_OC.e(TAG, "Exception in update of folder size through compatibility patch " + e.getMessage()); - } - } - } else { - Log_OC.e(TAG, "not updating size for folder " + id); - } - } +// /** +// * +// * @param id +// */ +// private void updateFolderSize(long id) { +// if (id > FileDataStorageManager.ROOT_PARENT_ID) { +// Log_OC.d(TAG, "Updating size of " + id); +// if (getContentResolver() != null) { +// getContentResolver().update(ProviderTableMeta.CONTENT_URI_DIR, +// new ContentValues(), // won't be used, but cannot be null; crashes in KLP +// ProviderTableMeta._ID + "=?", +// new String[] { String.valueOf(id) }); +// } else { +// try { +// getContentProviderClient().update(ProviderTableMeta.CONTENT_URI_DIR, +// new ContentValues(), // won't be used, but cannot be null; crashes in KLP +// ProviderTableMeta._ID + "=?", +// new String[] { String.valueOf(id) }); +// +// } catch (RemoteException e) { +// Log_OC.e(TAG, "Exception in update of folder size through compatibility patch " + e.getMessage()); +// } +// } +// } else { +// Log_OC.e(TAG, "not updating size for folder " + id); +// } +// } public void removeFile(OCFile file, boolean removeDBData, boolean removeLocalCopy) { @@ -442,7 +442,7 @@ public class FileDataStorageManager { } else { getContentResolver().delete(file_uri, where, whereArgs); } - updateFolderSize(file.getParentId()); + //updateFolderSize(file.getParentId()); } if (removeLocalCopy && file.isDown() && file.getStoragePath() != null) { boolean success = new File(file.getStoragePath()).delete(); @@ -482,7 +482,7 @@ public class FileDataStorageManager { } else { getContentResolver().delete(folder_uri, where, whereArgs); } - updateFolderSize(folder.getParentId()); + //updateFolderSize(folder.getParentId()); } private void removeLocalFolder(File folder) {