Minor changes from code review

This commit is contained in:
Juan Carlos González Cabrero 2016-04-13 09:26:16 +02:00
parent 9c617e993b
commit 1d30c83809
3 changed files with 9 additions and 9 deletions

View file

@ -1057,8 +1057,7 @@ public class FileActivity extends AppCompatActivity
if (file.isFolder()) {
return file;
} else if (getStorageManager() != null) {
String parentPath = file.getRemotePath().substring(0,
file.getRemotePath().lastIndexOf(file.getFileName()));
String parentPath = file.getParentRemotePath();
return getStorageManager().getFileByPath(parentPath);
}
}

View file

@ -1032,7 +1032,8 @@ public class FileDisplayActivity extends HookActivity
requestCredentialsUpdate(context);
} else if(RemoteOperationResult.ResultCode.SSL_RECOVERABLE_PEER_UNVERIFIED.equals(synchResult.getCode())) {
} else if(RemoteOperationResult.ResultCode.SSL_RECOVERABLE_PEER_UNVERIFIED.equals(
synchResult.getCode())) {
showUntrustedCertDialog(synchResult);
}

View file

@ -350,7 +350,7 @@ public class Uploader extends FileActivity
} else {
mParents.pop();
String full_path = generatePath(mParents);
startSyncFolderOperation(getStorageManager().getFileByPath(full_path), false);
startSyncFolderOperation(getStorageManager().getFileByPath(full_path));
populateDirectoryList();
}
}
@ -371,7 +371,7 @@ public class Uploader extends FileActivity
}
if (files.get(position).isFolder()){
OCFile folderToEnter = files.get(position);
startSyncFolderOperation(folderToEnter, false);
startSyncFolderOperation(folderToEnter);
mParents.push(folderToEnter.getFileName());
populateDirectoryList();
}
@ -475,10 +475,10 @@ public class Uploader extends FileActivity
@Override
public void onSavedCertificate() {
startSyncFolderOperation(getCurrentDir(), false);
startSyncFolderOperation(getCurrentDir());
}
private void startSyncFolderOperation(OCFile folder, boolean ignoreETag) {
private void startSyncFolderOperation(OCFile folder) {
long currentSyncTime = System.currentTimeMillis();
mSyncInProgress = true;
@ -488,7 +488,7 @@ public class Uploader extends FileActivity
currentSyncTime,
false,
false,
ignoreETag,
false,
getStorageManager(),
getAccount(),
getApplicationContext()
@ -736,7 +736,7 @@ public class Uploader extends FileActivity
private void browseToRoot() {
OCFile root = getStorageManager().getFileByPath(OCFile.ROOT_PATH);
mFile = root;
startSyncFolderOperation(root, false);
startSyncFolderOperation(root);
}
private class SyncBroadcastReceiver extends BroadcastReceiver {