Rework GOA account management to allow tracking disabled accounts.

* src/client/accounts/account-manager.vala (AccountManager): Keep track
  of disabled and unavailable accounts as well as enabled accounts. If an
  known GOA account cannot be properly loaded, keep it around as a
  disabled account. When GOA accounts are removed, just disable them
  instead.
This commit is contained in:
Michael James Gratton 2018-06-02 01:04:59 +02:00
parent b95cb08921
commit 538809c0eb
6 changed files with 420 additions and 202 deletions

View file

@ -169,6 +169,13 @@ public class Geary.Engine : BaseObject {
closed();
}
/**
* Determines if an account with a specific id has added.
*/
public bool has_account(string id) {
return (this.accounts != null && this.accounts.has_key(id));
}
/**
* Returns a current account given its id.
*
@ -406,8 +413,8 @@ public class Geary.Engine : BaseObject {
/**
* Removes an account from the engine.
*/
public async void remove_account_async(AccountInformation account,
Cancellable? cancellable = null) throws Error {
public void remove_account(AccountInformation account)
throws GLib.Error {
check_opened();
// Ensure account is closed.