}
- public Cursor getContent(long parentId) {
- Log_OC.d(TAG, "getContent start");
- Uri req_uri = Uri.withAppendedPath(
- ProviderTableMeta.CONTENT_URI_DIR,
- String.valueOf(parentId));
- Cursor c = null;
-
- if (getContentProviderClient() != null) {
- try {
- c = getContentProviderClient().query(req_uri, null,
- ProviderTableMeta.FILE_PARENT + "=?" ,
- new String[] { String.valueOf(parentId)}, null);
- } catch (RemoteException e) {
- Log_OC.e(TAG, e.getMessage());
- return c;
- }
- } else {
- c = getContentResolver().query(req_uri, null,
- ProviderTableMeta.FILE_PARENT + "=?" ,
- new String[] { String.valueOf(parentId)}, null);
-
- //c.setNotificationUri(getContentResolver(), req_uri);
- }
-
- Log_OC.d(TAG, "getContent end");
- return c;
- }
-
private OCFile createRootDir() {
OCFile file = new OCFile(OCFile.ROOT_PATH);
file.setMimetype("DIR");
return c;
}
-// private Cursor getShareCursorForValue(String key, String value) {
-// Cursor c = null;
-// if (getContentResolver() != null) {
-// c = getContentResolver()
-// .query(ProviderTableMeta.CONTENT_URI_SHARE,
-// null,
-// key + "=? AND "
-// + ProviderTableMeta.OCSHARES_ACCOUNT_OWNER
-// + "=?",
-// new String[] { value, mAccount.name }, null);
-// } else {
-// try {
-// c = getContentProviderClient().query(
-// ProviderTableMeta.CONTENT_URI_SHARE,
-// null,
-// key + "=? AND " + ProviderTableMeta.OCSHARES_ACCOUNT_OWNER
-// + "=?", new String[] { value, mAccount.name },
-// null);
-// } catch (RemoteException e) {
-// Log_OC.e(TAG, "Could not get file details: " + e.getMessage());
-// c = null;
-// }
-// }
-// return c;
-// }
+ private Cursor getShareCursorForValue(String key, String value) {
+ Cursor c = null;
+ if (getContentResolver() != null) {
+ c = getContentResolver()
+ .query(ProviderTableMeta.CONTENT_URI_SHARE,
+ null,
+ key + "=? AND "
+ + ProviderTableMeta.OCSHARES_ACCOUNT_OWNER
+ + "=?",
+ new String[] { value, mAccount.name }, null);
+ } else {
+ try {
+ c = getContentProviderClient().query(
+ ProviderTableMeta.CONTENT_URI_SHARE,
+ null,
+ key + "=? AND " + ProviderTableMeta.OCSHARES_ACCOUNT_OWNER
+ + "=?", new String[] { value, mAccount.name },
+ null);
+ } catch (RemoteException e) {
+ Log_OC.e(TAG, "Could not get file details: " + e.getMessage());
+ c = null;
+ }
+ }
+ return c;
+ }
private OCFile createFileInstance(Cursor c) {
OCFile file = null;
package com.owncloud.android.ui.adapter;\r
\r
import android.accounts.Account;\r
-import android.content.Context;\r
-import android.support.v4.widget.SimpleCursorAdapter;\r
+import android.content.Context;
import android.view.LayoutInflater;\r
import android.view.View;\r
import android.view.ViewGroup;\r
-//import android.widget.BaseAdapter;\r
+import android.widget.BaseAdapter;\r
import android.widget.ImageView;\r
import android.widget.ListAdapter;\r
import android.widget.ListView;\r
* @author Bartek Przybylski\r
* \r
*/\r
-public class FileListListAdapter extends SimpleCursorAdapter /*BaseAdapter*/ implements ListAdapter {\r
-\r
+public class FileListListAdapter extends BaseAdapter implements ListAdapter {\r
private Context mContext;\r
- private static OCFile mFile = null;\r
+ private OCFile mFile = null;\r
private Vector<OCFile> mFiles = null;\r
- private static FileDataStorageManager mStorageManager;
+\r
+ private FileDataStorageManager mStorageManager;
private Account mAccount;
private ComponentsGetter mTransferServiceGetter;\r
-
-\r
- public FileListListAdapter(Context context, ComponentsGetter componentsGetter) {\r
- super(context, 0, null, null, null, 0);\r
+ \r
+ public FileListListAdapter(Context context, ComponentsGetter transferServiceGetter) {\r
mContext = context;\r
mAccount = AccountUtils.getCurrentOwnCloudAccount(mContext);\r
- mTransferServiceGetter = componentsGetter; }
+ mTransferServiceGetter = transferServiceGetter;\r
+ }
\r
@Override\r
public boolean areAllItemsEnabled() {\r