Engine mocks don't need to be in the `Geary` namespace, and including
them there makes it difficult to use them in client tests, so put them
all in their own name-space and corresponding directory.
In practice, the same mediator is always being used for both services,
and by removing it from ServiceInformation we can provide default
instances for both IMAP and SMTP, meaning we can load account config
before service config, making handling loading for both much tidier.
This (way too large patch) enables versioning in config files, and
provides a mechanism by which to load older versions from a newer
version of Geary. It also properly introduces a new v1 config format
that adds several groups to geary.ini to make it easier to read and to
distinguish between incoming/outgoig services rather than IMAP/SMTP.
To do this, a few things that should have happened in seperate patches
were also done:
* Make AccountInformation's imap and smtp properties mutable (they
aren't stateful any more anyway), make ServiceInformation non-abstract
again and remove the subclasses (to get config versioning happening
without an explosion of a classes, it all has to be handled from the
AccountManager anyway), and some other misc things.
Get the account's id (renamed fron "name") from the account's config and
construct the id internally. Construct the ImapDB.Account instance
internally as well since it doesn't require any input from the engine.
Pass service provider to ctor so we can make the service provider
property immutable. Fill in service label in ctor so it's always set to
something useful. Move creating orphans from Engine to AccountManager
since it exists only to assign an internal id for new accounts, so it
should handled by the account manager anyway.
Instead of passing in user config and data base dirs to the Engine from
the app, then pulling them out from the engine again from the app, just
store them in AccountManager, since that's where they are needed.
* src/client/accounts/account-manager.vala (AccountManager): Store user
config and data base dirs directly rather than getting them from the
engine. Split account directory creation out into a separate method so
they aren't re-made every time the config is saved.
* src/engine/api/geary-engine.vala (Engine): Remove user config and data
dir properties and open_async args. Update call sites and unit tests.
* src/client/application/geary-controller.vala (GearyController): Chase
AccountManager and Engine API changes. Ensure account dirs are created
when an new account is added.
* src/engine/api/geary-account-information.vala (AccountInformation):
Explicitly track copies rather relying on account dirs being
null. Don't require dirs be set in the default ctor, since they won't
be known, provide a method for updating them later on instead.
* test/api/*.vala: Renamed files that contained mock objects to *-mock.vala,
not *-test.vala.
* test/testcase.vala: Renamed to test-case.vala for consistency, remove
TestCase class from Gee package since that's really not true. Clean up
code for consistency.
* test/meson.build, test/CMakeLists.txt: Split TestCase compilation out
into a separate test lib.
This generalises the approach used to execute the flag watcher and
background sync, provides a high-level means of managing local and remote
operations, and provides a means of compartmentalising operation-specific
code.
* src/engine/imap-engine/imap-engine-account-operation.vala
(AccountProcessor): Interface for denoting classes that implements some
account-specific operation.
* src/engine/imap-engine/imap-engine-account-processor.vala
(AccountProcessor): Class to manage the operation queue and execute
operations.
* src/engine/imap-engine/imap-engine-generic-account.vala
(GenericAccount): Create and manage an instance of AccountProcessor,
add queue_operation method to allow operations to be queued.