Geary.Imap.ClientSession: Treat logout as disconnect

Convert `get_protocol_state` to an automatic property, so that rather
than requiring explcit signals for lifecycle events, a GObject notify
signal can be used instead.

Convert disconnect signal to a property so it can be accessed if needed.

Convert code listening to the disconnect signal to listen to notify
signals for `protocol_state` instead, and hence also treat the session
as disconnected when a logout is in progress.

Fixes #986
This commit is contained in:
Michael Gratton 2020-09-27 16:00:35 +10:00
parent ed4ba33127
commit 41be8693d4
6 changed files with 130 additions and 96 deletions

View file

@ -34,7 +34,7 @@ class Integration.Imap.ClientSession : TestCase {
}
public override void tear_down() throws GLib.Error {
if (this.session.get_protocol_state() != NOT_CONNECTED) {
if (this.session.protocol_state != NOT_CONNECTED) {
this.session.disconnect_async.begin(null, this.async_completion);
this.session.disconnect_async.end(async_result());
}