From 1ba34f8b16cd06a74ff96dfae803ce4b0521652b Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Mon, 28 Aug 2017 17:19:51 -0600 Subject: Detect connection lost so we can go to offline state kimap should really have better error codes... --- common/synchronizer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'common/synchronizer.cpp') diff --git a/common/synchronizer.cpp b/common/synchronizer.cpp index b6e33d5..46d3980 100644 --- a/common/synchronizer.cpp +++ b/common/synchronizer.cpp @@ -344,8 +344,11 @@ void Synchronizer::setStatusFromResult(const KAsync::Error &error, const QString } else if (error.errorCode == ApplicationDomain::LoginError) { //If we failed to login altough we could connect that indicates a problem with our setup. setStatus(ApplicationDomain::ErrorStatus, s, requestId); + } else if (error.errorCode == ApplicationDomain::ConnectionLostError) { + //We've lost the connection so we assume the connection to the server broke. + setStatus(ApplicationDomain::OfflineStatus, s, requestId); } - //We don't know what kind of error this was, so we assume it's transient and don't change ou status. + //We don't know what kind of error this was, so we assume it's transient and don't change our status. } else { //An operation against the server worked, so we're probably online. setStatus(ApplicationDomain::ConnectedStatus, s, requestId); -- cgit v1.2.3