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
wilder-work
Martin Koller 11 years ago
parent 4c47883859
commit 4b9c4f3b5a
  1. 3
      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 );
}
}

Loading…
Cancel
Save