Add an option to also check the subfolders when checking a single folder,

and use this when troubleshooting the cache.

That way, we get all the folders on the server back, instead of only the 
immediate subfolders of the folder we are checking, thus preventing
bogus error messages like in kolab/issue2972.

kolab/issue2972

svn path=/branches/kdepim/enterprise/kdepim/; revision=967378
wilder-work
Thomas McGuire 17 years ago
parent d5f3068582
commit f9991a13b5
  1. 2
      favoritefolderview.cpp
  2. 6
      imapaccountbase.cpp
  3. 5
      imapaccountbase.h
  4. 9
      kmacctcachedimap.cpp
  5. 4
      kmailicalifaceimpl.cpp
  6. 2
      kmfolderimap.cpp
  7. 2
      kmmainwidget.cpp

@ -500,7 +500,7 @@ void FavoriteFolderView::checkMail()
imap->getAndCheckFolder();
} else if ( fti->folder()->folderType() == KMFolderTypeCachedImap ) {
KMFolderCachedImap* f = static_cast<KMFolderCachedImap*>( fti->folder()->storage() );
f->account()->processNewMailSingleFolder( fti->folder() );
f->account()->processNewMailInFolder( fti->folder() );
}
}
}

@ -1017,12 +1017,12 @@ namespace KMail {
}
//-----------------------------------------------------------------------------
void ImapAccountBase::processNewMailSingleFolder(KMFolder* folder)
void ImapAccountBase::processNewMailInFolder( KMFolder* folder, FolderListType type /*= Single*/ )
{
if ( mFoldersQueuedForChecking.contains( folder ) )
return;
mFoldersQueuedForChecking.append(folder);
mCheckingSingleFolder = true;
mFoldersQueuedForChecking.append( folder );
mCheckingSingleFolder = ( type == Single );
if ( checkingMail() )
{
disconnect( this, SIGNAL( finishedCheck( bool, CheckStatus ) ),

@ -252,9 +252,10 @@ namespace KMail {
virtual void cancelMailCheck();
/**
* Init a new-mail-check for a single folder
* Init a new-mail-check for a single folder, and optionally its subfolders.
*/
void processNewMailSingleFolder(KMFolder* folder);
enum FolderListType { Single, Recursive };
void processNewMailInFolder( KMFolder* folder, FolderListType type = Single );
/**
* Return true if we are processing a mailcheck for a single folder

@ -221,7 +221,7 @@ void KMAcctCachedImap::processNewMail( bool /*interactive*/ )
// Only check mail if the folder really exists, it might have been removed by the sync in
// the meantime.
if ( f ) {
processNewMail( static_cast<KMFolderCachedImap *>( f->storage() ), false );
processNewMail( static_cast<KMFolderCachedImap *>( f->storage() ), !checkingSingleFolder() );
}
}
}
@ -366,8 +366,8 @@ void KMAcctCachedImap::invalidateIMAPFolders( KMFolderCachedImap* folder )
QStringList strList;
QValueList<QGuardedPtr<KMFolder> > folderList;
kmkernel->dimapFolderMgr()->createFolderList( &strList, &folderList,
folder->folder()->child(), QString::null,
false );
folder->folder()->child(), QString::null,
false );
QValueList<QGuardedPtr<KMFolder> >::Iterator it;
mCountLastUnread = 0;
mUnreadBeforeCheck.clear();
@ -379,13 +379,12 @@ void KMAcctCachedImap::invalidateIMAPFolders( KMFolderCachedImap* folder )
// This invalidates the folder completely
cfolder->setUidValidity("INVALID");
cfolder->writeUidCache();
processNewMailSingleFolder( f );
}
}
folder->setUidValidity("INVALID");
folder->writeUidCache();
processNewMailSingleFolder( folder->folder() );
processNewMailInFolder( folder->folder(), Recursive );
}
//-----------------------------------------------------------------------------

@ -757,7 +757,7 @@ bool KMailICalIfaceImpl::triggerSync( const QString& contentsType )
imap->getAndCheckFolder();
} else if ( f->folderType() == KMFolderTypeCachedImap ) {
KMFolderCachedImap* cached = static_cast<KMFolderCachedImap*>( f->storage() );
cached->account()->processNewMailSingleFolder( f );
cached->account()->processNewMailInFolder( f );
}
}
return true;
@ -2335,7 +2335,7 @@ void KMailICalIfaceImpl::syncFolder(KMFolder * folder) const
else
return;
}
dimapFolder->account()->processNewMailSingleFolder( folder );
dimapFolder->account()->processNewMailInFolder( folder );
}
#include "kmailicalifaceimpl.moc"

@ -1189,7 +1189,7 @@ void KMFolderImap::getAndCheckFolder(bool force)
return getFolder(force);
if ( account() )
account()->processNewMailSingleFolder( folder() );
account()->processNewMailInFolder( folder() );
if (force) {
// force an update
mCheckFlags = true;

@ -1304,7 +1304,7 @@ void KMMainWidget::slotRefreshFolder()
imap->getAndCheckFolder();
} else if ( mFolder->folderType() == KMFolderTypeCachedImap ) {
KMFolderCachedImap* f = static_cast<KMFolderCachedImap*>( mFolder->storage() );
f->account()->processNewMailSingleFolder( mFolder );
f->account()->processNewMailInFolder( mFolder );
}
}
}

Loading…
Cancel
Save