mirror of
https://github.com/nextcloud/android.git
synced 2024-11-26 23:28:42 +03:00
FileMenuFilter: reorder conditionals for performance (Spotbugs)
Signed-off-by: Álvaro Brey <alvaro.brey@nextcloud.com>
This commit is contained in:
parent
7c9941ac0c
commit
8c62cb1c0c
1 changed files with 3 additions and 3 deletions
|
@ -235,7 +235,7 @@ public class FileMenuFilter {
|
||||||
|
|
||||||
private void filterSendFiles(List<Integer> toShow, List<Integer> toHide, boolean inSingleFileFragment) {
|
private void filterSendFiles(List<Integer> toShow, List<Integer> toHide, boolean inSingleFileFragment) {
|
||||||
boolean show = true;
|
boolean show = true;
|
||||||
if (containsEncryptedFile() || overflowMenu || SEND_OFF.equalsIgnoreCase(context.getString(R.string.send_files_to_other_apps))) {
|
if (overflowMenu || SEND_OFF.equalsIgnoreCase(context.getString(R.string.send_files_to_other_apps)) || containsEncryptedFile()) {
|
||||||
show = false;
|
show = false;
|
||||||
}
|
}
|
||||||
if (!inSingleFileFragment && (isSingleSelection() || !anyFileDown())) {
|
if (!inSingleFileFragment && (isSingleSelection() || !anyFileDown())) {
|
||||||
|
@ -321,8 +321,8 @@ public class FileMenuFilter {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void filterUnsetEncrypted(List<Integer> toShow, List<Integer> toHide, boolean endToEndEncryptionEnabled) {
|
private void filterUnsetEncrypted(List<Integer> toShow, List<Integer> toHide, boolean endToEndEncryptionEnabled) {
|
||||||
if (files.isEmpty() || !isSingleSelection() || isSingleFile() || !isEncryptedFolder() || hasEncryptedParent()
|
if (!endToEndEncryptionEnabled || files.isEmpty() || !isSingleSelection() || isSingleFile() || !isEncryptedFolder() || hasEncryptedParent()
|
||||||
|| !endToEndEncryptionEnabled || !isEmptyFolder()) {
|
|| !isEmptyFolder()) {
|
||||||
toHide.add(R.id.action_unset_encrypted);
|
toHide.add(R.id.action_unset_encrypted);
|
||||||
} else {
|
} else {
|
||||||
toShow.add(R.id.action_unset_encrypted);
|
toShow.add(R.id.action_unset_encrypted);
|
||||||
|
|
Loading…
Reference in a new issue