mirror of
https://github.com/nextcloud/android.git
synced 2024-11-25 14:45:47 +03:00
Revert changes, only bug-fix
Signed-off-by: alperozturk <alper_ozturk@proton.me>
This commit is contained in:
parent
d6f57ed97a
commit
08bf32a39f
1 changed files with 18 additions and 24 deletions
|
@ -924,37 +924,29 @@ public class OCFileListFragment extends ExtendedListFragment implements
|
|||
* return Count of folder levels browsed up.
|
||||
*/
|
||||
public int onBrowseUp() {
|
||||
if (mFile == null) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
OCFile parentDir = null;
|
||||
OCFile parentDir;
|
||||
int moveCount = 0;
|
||||
FileDataStorageManager storageManager = mContainerActivity.getStorageManager();
|
||||
String parentPath = null;
|
||||
|
||||
if (mFile != null) {
|
||||
FileDataStorageManager storageManager = mContainerActivity.getStorageManager();
|
||||
|
||||
String parentPath = null;
|
||||
if (mFile.getParentId() != FileDataStorageManager.ROOT_PARENT_ID) {
|
||||
parentPath = new File(mFile.getRemotePath()).getParent();
|
||||
if (parentPath != null) {
|
||||
parentPath = parentPath.endsWith(OCFile.PATH_SEPARATOR) ? parentPath :
|
||||
parentPath + OCFile.PATH_SEPARATOR;
|
||||
parentDir = storageManager.getFileByPath(parentPath);
|
||||
moveCount++;
|
||||
}
|
||||
} else {
|
||||
parentDir = storageManager.getFileByPath(ROOT_PATH);
|
||||
}
|
||||
|
||||
while (parentDir == null) {
|
||||
parentPath = new File(parentPath).getParent();
|
||||
if (parentPath != null) {
|
||||
parentPath = parentPath.endsWith(OCFile.PATH_SEPARATOR) ? parentPath :
|
||||
parentPath + OCFile.PATH_SEPARATOR;
|
||||
parentDir = storageManager.getFileByPath(parentPath);
|
||||
moveCount++;
|
||||
}
|
||||
}
|
||||
|
||||
} // exit is granted because storageManager.getFileByPath("/") never returns null
|
||||
mFile = parentDir;
|
||||
|
||||
listDirectory(mFile, MainApp.isOnlyOnDevice(), false);
|
||||
|
@ -964,6 +956,8 @@ public class OCFileListFragment extends ExtendedListFragment implements
|
|||
// restore index and top position
|
||||
restoreIndexAndTopPosition();
|
||||
|
||||
} // else - should never happen now
|
||||
|
||||
return moveCount;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue