mirror of https://github.com/M66B/FairEmail.git
Read-only folders are unlikely system folder candidates
This commit is contained in:
parent
b1cc2e50b5
commit
cf02289713
|
@ -19,6 +19,8 @@ package eu.faircode.email;
|
||||||
Copyright 2018-2021 by Marcel Bokhorst (M66B)
|
Copyright 2018-2021 by Marcel Bokhorst (M66B)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import static androidx.room.ForeignKey.CASCADE;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
|
||||||
|
@ -46,8 +48,6 @@ import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import static androidx.room.ForeignKey.CASCADE;
|
|
||||||
|
|
||||||
@Entity(
|
@Entity(
|
||||||
tableName = EntityFolder.TABLE_NAME,
|
tableName = EntityFolder.TABLE_NAME,
|
||||||
foreignKeys = {
|
foreignKeys = {
|
||||||
|
@ -464,6 +464,10 @@ public class EntityFolder extends EntityOrder implements Serializable {
|
||||||
Collections.sort(candidates, new Comparator<FolderScore>() {
|
Collections.sort(candidates, new Comparator<FolderScore>() {
|
||||||
@Override
|
@Override
|
||||||
public int compare(FolderScore fs1, FolderScore fs2) {
|
public int compare(FolderScore fs1, FolderScore fs2) {
|
||||||
|
int r = Boolean.compare(fs1.folder.read_only, fs2.folder.read_only);
|
||||||
|
if (r != 0)
|
||||||
|
return r;
|
||||||
|
|
||||||
int s = Integer.compare(fs1.score, fs2.score);
|
int s = Integer.compare(fs1.score, fs2.score);
|
||||||
if (s == 0) {
|
if (s == 0) {
|
||||||
if (separator == null)
|
if (separator == null)
|
||||||
|
|
Loading…
Reference in New Issue