mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-11 12:05:06 -05:00
Fixed logic bug that prevented imported accounts from being recognized
We have to add new account UUIDs to "accountUuids" for them to show up in the account list.
This commit is contained in:
parent
2a8f353fe9
commit
d6c03de6f5
@ -80,10 +80,13 @@ public class SettingsImporter {
|
|||||||
public static class AccountDescriptionPair {
|
public static class AccountDescriptionPair {
|
||||||
public final AccountDescription original;
|
public final AccountDescription original;
|
||||||
public final AccountDescription imported;
|
public final AccountDescription imported;
|
||||||
|
public final boolean overwritten;
|
||||||
|
|
||||||
private AccountDescriptionPair(AccountDescription original, AccountDescription imported) {
|
private AccountDescriptionPair(AccountDescription original, AccountDescription imported,
|
||||||
|
boolean overwritten) {
|
||||||
this.original = original;
|
this.original = original;
|
||||||
this.imported = imported;
|
this.imported = imported;
|
||||||
|
this.overwritten = overwritten;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -222,7 +225,7 @@ public class SettingsImporter {
|
|||||||
editor, account, overwrite);
|
editor, account, overwrite);
|
||||||
|
|
||||||
String newUuid = importResult.imported.uuid;
|
String newUuid = importResult.imported.uuid;
|
||||||
if (!newUuid.equals(importResult.original.uuid)) {
|
if (!importResult.overwritten) {
|
||||||
newUuids.add(newUuid);
|
newUuids.add(newUuid);
|
||||||
}
|
}
|
||||||
if (editor.commit()) {
|
if (editor.commit()) {
|
||||||
@ -431,7 +434,7 @@ public class SettingsImporter {
|
|||||||
//TODO: sync folder settings with localstore?
|
//TODO: sync folder settings with localstore?
|
||||||
|
|
||||||
AccountDescription imported = new AccountDescription(accountName, uuid);
|
AccountDescription imported = new AccountDescription(accountName, uuid);
|
||||||
return new AccountDescriptionPair(original, imported);
|
return new AccountDescriptionPair(original, imported, mergeImportedAccount);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void importFolder(SharedPreferences.Editor editor, String uuid,
|
private static void importFolder(SharedPreferences.Editor editor, String uuid,
|
||||||
|
Loading…
Reference in New Issue
Block a user