}
}
- if (file.isFolder()) {
- updateFolderSize(file.getFileId());
- } else {
- updateFolderSize(file.getParentId());
- }
+// if (file.isFolder()) {
+// updateFolderSize(file.getFileId());
+// } else {
+// updateFolderSize(file.getParentId());
+// }
return overriden;
}
}
}
- 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) {
} 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();
} else {
getContentResolver().delete(folder_uri, where, whereArgs);
}
- updateFolderSize(folder.getParentId());
+ //updateFolderSize(folder.getParentId());
}
private void removeLocalFolder(File folder) {
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:
}
}
-
+ /*
private int updateFolderSize(SQLiteDatabase db, String folderId) {
int count = 0;
String [] whereArgs = new String[] { folderId };
}
return count;
}
-
+*/
@Override
public ContentProviderResult[] applyBatch (ArrayList<ContentProviderOperation> operations) throws OperationApplicationException {
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;
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;