From 14e6d70ca3d7cb3006bf7dbcee192b219caed26c Mon Sep 17 00:00:00 2001 From: Thomas McGuire Date: Sun, 12 Oct 2008 15:24:13 +0000 Subject: [PATCH] Merged revisions 870423 via svnmerge from svn+ssh://tmcguire@svn.kde.org/home/kde/branches/KDE/4.1/kdepim ........ r870423 | tmcguire | 2008-10-12 16:12:02 +0200 (Sun, 12 Oct 2008) | 5 lines Backport r868195 by tmcguire from trunk to the 4.1 branch: Fix some suspicious code issues, found by Christoph Bartoschek, thanks! ........ svn path=/branches/kdepim/enterprise4/kdepim/; revision=870469 --- actionscheduler.cpp | 2 +- kmcommands.cpp | 7 ++++--- kmfoldermaildir.cpp | 2 +- partNode.cpp | 2 +- recipientseditor.cpp | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/actionscheduler.cpp b/actionscheduler.cpp index c470cb5eb..b8892af32 100644 --- a/actionscheduler.cpp +++ b/actionscheduler.cpp @@ -727,7 +727,7 @@ void ActionScheduler::moveMessage() // serial number (otherwise the move commands thinks the message wasn't moved // correctly, which would trigger the error case in moveMessageFinished(). Q_ASSERT( folder ); - if ( folder && folder->storage() && dynamic_cast( folder->storage() ) ) + if ( msg && folder && folder->storage() && dynamic_cast( folder->storage() ) ) MessageProperty::setKeepSerialNumber( msg->getMsgSerNum(), true ); timeOutTime = QTime::currentTime(); diff --git a/kmcommands.cpp b/kmcommands.cpp index fb91d6470..27680fd55 100644 --- a/kmcommands.cpp +++ b/kmcommands.cpp @@ -1924,7 +1924,7 @@ KMCommand::Result KMCopyCommand::execute() } // end for bool deleteNow = false; - if (!localList.isEmpty()) + if ( !localList.isEmpty() && mDestFolder ) { QList index; mDestFolder->addMessages( localList, index ); @@ -1945,7 +1945,7 @@ KMCommand::Result KMCopyCommand::execute() //TODO: Get rid of the other cases just use this one for all types of folder //TODO: requires adding copyMsg and getFolder methods to KMFolder.h - if (!list.isEmpty()) + if ( !list.isEmpty() && mDestFolder ) { // copy the message(s); note: the list is empty afterwards! KMFolderImap *imapDestFolder = static_cast(mDestFolder->storage()); @@ -1958,7 +1958,8 @@ KMCommand::Result KMCopyCommand::execute() // only close the folder and delete the job if we're done // otherwise this is done in slotMsgAdded or slotFolderComplete if ( deleteNow ) { - mDestFolder->close( "kmcommand" ); + if ( mDestFolder ) + mDestFolder->close( "kmcommand" ); setResult( OK ); emit completed( this ); deleteLater(); diff --git a/kmfoldermaildir.cpp b/kmfoldermaildir.cpp index 0fcbb4a42..2e550c576 100644 --- a/kmfoldermaildir.cpp +++ b/kmfoldermaildir.cpp @@ -955,7 +955,7 @@ int KMFolderMaildir::removeContents() * that would otherwise be deleted. */ QDir dir(location()); if ( dir.count() == 2 ) { // only . and .. - if ( !removeDirAndContentsRecursively( location() ), 0 ) return 1; + if ( !removeDirAndContentsRecursively( location() ) ) return 1; } return 0; } diff --git a/partNode.cpp b/partNode.cpp index 039c413d0..43566425c 100644 --- a/partNode.cpp +++ b/partNode.cpp @@ -329,7 +329,7 @@ KMMsgSignatureState partNode::overallSignatureState() const if( myState != KMMsgFullySigned ) myState = KMMsgPartiallySigned; break; - case KMMsgEncryptionProblematic: + case KMMsgSignatureProblematic: break; } } diff --git a/recipientseditor.cpp b/recipientseditor.cpp index dece8811b..1af62a7d9 100644 --- a/recipientseditor.cpp +++ b/recipientseditor.cpp @@ -606,7 +606,7 @@ void RecipientsView::removeRecipient( const QString & recipient, { // search a line which matches recipient and type QListIterator it( mLines ); - RecipientLine *line; + RecipientLine *line = 0; while (it.hasNext()) { line = it.next(); if ( ( line->recipient().email() == recipient ) &&