From 1b6c66ea0224b5ce84cd01110052f161c8b35047 Mon Sep 17 00:00:00 2001 From: Laurent Montel Date: Tue, 3 Nov 2009 12:59:04 +0000 Subject: [PATCH] Port++ svn path=/branches/work/akonadi-ports/kdepim/; revision=1044325 --- kmkernel.cpp | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/kmkernel.cpp b/kmkernel.cpp index e89b5f93b..3a6c5e70b 100644 --- a/kmkernel.cpp +++ b/kmkernel.cpp @@ -368,11 +368,10 @@ void KMKernel::checkMail () //might create a new reader but won't show!! { if ( !kmkernel->askToGoOnline() ) return; -#if 0 - kmkernel->acctMgr()->checkMail( false ); -#else - kDebug() << "AKONADI PORT: Disabled code in " << Q_FUNC_INFO; -#endif + Akonadi::AgentInstance::List lst = agentManager()->instances(); + foreach( Akonadi::AgentInstance type, lst ) { + type.synchronize(); + } } QStringList KMKernel::accounts() @@ -392,18 +391,16 @@ QStringList KMKernel::accounts() void KMKernel::checkAccount( const QString &account ) //might create a new reader but won't show!! { -#if 0 kDebug(); if ( account.isEmpty() ) checkMail(); else { - KMAccount* acct = kmkernel->acctMgr()->findByName( account ); - if ( acct ) - kmkernel->acctMgr()->singleCheckMail (acct, false ); + Akonadi::AgentInstance agent = kmkernel->agentManager()->instance( account ); + if ( agent.isValid() ) + agent.synchronize(); + else + kDebug() << "- account with name '" << account <<"' not found"; } -#else - kDebug() << "AKONADI PORT: Disabled code in " << Q_FUNC_INFO; -#endif } void KMKernel::openReader( bool onlyCheck ) @@ -2162,7 +2159,7 @@ bool KMKernel::folderIsTrash( const Akonadi::Collection & col ) { if ( col == Akonadi::SpecialCollections::self()->defaultCollection( Akonadi::SpecialCollections::Trash ) ) return true; -#if 0 +#if 0 //TODO : will implement in imap akonadi ressource. Wait for the moment QStringList actList = acctMgr()->getAccounts(); QStringList::Iterator it( actList.begin() ); for( ; it != actList.end() ; ++it ) { @@ -2238,7 +2235,7 @@ void KMKernel::slotEmptyTrash() { return; } -#if 0 +#if 0 //TODO will be implement in imap ressource QList::iterator accountIt = acctMgr()->begin(); while ( accountIt != acctMgr()->end() ) { KMAccount *acct = *accountIt; @@ -2246,11 +2243,7 @@ void KMKernel::slotEmptyTrash() Akonadi::Collection trash = findFolderCollectionById(acct->trash()); if (trash.isValid()) { -#if 0 trash->expunge(); -#else - kDebug() << "AKONADI PORT: Disabled code in " << Q_FUNC_INFO; -#endif } } #else