|
@@ -22,8 +22,6 @@
|
|
*/
|
|
*/
|
|
package com.owncloud.android.ui.fragment;
|
|
package com.owncloud.android.ui.fragment;
|
|
|
|
|
|
-import java.io.File;
|
|
|
|
-
|
|
|
|
import android.app.Activity;
|
|
import android.app.Activity;
|
|
import android.content.Intent;
|
|
import android.content.Intent;
|
|
import android.os.Bundle;
|
|
import android.os.Bundle;
|
|
@@ -43,7 +41,6 @@ import com.owncloud.android.files.FileMenuFilter;
|
|
import com.owncloud.android.lib.common.utils.Log_OC;
|
|
import com.owncloud.android.lib.common.utils.Log_OC;
|
|
import com.owncloud.android.lib.resources.status.OwnCloudVersion;
|
|
import com.owncloud.android.lib.resources.status.OwnCloudVersion;
|
|
import com.owncloud.android.ui.activity.FileActivity;
|
|
import com.owncloud.android.ui.activity.FileActivity;
|
|
-import com.owncloud.android.ui.activity.CopyActivity;
|
|
|
|
import com.owncloud.android.ui.activity.FileDisplayActivity;
|
|
import com.owncloud.android.ui.activity.FileDisplayActivity;
|
|
import com.owncloud.android.ui.activity.FolderPickerActivity;
|
|
import com.owncloud.android.ui.activity.FolderPickerActivity;
|
|
import com.owncloud.android.ui.activity.OnEnforceableRefreshListener;
|
|
import com.owncloud.android.ui.activity.OnEnforceableRefreshListener;
|
|
@@ -55,25 +52,28 @@ import com.owncloud.android.ui.preview.PreviewImageFragment;
|
|
import com.owncloud.android.ui.preview.PreviewMediaFragment;
|
|
import com.owncloud.android.ui.preview.PreviewMediaFragment;
|
|
import com.owncloud.android.utils.FileStorageUtils;
|
|
import com.owncloud.android.utils.FileStorageUtils;
|
|
|
|
|
|
|
|
+import java.io.File;
|
|
|
|
+import java.util.Vector;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* A Fragment that lists all files and folders in a given path.
|
|
* A Fragment that lists all files and folders in a given path.
|
|
- *
|
|
|
|
|
|
+ *
|
|
* TODO refactor to get rid of direct dependency on FileDisplayActivity
|
|
* TODO refactor to get rid of direct dependency on FileDisplayActivity
|
|
*/
|
|
*/
|
|
public class OCFileListFragment extends ExtendedListFragment {
|
|
public class OCFileListFragment extends ExtendedListFragment {
|
|
-
|
|
|
|
|
|
+
|
|
private static final String TAG = OCFileListFragment.class.getSimpleName();
|
|
private static final String TAG = OCFileListFragment.class.getSimpleName();
|
|
|
|
|
|
private static final String MY_PACKAGE = OCFileListFragment.class.getPackage() != null ?
|
|
private static final String MY_PACKAGE = OCFileListFragment.class.getPackage() != null ?
|
|
OCFileListFragment.class.getPackage().getName() : "com.owncloud.android.ui.fragment";
|
|
OCFileListFragment.class.getPackage().getName() : "com.owncloud.android.ui.fragment";
|
|
-
|
|
|
|
|
|
+
|
|
public final static String ARG_JUST_FOLDERS = MY_PACKAGE + ".JUST_FOLDERS";
|
|
public final static String ARG_JUST_FOLDERS = MY_PACKAGE + ".JUST_FOLDERS";
|
|
public final static String ARG_ALLOW_CONTEXTUAL_ACTIONS = MY_PACKAGE + ".ALLOW_CONTEXTUAL";
|
|
public final static String ARG_ALLOW_CONTEXTUAL_ACTIONS = MY_PACKAGE + ".ALLOW_CONTEXTUAL";
|
|
-
|
|
|
|
|
|
+
|
|
private static final String KEY_FILE = MY_PACKAGE + ".extra.FILE";
|
|
private static final String KEY_FILE = MY_PACKAGE + ".extra.FILE";
|
|
|
|
|
|
private FileFragment.ContainerActivity mContainerActivity;
|
|
private FileFragment.ContainerActivity mContainerActivity;
|
|
-
|
|
|
|
|
|
+
|
|
private OCFile mFile = null;
|
|
private OCFile mFile = null;
|
|
private FileListListAdapter mAdapter;
|
|
private FileListListAdapter mAdapter;
|
|
private boolean mJustFolders;
|
|
private boolean mJustFolders;
|
|
@@ -91,21 +91,21 @@ public class OCFileListFragment extends ExtendedListFragment {
|
|
Log_OC.e(TAG, "onAttach");
|
|
Log_OC.e(TAG, "onAttach");
|
|
try {
|
|
try {
|
|
mContainerActivity = (FileFragment.ContainerActivity) activity;
|
|
mContainerActivity = (FileFragment.ContainerActivity) activity;
|
|
-
|
|
|
|
|
|
+
|
|
} catch (ClassCastException e) {
|
|
} catch (ClassCastException e) {
|
|
- throw new ClassCastException(activity.toString() + " must implement " +
|
|
|
|
|
|
+ throw new ClassCastException(activity.toString() + " must implement " +
|
|
FileFragment.ContainerActivity.class.getSimpleName());
|
|
FileFragment.ContainerActivity.class.getSimpleName());
|
|
}
|
|
}
|
|
try {
|
|
try {
|
|
setOnRefreshListener((OnEnforceableRefreshListener) activity);
|
|
setOnRefreshListener((OnEnforceableRefreshListener) activity);
|
|
|
|
|
|
} catch (ClassCastException e) {
|
|
} catch (ClassCastException e) {
|
|
- throw new ClassCastException(activity.toString() + " must implement " +
|
|
|
|
|
|
+ throw new ClassCastException(activity.toString() + " must implement " +
|
|
SwipeRefreshLayout.OnRefreshListener.class.getSimpleName());
|
|
SwipeRefreshLayout.OnRefreshListener.class.getSimpleName());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public void onDetach() {
|
|
public void onDetach() {
|
|
setOnRefreshListener(null);
|
|
setOnRefreshListener(null);
|
|
@@ -137,7 +137,7 @@ public class OCFileListFragment extends ExtendedListFragment {
|
|
mJustFolders,
|
|
mJustFolders,
|
|
getActivity(),
|
|
getActivity(),
|
|
mContainerActivity
|
|
mContainerActivity
|
|
- );
|
|
|
|
|
|
+ );
|
|
setListAdapter(mAdapter);
|
|
setListAdapter(mAdapter);
|
|
|
|
|
|
registerForContextMenu();
|
|
registerForContextMenu();
|
|
@@ -147,31 +147,31 @@ public class OCFileListFragment extends ExtendedListFragment {
|
|
* Saves the current listed folder.
|
|
* Saves the current listed folder.
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public void onSaveInstanceState (Bundle outState) {
|
|
|
|
|
|
+ public void onSaveInstanceState(Bundle outState) {
|
|
super.onSaveInstanceState(outState);
|
|
super.onSaveInstanceState(outState);
|
|
outState.putParcelable(KEY_FILE, mFile);
|
|
outState.putParcelable(KEY_FILE, mFile);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* Call this, when the user presses the up button.
|
|
* Call this, when the user presses the up button.
|
|
- *
|
|
|
|
- * Tries to move up the current folder one level. If the parent folder was removed from the
|
|
|
|
|
|
+ * <p/>
|
|
|
|
+ * Tries to move up the current folder one level. If the parent folder was removed from the
|
|
* database, it continues browsing up until finding an existing folders.
|
|
* database, it continues browsing up until finding an existing folders.
|
|
- *
|
|
|
|
|
|
+ * <p/>
|
|
* return Count of folder levels browsed up.
|
|
* return Count of folder levels browsed up.
|
|
*/
|
|
*/
|
|
public int onBrowseUp() {
|
|
public int onBrowseUp() {
|
|
OCFile parentDir = null;
|
|
OCFile parentDir = null;
|
|
int moveCount = 0;
|
|
int moveCount = 0;
|
|
-
|
|
|
|
- if(mFile != null){
|
|
|
|
|
|
+
|
|
|
|
+ if (mFile != null) {
|
|
FileDataStorageManager storageManager = mContainerActivity.getStorageManager();
|
|
FileDataStorageManager storageManager = mContainerActivity.getStorageManager();
|
|
-
|
|
|
|
|
|
+
|
|
String parentPath = null;
|
|
String parentPath = null;
|
|
if (mFile.getParentId() != FileDataStorageManager.ROOT_PARENT_ID) {
|
|
if (mFile.getParentId() != FileDataStorageManager.ROOT_PARENT_ID) {
|
|
parentPath = new File(mFile.getRemotePath()).getParent();
|
|
parentPath = new File(mFile.getRemotePath()).getParent();
|
|
- parentPath = parentPath.endsWith(OCFile.PATH_SEPARATOR) ? parentPath :
|
|
|
|
- parentPath + OCFile.PATH_SEPARATOR;
|
|
|
|
|
|
+ parentPath = parentPath.endsWith(OCFile.PATH_SEPARATOR) ? parentPath :
|
|
|
|
+ parentPath + OCFile.PATH_SEPARATOR;
|
|
parentDir = storageManager.getFileByPath(parentPath);
|
|
parentDir = storageManager.getFileByPath(parentPath);
|
|
moveCount++;
|
|
moveCount++;
|
|
} else {
|
|
} else {
|
|
@@ -179,8 +179,8 @@ public class OCFileListFragment extends ExtendedListFragment {
|
|
}
|
|
}
|
|
while (parentDir == null) {
|
|
while (parentDir == null) {
|
|
parentPath = new File(parentPath).getParent();
|
|
parentPath = new File(parentPath).getParent();
|
|
- parentPath = parentPath.endsWith(OCFile.PATH_SEPARATOR) ? parentPath :
|
|
|
|
- parentPath + OCFile.PATH_SEPARATOR;
|
|
|
|
|
|
+ parentPath = parentPath.endsWith(OCFile.PATH_SEPARATOR) ? parentPath :
|
|
|
|
+ parentPath + OCFile.PATH_SEPARATOR;
|
|
parentDir = storageManager.getFileByPath(parentPath);
|
|
parentDir = storageManager.getFileByPath(parentPath);
|
|
moveCount++;
|
|
moveCount++;
|
|
} // exit is granted because storageManager.getFileByPath("/") never returns null
|
|
} // exit is granted because storageManager.getFileByPath("/") never returns null
|
|
@@ -190,20 +190,20 @@ public class OCFileListFragment extends ExtendedListFragment {
|
|
listDirectory(mFile /*, MainApp.getOnlyOnDevice()*/);
|
|
listDirectory(mFile /*, MainApp.getOnlyOnDevice()*/);
|
|
|
|
|
|
onRefresh(false);
|
|
onRefresh(false);
|
|
-
|
|
|
|
|
|
+
|
|
// restore index and top position
|
|
// restore index and top position
|
|
restoreIndexAndTopPosition();
|
|
restoreIndexAndTopPosition();
|
|
-
|
|
|
|
|
|
+
|
|
} // else - should never happen now
|
|
} // else - should never happen now
|
|
-
|
|
|
|
|
|
+
|
|
return moveCount;
|
|
return moveCount;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public void onItemClick(AdapterView<?> l, View v, int position, long id) {
|
|
public void onItemClick(AdapterView<?> l, View v, int position, long id) {
|
|
OCFile file = (OCFile) mAdapter.getItem(position);
|
|
OCFile file = (OCFile) mAdapter.getItem(position);
|
|
if (file != null) {
|
|
if (file != null) {
|
|
- if (file.isFolder()) {
|
|
|
|
|
|
+ if (file.isFolder()) {
|
|
// update state and view of this fragment
|
|
// update state and view of this fragment
|
|
// TODO Enable when "On Device" is recovered ?
|
|
// TODO Enable when "On Device" is recovered ?
|
|
listDirectory(file/*, MainApp.getOnlyOnDevice()*/);
|
|
listDirectory(file/*, MainApp.getOnlyOnDevice()*/);
|
|
@@ -211,49 +211,49 @@ public class OCFileListFragment extends ExtendedListFragment {
|
|
mContainerActivity.onBrowsedDownTo(file);
|
|
mContainerActivity.onBrowsedDownTo(file);
|
|
// save index and top position
|
|
// save index and top position
|
|
saveIndexAndTopPosition(position);
|
|
saveIndexAndTopPosition(position);
|
|
-
|
|
|
|
|
|
+
|
|
} else { /// Click on a file
|
|
} else { /// Click on a file
|
|
if (PreviewImageFragment.canBePreviewed(file)) {
|
|
if (PreviewImageFragment.canBePreviewed(file)) {
|
|
// preview image - it handles the download, if needed
|
|
// preview image - it handles the download, if needed
|
|
- ((FileDisplayActivity)mContainerActivity).startImagePreview(file);
|
|
|
|
-
|
|
|
|
|
|
+ ((FileDisplayActivity) mContainerActivity).startImagePreview(file);
|
|
|
|
+
|
|
} else if (file.isDown()) {
|
|
} else if (file.isDown()) {
|
|
if (PreviewMediaFragment.canBePreviewed(file)) {
|
|
if (PreviewMediaFragment.canBePreviewed(file)) {
|
|
// media preview
|
|
// media preview
|
|
- ((FileDisplayActivity)mContainerActivity).startMediaPreview(file, 0, true);
|
|
|
|
|
|
+ ((FileDisplayActivity) mContainerActivity).startMediaPreview(file, 0, true);
|
|
} else {
|
|
} else {
|
|
mContainerActivity.getFileOperationsHelper().openFile(file);
|
|
mContainerActivity.getFileOperationsHelper().openFile(file);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
} else {
|
|
} else {
|
|
// automatic download, preview on finish
|
|
// automatic download, preview on finish
|
|
- ((FileDisplayActivity)mContainerActivity).startDownloadForPreview(file);
|
|
|
|
|
|
+ ((FileDisplayActivity) mContainerActivity).startDownloadForPreview(file);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
} else {
|
|
} else {
|
|
Log_OC.d(TAG, "Null object in ListAdapter!!");
|
|
Log_OC.d(TAG, "Null object in ListAdapter!!");
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* {@inheritDoc}
|
|
* {@inheritDoc}
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public void onCreateContextMenu (
|
|
|
|
|
|
+ public void onCreateContextMenu(
|
|
ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
|
|
ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
|
|
super.onCreateContextMenu(menu, v, menuInfo);
|
|
super.onCreateContextMenu(menu, v, menuInfo);
|
|
Bundle args = getArguments();
|
|
Bundle args = getArguments();
|
|
- boolean allowContextualActions =
|
|
|
|
- (args == null) ? true : args.getBoolean(ARG_ALLOW_CONTEXTUAL_ACTIONS, true);
|
|
|
|
|
|
+ boolean allowContextualActions =
|
|
|
|
+ (args == null) ? true : args.getBoolean(ARG_ALLOW_CONTEXTUAL_ACTIONS, true);
|
|
if (allowContextualActions) {
|
|
if (allowContextualActions) {
|
|
MenuInflater inflater = getActivity().getMenuInflater();
|
|
MenuInflater inflater = getActivity().getMenuInflater();
|
|
inflater.inflate(R.menu.file_actions_menu, menu);
|
|
inflater.inflate(R.menu.file_actions_menu, menu);
|
|
AdapterContextMenuInfo info = (AdapterContextMenuInfo) menuInfo;
|
|
AdapterContextMenuInfo info = (AdapterContextMenuInfo) menuInfo;
|
|
OCFile targetFile = (OCFile) mAdapter.getItem(info.position);
|
|
OCFile targetFile = (OCFile) mAdapter.getItem(info.position);
|
|
-
|
|
|
|
|
|
+
|
|
if (mContainerActivity.getStorageManager() != null) {
|
|
if (mContainerActivity.getStorageManager() != null) {
|
|
FileMenuFilter mf = new FileMenuFilter(
|
|
FileMenuFilter mf = new FileMenuFilter(
|
|
targetFile,
|
|
targetFile,
|
|
@@ -277,16 +277,16 @@ public class OCFileListFragment extends ExtendedListFragment {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* {@inhericDoc}
|
|
* {@inhericDoc}
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public boolean onContextItemSelected (MenuItem item) {
|
|
|
|
- AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();
|
|
|
|
|
|
+ public boolean onContextItemSelected(MenuItem item) {
|
|
|
|
+ AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();
|
|
mTargetFile = (OCFile) mAdapter.getItem(info.position);
|
|
mTargetFile = (OCFile) mAdapter.getItem(info.position);
|
|
- switch (item.getItemId()) {
|
|
|
|
|
|
+ switch (item.getItemId()) {
|
|
case R.id.action_share_file: {
|
|
case R.id.action_share_file: {
|
|
mContainerActivity.getFileOperationsHelper().shareFileWithLink(mTargetFile);
|
|
mContainerActivity.getFileOperationsHelper().shareFileWithLink(mTargetFile);
|
|
return true;
|
|
return true;
|
|
@@ -309,14 +309,14 @@ public class OCFileListFragment extends ExtendedListFragment {
|
|
dialog.show(getFragmentManager(), ConfirmationDialogFragment.FTAG_CONFIRMATION);
|
|
dialog.show(getFragmentManager(), ConfirmationDialogFragment.FTAG_CONFIRMATION);
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
- case R.id.action_download_file:
|
|
|
|
|
|
+ case R.id.action_download_file:
|
|
case R.id.action_sync_file: {
|
|
case R.id.action_sync_file: {
|
|
mContainerActivity.getFileOperationsHelper().syncFile(mTargetFile);
|
|
mContainerActivity.getFileOperationsHelper().syncFile(mTargetFile);
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
case R.id.action_cancel_download:
|
|
case R.id.action_cancel_download:
|
|
case R.id.action_cancel_upload: {
|
|
case R.id.action_cancel_upload: {
|
|
- ((FileDisplayActivity)mContainerActivity).cancelTransference(mTargetFile);
|
|
|
|
|
|
+ ((FileDisplayActivity) mContainerActivity).cancelTransference(mTargetFile);
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
case R.id.action_see_details: {
|
|
case R.id.action_see_details: {
|
|
@@ -327,8 +327,8 @@ public class OCFileListFragment extends ExtendedListFragment {
|
|
// Obtain the file
|
|
// Obtain the file
|
|
if (!mTargetFile.isDown()) { // Download the file
|
|
if (!mTargetFile.isDown()) { // Download the file
|
|
Log_OC.d(TAG, mTargetFile.getRemotePath() + " : File must be downloaded");
|
|
Log_OC.d(TAG, mTargetFile.getRemotePath() + " : File must be downloaded");
|
|
- ((FileDisplayActivity)mContainerActivity).startDownloadForSending(mTargetFile);
|
|
|
|
-
|
|
|
|
|
|
+ ((FileDisplayActivity) mContainerActivity).startDownloadForSending(mTargetFile);
|
|
|
|
+
|
|
} else {
|
|
} else {
|
|
mContainerActivity.getFileOperationsHelper().sendDownloadedFile(mTargetFile);
|
|
mContainerActivity.getFileOperationsHelper().sendDownloadedFile(mTargetFile);
|
|
}
|
|
}
|
|
@@ -351,14 +351,14 @@ public class OCFileListFragment extends ExtendedListFragment {
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
case R.id.action_copy:
|
|
case R.id.action_copy:
|
|
- Intent action = new Intent(getActivity(), CopyActivity.class);
|
|
|
|
|
|
+ Intent action = new Intent(getActivity(), FolderPickerActivity.class);
|
|
|
|
|
|
// Pass mTargetFile that contains info of selected file/folder
|
|
// Pass mTargetFile that contains info of selected file/folder
|
|
- action.putExtra(CopyActivity.EXTRA_TARGET_FILE, mTargetFile);
|
|
|
|
|
|
+ action.putExtra(FolderPickerActivity.EXTRA_FILE, mTargetFile);
|
|
getActivity().startActivityForResult(action, FileDisplayActivity.ACTION_COPY_FILES);
|
|
getActivity().startActivityForResult(action, FileDisplayActivity.ACTION_COPY_FILES);
|
|
return true;
|
|
return true;
|
|
default:
|
|
default:
|
|
- return super.onContextItemSelected(item);
|
|
|
|
|
|
+ return super.onContextItemSelected(item);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -366,12 +366,13 @@ public class OCFileListFragment extends ExtendedListFragment {
|
|
/**
|
|
/**
|
|
* Use this to query the {@link OCFile} that is currently
|
|
* Use this to query the {@link OCFile} that is currently
|
|
* being displayed by this fragment
|
|
* being displayed by this fragment
|
|
|
|
+ *
|
|
* @return The currently viewed OCFile
|
|
* @return The currently viewed OCFile
|
|
*/
|
|
*/
|
|
- public OCFile getCurrentFile(){
|
|
|
|
|
|
+ public OCFile getCurrentFile() {
|
|
return mFile;
|
|
return mFile;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* Calls {@link OCFileListFragment#listDirectory(OCFile)} with a null parameter
|
|
* Calls {@link OCFileListFragment#listDirectory(OCFile)} with a null parameter
|
|
*/
|
|
*/
|
|
@@ -385,12 +386,12 @@ public class OCFileListFragment extends ExtendedListFragment {
|
|
// TODO Enable when "On Device" is recovered ?
|
|
// TODO Enable when "On Device" is recovered ?
|
|
listDirectory(getCurrentFile()/*, MainApp.getOnlyOnDevice()*/);
|
|
listDirectory(getCurrentFile()/*, MainApp.getOnlyOnDevice()*/);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* Lists the given directory on the view. When the input parameter is null,
|
|
* Lists the given directory on the view. When the input parameter is null,
|
|
* it will either refresh the last known directory. list the root
|
|
* it will either refresh the last known directory. list the root
|
|
* if there never was a directory.
|
|
* if there never was a directory.
|
|
- *
|
|
|
|
|
|
+ *
|
|
* @param directory File to be listed
|
|
* @param directory File to be listed
|
|
*/
|
|
*/
|
|
public void listDirectory(OCFile directory/*, boolean onlyOnDevice*/) {
|
|
public void listDirectory(OCFile directory/*, boolean onlyOnDevice*/) {
|
|
@@ -398,18 +399,18 @@ public class OCFileListFragment extends ExtendedListFragment {
|
|
if (storageManager != null) {
|
|
if (storageManager != null) {
|
|
|
|
|
|
// Check input parameters for null
|
|
// Check input parameters for null
|
|
- if(directory == null){
|
|
|
|
- if(mFile != null){
|
|
|
|
|
|
+ if (directory == null) {
|
|
|
|
+ if (mFile != null) {
|
|
directory = mFile;
|
|
directory = mFile;
|
|
} else {
|
|
} else {
|
|
directory = storageManager.getFileByPath("/");
|
|
directory = storageManager.getFileByPath("/");
|
|
if (directory == null) return; // no files, wait for sync
|
|
if (directory == null) return; // no files, wait for sync
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
// If that's not a directory -> List its parent
|
|
// If that's not a directory -> List its parent
|
|
- if(!directory.isFolder()){
|
|
|
|
|
|
+ if (!directory.isFolder()) {
|
|
Log_OC.w(TAG, "You see, that is not a directory -> " + directory.toString());
|
|
Log_OC.w(TAG, "You see, that is not a directory -> " + directory.toString());
|
|
directory = storageManager.getFileById(directory.getParentId());
|
|
directory = storageManager.getFileById(directory.getParentId());
|
|
}
|
|
}
|