Move general preferences from Account to AccountState

All data that is hosted in the Account class is persisted in the
'account.config' file, except general preferences which are stored in an
own file. This makes general preferences similar to project watches
which are also stored in an own file. Project watches are hosted in
AccountState, hence to treat general preferences and project watches
consistently it makes sense to move the general preferences to
AccountState so that general preferences and project watches are hosted
at the same place.

Change-Id: Ic063facd85fd8b8060c0e95b3ed7037f04076e64
Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
Edwin Kempin
2018-01-08 16:19:45 +01:00
parent 246c7ad643
commit f8f1684d8e
13 changed files with 75 additions and 49 deletions

View File

@@ -50,6 +50,6 @@ public class GetPreferences implements RestReadView<AccountResource> {
}
Account.Id id = rsrc.getUser().getAccountId();
return accountCache.get(id).getAccount().getGeneralPreferencesInfo();
return accountCache.get(id).getGeneralPreferences();
}
}

View File

@@ -90,7 +90,7 @@ public class SetPreferences implements RestModifyView<AccountResource, GeneralPr
accountsUpdate
.create()
.update("Set Preferences via API", id, u -> u.setGeneralPreferences(input));
return cache.get(id).getAccount().getGeneralPreferencesInfo();
return cache.get(id).getGeneralPreferences();
}
public static void storeMyMenus(VersionedAccountPreferences prefs, List<MenuItem> my)