[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/work/kdepim-3.5.5+
From:       Allen Winter <winter () kde ! org>
Date:       2007-04-14 15:09:55
Message-ID: 1176563395.001461.11819.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 653911 by winterz:

merge SVN commit 653900 by wstephens:

Allow the user to cancel kmail connection attempts when the account
settings are incorrect (Novell bug 247903).


 M  +2 -2      kioslaves/imap4/imap4.cc  
 M  +20 -13    kmail/imapaccountbase.cpp  


--- branches/work/kdepim-3.5.5+/kioslaves/imap4/imap4.cc #653910:653911
@@ -2020,14 +2020,14 @@
         }
       }
       if (!clientLogin (myUser, myPass, resultInfo))
-        error(KIO::ERR_COULD_NOT_LOGIN, i18n("Unable to login. Probably the "
+        error(KIO::ERR_COULD_NOT_AUTHENTICATE, i18n("Unable to login. Probably the "
         "password is wrong.\nThe server %1 replied:\n%2").arg(myHost).arg(resultInfo));
     }
     else
     {
 #ifdef HAVE_LIBSASL2
       if (!clientAuthenticate (this, authInfo, myHost, myAuth, mySSL, resultInfo))
-        error(KIO::ERR_COULD_NOT_LOGIN, i18n("Unable to authenticate via %1.\n"
+        error(KIO::ERR_COULD_NOT_AUTHENTICATE, i18n("Unable to authenticate via %1.\n"
 	"The server %2 replied:\n%3").arg(myAuth).arg(myHost).arg(resultInfo));
       else {
         myUser = authInfo.username;
--- branches/work/kdepim-3.5.5+/kmail/imapaccountbase.cpp #653910:653911
@@ -562,19 +562,19 @@
     if (aSlave != mSlave) return;
     handleError( errorCode, errorMsg, 0, QString::null, true );
     if ( mAskAgain )
-      makeConnection();
-    else {
-      if ( !mSlaveConnected ) {
-        mSlaveConnectionError = true;
-        resetConnectionList( this );
-        if ( mSlave )
-        {
-          KIO::Scheduler::disconnectSlave( slave() );
-          mSlave = 0;
-        }
+      if ( makeConnection() != ImapAccountBase::Error )
+        return;
+
+    if ( !mSlaveConnected ) {
+      mSlaveConnectionError = true;
+      resetConnectionList( this );
+      if ( mSlave )
+      {
+        KIO::Scheduler::disconnectSlave( slave() );
+        mSlave = 0;
       }
-      emit connectionResult( errorCode, errorMsg );
     }
+    emit connectionResult( errorCode, errorMsg );
   }
 
   //-----------------------------------------------------------------------------
@@ -892,7 +892,7 @@
     bool jobsKilled = true;
     switch( errorCode ) {
     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;
       // fallthrough intended
     case KIO::ERR_CONNECTION_BROKEN:
@@ -901,6 +901,7 @@
       // These mean that we'll have to reconnect on the next attempt, so disconnect and set mSlave to 0.
       killAllJobs( true );
       break;
+    case KIO::ERR_COULD_NOT_LOGIN:
     case KIO::ERR_USER_CANCELED:
       killAllJobs( false );
       break;
@@ -1042,7 +1043,7 @@
     msg->deleteBodyParts();
     // make the parts and fill the mBodyPartList
     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();
 
     if ( !as )
@@ -1068,6 +1069,12 @@
         ++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 )
     {
       // more than 50% of the parts have to be loaded anyway so it is faster

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic