Commit graph

6 commits

Author SHA1 Message Date
Michael James Gratton
0d3f10f51f Clean up user directory management.
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.
2018-05-24 15:34:29 +10:00
Michael James Gratton
9f3ec5bfcb Update unit tests to work with ServiceInfo API changes. 2018-05-23 17:53:23 +10:00
Michael James Gratton
15748cef03 Tidy up unit test infrastructure and mock classes.
* 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.
2018-04-07 09:41:18 +10:00
Michael James Gratton
50f73ff252 Allow test fixtures and test methods to throw errors by default.
* test/testcase.vala (TestCase): Add a generic throws clause to both
  TestMethod and set_up and tear_down, update subclasses.
2018-04-07 09:41:18 +10:00
Michael James Gratton
9e93062d6f Create and use a common FolderOperation account operation class. 2017-12-20 20:24:30 +10:30
Michael James Gratton
b24c554f51 Add an operations queue to GenericAccount for server operations.
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.
2017-12-19 09:41:50 +11:00