From bfa7365abc53423a84d99e146c0abbf3b8cba1e3 Mon Sep 17 00:00:00 2001 From: Till Adam Date: Wed, 23 Mar 2005 19:02:23 +0000 Subject: [PATCH] Patch by Rich Burch fixing the delayed creation of folders on online imap accounts when the connection fails. Thanks, Rich. BUGS: 102185 svn path=/trunk/kdepim/; revision=400062 --- kmfolderimap.cpp | 17 +++++++++++------ kmfolderimap.h | 2 +- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/kmfolderimap.cpp b/kmfolderimap.cpp index 39a151d07..0b504d3c9 100644 --- a/kmfolderimap.cpp +++ b/kmfolderimap.cpp @@ -1364,8 +1364,8 @@ void KMFolderImap::createFolder(const QString &name) if ( mFoldersPendingCreation.isEmpty() ) { // first folder, connect - connect( mAccount, SIGNAL( connectionResult(int, const QString&) ), - this, SLOT( slotCreatePendingFolders() ) ); + connect( mAccount, SIGNAL( connectionResult( int, const QString& ) ), + this, SLOT( slotCreatePendingFolders( int, const QString& ) ) ); } mFoldersPendingCreation << name; return; @@ -1902,11 +1902,16 @@ void KMFolderImap::setAlreadyRemoved( bool removed ) } } -void KMFolderImap::slotCreatePendingFolders() +void KMFolderImap::slotCreatePendingFolders( int errorCode, const QString &errorMsg ) { - QStringList::Iterator it = mFoldersPendingCreation.begin(); - for ( ; it != mFoldersPendingCreation.end(); ++it ) { - createFolder( *it ); + Q_UNUSED( errorMsg ); + disconnect( mAccount, SIGNAL( connectionResult( int, const QString& ) ), + this, SLOT( slotCreatePendingFolders( int, const QString& ) ) ); + if ( !errorCode ) { + QStringList::Iterator it = mFoldersPendingCreation.begin(); + for ( ; it != mFoldersPendingCreation.end(); ++it ) { + createFolder( *it ); + } } mFoldersPendingCreation.clear(); } diff --git a/kmfolderimap.h b/kmfolderimap.h index cd78eda08..042583c58 100644 --- a/kmfolderimap.h +++ b/kmfolderimap.h @@ -439,7 +439,7 @@ protected slots: * account is still connecting. Once the account emits the connected * signal this slot is called and the folders created. */ - void slotCreatePendingFolders(); + void slotCreatePendingFolders( int errorCode, const QString& errorMsg ); protected: QString mImapPath;