Allow the user to cancel kmail connection attempts when the account

settings are incorrect (Novell bug 247903).
BUG:93199

svn path=/branches/KDE/3.5/kdepim/; revision=653900
wilder-work
Will Stephenson 19 years ago
parent b69463ed8e
commit 1ef5b0a945
  1. 33
      imapaccountbase.cpp

@ -562,19 +562,19 @@ namespace KMail {
if (aSlave != mSlave) return; if (aSlave != mSlave) return;
handleError( errorCode, errorMsg, 0, QString::null, true ); handleError( errorCode, errorMsg, 0, QString::null, true );
if ( mAskAgain ) if ( mAskAgain )
makeConnection(); if ( makeConnection() != ImapAccountBase::Error )
else { return;
if ( !mSlaveConnected ) {
mSlaveConnectionError = true; if ( !mSlaveConnected ) {
resetConnectionList( this ); mSlaveConnectionError = true;
if ( mSlave ) resetConnectionList( this );
{ if ( mSlave )
KIO::Scheduler::disconnectSlave( slave() ); {
mSlave = 0; KIO::Scheduler::disconnectSlave( slave() );
} mSlave = 0;
} }
emit connectionResult( errorCode, errorMsg );
} }
emit connectionResult( errorCode, errorMsg );
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -892,7 +892,7 @@ namespace KMail {
bool jobsKilled = true; bool jobsKilled = true;
switch( errorCode ) { switch( errorCode ) {
case KIO::ERR_SLAVE_DIED: slaveDied(); killAllJobs( true ); break; case KIO::ERR_SLAVE_DIED: slaveDied(); killAllJobs( true ); break;
case KIO::ERR_COULD_NOT_LOGIN: // bad password case KIO::ERR_COULD_NOT_AUTHENTICATE: // bad password
mAskAgain = true; mAskAgain = true;
// fallthrough intended // fallthrough intended
case KIO::ERR_CONNECTION_BROKEN: case KIO::ERR_CONNECTION_BROKEN:
@ -901,6 +901,7 @@ namespace KMail {
// These mean that we'll have to reconnect on the next attempt, so disconnect and set mSlave to 0. // These mean that we'll have to reconnect on the next attempt, so disconnect and set mSlave to 0.
killAllJobs( true ); killAllJobs( true );
break; break;
case KIO::ERR_COULD_NOT_LOGIN:
case KIO::ERR_USER_CANCELED: case KIO::ERR_USER_CANCELED:
killAllJobs( false ); killAllJobs( false );
break; break;
@ -1042,7 +1043,7 @@ namespace KMail {
msg->deleteBodyParts(); msg->deleteBodyParts();
// make the parts and fill the mBodyPartList // make the parts and fill the mBodyPartList
constructParts( stream, 1, 0, 0, msg->asDwMessage() ); constructParts( stream, 1, 0, 0, msg->asDwMessage() );
if ( mBodyPartList.count() == 1 ) // we directly set the body later if ( mBodyPartList.count() == 1 ) // we directly set the body later, at partsToLoad below
msg->deleteBodyParts(); msg->deleteBodyParts();
if ( !as ) if ( !as )
@ -1068,6 +1069,12 @@ namespace KMail {
++partsToLoad; ++partsToLoad;
} }
} }
// if the only body part is not text, part->loadPart() would return false
// and that part is never loaded, so make sure it loads.
// it seems that TEXT does load the single body part even if it is not text/*
if ( mBodyPartList.count() == 1 && partsToLoad == 0 )
partsToLoad = 1;
if ( (mBodyPartList.count() * 0.5) < partsToLoad ) if ( (mBodyPartList.count() * 0.5) < partsToLoad )
{ {
// more than 50% of the parts have to be loaded anyway so it is faster // more than 50% of the parts have to be loaded anyway so it is faster

Loading…
Cancel
Save