Avoid crashes and hopefully data loss by handling multiple sync state resets

which previously led to the folder being closed prematurely, which in turn
might have caused corruption of the mmap'd index file. (Kolab Issue 1323)

svn path=/branches/KDE/3.5/kdepim/; revision=572899
wilder-work
Till Adam 20 years ago
parent 5a61dd88b8
commit b7b261fc07
  1. 5
      kmfoldercachedimap.cpp

@ -1208,6 +1208,10 @@ void KMFolderCachedImap::uploadFlags()
void KMFolderCachedImap::slotImapStatusChanged(KMFolder* folder, const QString&, bool cont)
{
if ( mSyncState == SYNC_STATE_INITIAL ){
kdDebug(5006) << "IMAP status changed but reset " << endl;
return; // we were reset
}
if ( folder->storage() == this ) {
--mStatusFlagsJobs;
if ( mStatusFlagsJobs == 0 || !cont ) // done or aborting
@ -2010,6 +2014,7 @@ KMFolderCachedImap::slotACLChanged( const QString& userId, int permissions )
// called by KMAcctCachedImap::killAllJobs
void KMFolderCachedImap::resetSyncState()
{
if ( mSyncState == SYNC_STATE_INITIAL ) return;
mSubfoldersForSync.clear();
mSyncState = SYNC_STATE_INITIAL;
close();

Loading…
Cancel
Save