Don't unget messages we did not get ourselves.

Antonio, does that help with the crash?

CCBUG: 106030

svn path=/trunk/KDE/kdepim/; revision=437417
wilder-work
Till Adam 21 years ago
parent 6f02354dca
commit 4dec07fc14
  1. 6
      searchjob.cpp
  2. 1
      searchjob.h

@ -52,7 +52,8 @@ SearchJob::SearchJob( KMFolderImap* folder, ImapAccountBase* account,
const KMSearchPattern* pattern, Q_UINT32 serNum )
: FolderJob( 0, tOther, (folder ? folder->folder() : 0) ),
mFolder( folder ), mAccount( account ), mSearchPattern( pattern ),
mSerNum( serNum ), mRemainingMsgs( 0 ), mProgress( 0 )
mSerNum( serNum ), mRemainingMsgs( 0 ), mProgress( 0 ),
mUngetCurrentMsg( false )
{
}
@ -304,7 +305,7 @@ void SearchJob::slotSearchMessageArrived( KMMessage* msg )
int idx = -1;
KMFolder * p = 0;
KMMsgDict::instance()->getLocation( msg, &p, &idx );
if ( idx != -1 )
if ( idx != -1 && mUngetCurrentMsg )
mFolder->unGetMsg( idx );
}
if ( mSerNum > 0 )
@ -397,6 +398,7 @@ void SearchJob::slotSearchDataSingleMessage( KIO::Job* job, const QString& data
KMFolder *aFolder = 0;
KMMsgDict::instance()->getLocation( mSerNum, &aFolder, &idx );
assert(aFolder && (idx != -1));
mUngetCurrentMsg = !mFolder->getMsgBase( idx )->isMessage();
KMMessage * msg = mFolder->getMsg( idx );
if ( needsDownload() ) {
ImapJob *job = new ImapJob( msg );

@ -126,6 +126,7 @@ protected:
uint mRemainingMsgs;
// progress item for local searches
KPIM::ProgressItem *mProgress;
bool mUngetCurrentMsg;
};

Loading…
Cancel
Save