Clean up ImapDB.Account ctor/open API a bit

Move args from open_async to ctor and use these to determine and store
DB file and attachment paths as properties. This allows constructing
the DB instance up front and markig it as non-nullable, simplifies
calling patterns and hence allows removing one use of the deprecated
Engine singleton, and by moving in the local data deletion
implementation from ImapEngine.GenericAccount, also allows removing a
static helper method.
This commit is contained in:
Michael Gratton 2019-06-12 07:31:51 +10:00 committed by Michael James Gratton
parent 5e13dd0abd
commit 66a664f98d
5 changed files with 79 additions and 73 deletions

View file

@ -40,10 +40,12 @@ class Geary.ImapDB.FolderTest : TestCase {
new Geary.RFC822.MailboxAddress(null, "test@example.com")
);
this.account = new Account(config);
this.account.open_async.begin(
this.account = new Account(
config,
this.tmp_dir,
GLib.File.new_for_path(_SOURCE_ROOT_DIR).get_child("sql"),
GLib.File.new_for_path(_SOURCE_ROOT_DIR).get_child("sql")
);
this.account.open_async.begin(
null,
(obj, ret) => { async_complete(ret); }
);