From d6c03de6f596fc5b1eff16a2f5bfed9e5b9dcdd1 Mon Sep 17 00:00:00 2001 From: cketti Date: Mon, 7 Nov 2011 01:42:08 +0100 Subject: [PATCH] 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. --- src/com/fsck/k9/preferences/SettingsImporter.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/com/fsck/k9/preferences/SettingsImporter.java b/src/com/fsck/k9/preferences/SettingsImporter.java index 3c1b36475..4920a3acc 100644 --- a/src/com/fsck/k9/preferences/SettingsImporter.java +++ b/src/com/fsck/k9/preferences/SettingsImporter.java @@ -80,10 +80,13 @@ public class SettingsImporter { public static class AccountDescriptionPair { public final AccountDescription original; 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.imported = imported; + this.overwritten = overwritten; } } @@ -222,7 +225,7 @@ public class SettingsImporter { editor, account, overwrite); String newUuid = importResult.imported.uuid; - if (!newUuid.equals(importResult.original.uuid)) { + if (!importResult.overwritten) { newUuids.add(newUuid); } if (editor.commit()) { @@ -431,7 +434,7 @@ public class SettingsImporter { //TODO: sync folder settings with localstore? 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,