From 041853362cef70820b1dcf251678198ba7765d0c Mon Sep 17 00:00:00 2001 From: Pradeepto Bhattacharya Date: Thu, 24 May 2007 15:44:14 +0000 Subject: [PATCH] Merge ... SVN commit 645389 by wstephens: When deleting an account, there may be jobs live on that account that aren't automatically cleaned up. Make them safe in places where they lookup the account. BUG#137302 svn path=/branches/kdepim/enterprise/kdepim/; revision=667960 --- imapjob.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/imapjob.cpp b/imapjob.cpp index fbbf16dac..a9f4c2150 100644 --- a/imapjob.cpp +++ b/imapjob.cpp @@ -502,6 +502,12 @@ void ImapJob::slotGetBodyStructureResult( KIO::Job * job ) void ImapJob::slotPutMessageDataReq( KIO::Job *job, QByteArray &data ) { KMAcctImap *account = static_cast(mDestFolder->storage())->account(); + if ( !account ) + { + emit finished(); + deleteLater(); + return; + } ImapAccountBase::JobIterator it = account->findJob( job ); if ( it == account->jobsEnd() ) return; @@ -522,6 +528,12 @@ void ImapJob::slotPutMessageDataReq( KIO::Job *job, QByteArray &data ) void ImapJob::slotPutMessageResult( KIO::Job *job ) { KMAcctImap *account = static_cast(mDestFolder->storage())->account(); + if ( !account ) + { + emit finished(); + deleteLater(); + return; + } ImapAccountBase::JobIterator it = account->findJob( job ); if ( it == account->jobsEnd() ) return; bool deleteMe = false; @@ -562,6 +574,12 @@ void ImapJob::slotCopyMessageInfoData(KIO::Job * job, const QString & data) { KMFolderImap * imapFolder = static_cast(mDestFolder->storage()); KMAcctImap *account = imapFolder->account(); + if ( !account ) + { + emit finished(); + deleteLater(); + return; + } ImapAccountBase::JobIterator it = account->findJob( job ); if ( it == account->jobsEnd() ) return; @@ -595,6 +613,12 @@ void ImapJob::slotPutMessageInfoData(KIO::Job *job, const QString &data) { KMFolderImap * imapFolder = static_cast(mDestFolder->storage()); KMAcctImap *account = imapFolder->account(); + if ( !account ) + { + emit finished(); + deleteLater(); + return; + } ImapAccountBase::JobIterator it = account->findJob( job ); if ( it == account->jobsEnd() ) return; @@ -613,6 +637,12 @@ void ImapJob::slotPutMessageInfoData(KIO::Job *job, const QString &data) void ImapJob::slotCopyMessageResult( KIO::Job *job ) { KMAcctImap *account = static_cast(mDestFolder->storage())->account(); + if ( !account ) + { + emit finished(); + deleteLater(); + return; + } ImapAccountBase::JobIterator it = account->findJob( job ); if ( it == account->jobsEnd() ) return;