From 4b9c4f3b5a4c28e6d1a4a7922b05fd4e30dc969d Mon Sep 17 00:00:00 2001 From: Martin Koller Date: Sun, 25 Jan 2015 14:40:07 +0100 Subject: [PATCH] Allow Akonadi resources to participate in online/offline mode switching Currently kmail has only a hardcoded check for pop3 and imap resources when switching online/offline mode. That means new/3rd-party resources can not participate in this switching. With introducing a new capability label "NeedsNetwork" in a resources .desktop file, kmail can now switch the online mode for all resources which have this flag set. REVIEW: 122228 --- kmkernel.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kmkernel.cpp b/kmkernel.cpp index 4d631c455..5fb4af063 100644 --- a/kmkernel.cpp +++ b/kmkernel.cpp @@ -932,7 +932,8 @@ void KMKernel::setAccountStatus(bool goOnline) const QString identifier( type.identifier() ); if ( PimCommon::Util::isImapResource(identifier) || identifier.contains( POP3_RESOURCE_IDENTIFIER ) || - identifier.contains( QLatin1String("akonadi_maildispatcher_agent") ) ) { + identifier.contains( QLatin1String("akonadi_maildispatcher_agent") ) || + type.type().capabilities().contains(QLatin1String("NeedsNetwork")) ) { type.setIsOnline( goOnline ); } }