Don't load all engine contacts on startup

Prepare for doing composer autocomplete via queries by not loading all
contacts at startup in the engine. Update Geary.ContactStore API to that
end, and convert Geary.Account.get_contact_store accessor method to a
property.
This commit is contained in:
Michael Gratton 2019-06-07 17:58:31 +10:00 committed by Michael James Gratton
parent 304377c787
commit 0b734f7ba2
17 changed files with 218 additions and 271 deletions

View file

@ -16,18 +16,24 @@ public class Geary.MockAccount : Account, MockObject {
}
public class MockContactStore : ContactStore {
public class MockContactStore : GLib.Object, ContactStore {
internal MockContactStore() {
}
public override async void
mark_contacts_async(Gee.Collection<Contact> contacts,
ContactFlags? to_add,
ContactFlags? to_remove) throws Error {
throw new EngineError.UNSUPPORTED("Mock method");
}
public async Contact? get_by_rfc822(Geary.RFC822.MailboxAddress address,
GLib.Cancellable? cancellable)
throws GLib.Error {
throw new EngineError.UNSUPPORTED("Mock method");
}
public async void update_contacts(Gee.Collection<Contact> contacts,
GLib.Cancellable? cancellable)
throws GLib.Error {
throw new EngineError.UNSUPPORTED("Mock method");
}
}
@ -171,10 +177,6 @@ public class Geary.MockAccount : Account, MockObject {
);
}
public override Geary.ContactStore get_contact_store() {
return new MockContactStore();
}
public override Folder? get_special_folder(SpecialFolderType special)
throws Error {
return object_call<Folder?>(