forward port SVN commit 644877 by coolo:

Don't continue checking mail in the other folders when a local folder
was removed, it causes a crash on startup.

There is still a bug that local folders are removed erroneously because
their ImapPath somehow become empty, but at least they can be recovered
with Refresh Folder List now.

And as the crash is gone, I consider the bug fixed

svn path=/trunk/KDE/kdepim/; revision=645167
wilder-work
Allen Winter 19 years ago
parent ccb2998d93
commit 50d41c8e15
  1. 14
      kmacctimap.cpp

@ -335,7 +335,7 @@ void KMAcctImap::processNewMail(bool interactive)
// connect the result-signals for new-mail-notification
mCountRemainChecks++;
if (imapFolder->isSelected()) {
if ( imapFolder->isSelected() ) {
connect(imapFolder, SIGNAL(folderComplete(KMFolderImap*, bool)),
this, SLOT(postProcessNewMail(KMFolderImap*, bool)));
imapFolder->getFolder();
@ -348,13 +348,11 @@ void KMAcctImap::processNewMail(bool interactive)
connect( imapFolder, SIGNAL( folderComplete( KMFolderImap*, bool ) ),
this, SLOT( slotFolderSelected( KMFolderImap*, bool) ) );
imapFolder->getFolder();
}
else {
} else {
connect(imapFolder, SIGNAL(numUnreadMsgsChanged(KMFolder*)),
this, SLOT(postProcessNewMail(KMFolder*)));
bool ok = imapFolder->processNewMail(interactive);
if (!ok)
{
this, SLOT(postProcessNewMail(KMFolder*)));
bool ok = imapFolder->processNewMail(interactive); // this removes the local kmfolderimap if its imapPath is somehow empty, and removing it calls createFolderList, invalidating mMailCheckFolders, and causing a crash
if ( !ok ) {
// there was an error so cancel
mCountRemainChecks--;
gotError = true;
@ -362,6 +360,8 @@ void KMAcctImap::processNewMail(bool interactive)
mMailCheckProgressItem->incCompletedItems();
mMailCheckProgressItem->updateProgress();
}
// since the list of folders might have been updated at this point, mMailCheckFolders may be invalid, so break
break;
}
}
}

Loading…
Cancel
Save