From 5cd50334f66f9a6ac8d598f641bb1d2ef5ae835e Mon Sep 17 00:00:00 2001 From: Andras Mantia Date: Sun, 2 Oct 2011 23:35:00 +0300 Subject: [PATCH] Don't add the same resource multiple times in the checked list. --- kmkernel.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/kmkernel.cpp b/kmkernel.cpp index eb02afabd..71fca51a9 100644 --- a/kmkernel.cpp +++ b/kmkernel.cpp @@ -479,14 +479,15 @@ bool KMKernel::handleCommandLine( bool noArgsOpensReader ) /********************************************************************/ void KMKernel::checkMail () //might create a new reader but won't show!! { - if ( !kmkernel->askToGoOnline() ) + if ( !kmkernel->askToGoOnline() ) return; const QString resourceGroupPattern( "Resource %1" ); const Akonadi::AgentInstance::List lst = MailCommon::Util::agentInstances(); foreach( Akonadi::AgentInstance type, lst ) { - KConfigGroup group( KMKernel::config(), resourceGroupPattern.arg( type.identifier() ) ); + const QString id = type.identifier(); + KConfigGroup group( KMKernel::config(), resourceGroupPattern.arg( id ) ); if ( group.readEntry( "IncludeInManualChecks", true ) ) { if ( !type.isOnline() ) type.setIsOnline( true ); @@ -495,7 +496,9 @@ void KMKernel::checkMail () //might create a new reader but won't show!! emit startCheckMail(); } - mResourcesBeingChecked.append( type.identifier() ); + if ( !mResourcesBeingChecked.contains( id ) ) { + mResourcesBeingChecked.append( id ); + } type.synchronize(); } }