From: masensio Date: Mon, 24 Feb 2014 12:37:48 +0000 (+0100) Subject: Merge branch 'develop' into remove_folder_size_info X-Git-Tag: oc-android-1.5.5~32^2~1 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/c8fc9cfa70774498570ea422144ef432d2ebaa3f?hp=271078a4039f3c674462f929bc97528901e41e64 Merge branch 'develop' into remove_folder_size_info --- diff --git a/src/com/owncloud/android/datamodel/FileDataStorageManager.java b/src/com/owncloud/android/datamodel/FileDataStorageManager.java index 5abdd892..f132d967 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) { diff --git a/src/com/owncloud/android/providers/FileContentProvider.java b/src/com/owncloud/android/providers/FileContentProvider.java index 2c7b520d..bad2ddc6 100644 --- a/src/com/owncloud/android/providers/FileContentProvider.java +++ b/src/com/owncloud/android/providers/FileContentProvider.java @@ -442,7 +442,7 @@ public class FileContentProvider extends ContentProvider { private int update(SQLiteDatabase db, Uri uri, ContentValues values, String selection, String[] selectionArgs) { switch (mUriMatcher.match(uri)) { case DIRECTORY: - return updateFolderSize(db, selectionArgs[0]); + return 0; //updateFolderSize(db, selectionArgs[0]); case SHARES: return db.update(ProviderTableMeta.OCSHARES_TABLE_NAME, values, selection, selectionArgs); default: @@ -450,7 +450,7 @@ public class FileContentProvider extends ContentProvider { } } - + /* private int updateFolderSize(SQLiteDatabase db, String folderId) { int count = 0; String [] whereArgs = new String[] { folderId }; @@ -501,7 +501,7 @@ public class FileContentProvider extends ContentProvider { } return count; } - +*/ @Override public ContentProviderResult[] applyBatch (ArrayList operations) throws OperationApplicationException { diff --git a/src/com/owncloud/android/syncadapter/FileSyncAdapter.java b/src/com/owncloud/android/syncadapter/FileSyncAdapter.java index 349f1370..0184e1f5 100644 --- a/src/com/owncloud/android/syncadapter/FileSyncAdapter.java +++ b/src/com/owncloud/android/syncadapter/FileSyncAdapter.java @@ -351,7 +351,7 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter { syncDown = (parentEtagChanged || etag == null || etag.length() == 0); if(syncDown) { */ synchronizeFolder(newFile); - sendLocalBroadcast(EVENT_FULL_SYNC_FOLDER_SIZE_SYNCED, parent.getRemotePath(), null); + //sendLocalBroadcast(EVENT_FULL_SYNC_FOLDER_SIZE_SYNCED, parent.getRemotePath(), null); //} } } diff --git a/src/com/owncloud/android/ui/activity/FileDisplayActivity.java b/src/com/owncloud/android/ui/activity/FileDisplayActivity.java index d5429dac..581b6bf0 100644 --- a/src/com/owncloud/android/ui/activity/FileDisplayActivity.java +++ b/src/com/owncloud/android/ui/activity/FileDisplayActivity.java @@ -86,7 +86,6 @@ import com.owncloud.android.ui.fragment.FileDetailFragment; import com.owncloud.android.ui.fragment.FileFragment; import com.owncloud.android.ui.fragment.OCFileListFragment; import com.owncloud.android.ui.preview.PreviewImageActivity; -import com.owncloud.android.ui.preview.PreviewImageFragment; import com.owncloud.android.ui.preview.PreviewMediaFragment; import com.owncloud.android.ui.preview.PreviewVideoActivity; import com.owncloud.android.utils.DisplayUtils; @@ -120,7 +119,7 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa private static final String KEY_WAITING_TO_PREVIEW = "WAITING_TO_PREVIEW"; private static final String KEY_SYNC_IN_PROGRESS = "SYNC_IN_PROGRESS"; - private static final String KEY_REFRESH_SHARES_IN_PROGRESS = "SHARES_IN_PROGRESS"; + //private static final String KEY_REFRESH_SHARES_IN_PROGRESS = "SHARES_IN_PROGRESS"; public static final int DIALOG_SHORT_WAIT = 0; private static final int DIALOG_CHOOSE_UPLOAD_SOURCE = 1; diff --git a/src/com/owncloud/android/ui/adapter/FileListListAdapter.java b/src/com/owncloud/android/ui/adapter/FileListListAdapter.java index f31ca142..11449af8 100644 --- a/src/com/owncloud/android/ui/adapter/FileListListAdapter.java +++ b/src/com/owncloud/android/ui/adapter/FileListListAdapter.java @@ -161,8 +161,8 @@ public class FileListListAdapter extends BaseAdapter implements ListAdapter { } else { - fileSizeV.setVisibility(View.VISIBLE); - fileSizeV.setText(DisplayUtils.bytesToHumanReadable(file.getFileLength())); + fileSizeV.setVisibility(View.INVISIBLE); + //fileSizeV.setText(DisplayUtils.bytesToHumanReadable(file.getFileLength())); lastModV.setVisibility(View.VISIBLE); lastModV.setText(DisplayUtils.unixTimeToHumanReadable(file.getModificationTimestamp())); checkBoxV.setVisibility(View.GONE); diff --git a/tests/src/com/owncloud/android/test/AccountUtilsTest.java b/tests/src/com/owncloud/android/test/AccountUtilsTest.java index ae13bbff..fc6dc212 100644 --- a/tests/src/com/owncloud/android/test/AccountUtilsTest.java +++ b/tests/src/com/owncloud/android/test/AccountUtilsTest.java @@ -18,7 +18,7 @@ package com.owncloud.android.test; -import com.owncloud.android.lib.accounts.AccountUtils; +import com.owncloud.android.lib.common.accounts.AccountUtils; import com.owncloud.android.lib.resources.status.OwnCloudVersion; import android.test.AndroidTestCase;