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
wilder-work
Thomas McGuire 18 years ago
parent 05a9b0b602
commit 14e6d70ca3
  1. 2
      actionscheduler.cpp
  2. 7
      kmcommands.cpp
  3. 2
      kmfoldermaildir.cpp
  4. 2
      partNode.cpp
  5. 2
      recipientseditor.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<KMFolderImap*>( folder->storage() ) )
if ( msg && folder && folder->storage() && dynamic_cast<KMFolderImap*>( folder->storage() ) )
MessageProperty::setKeepSerialNumber( msg->getMsgSerNum(), true );
timeOutTime = QTime::currentTime();

@ -1924,7 +1924,7 @@ KMCommand::Result KMCopyCommand::execute()
} // end for
bool deleteNow = false;
if (!localList.isEmpty())
if ( !localList.isEmpty() && mDestFolder )
{
QList<int> 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<KMFolderImap*>(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();

@ -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;
}

@ -329,7 +329,7 @@ KMMsgSignatureState partNode::overallSignatureState() const
if( myState != KMMsgFullySigned )
myState = KMMsgPartiallySigned;
break;
case KMMsgEncryptionProblematic:
case KMMsgSignatureProblematic:
break;
}
}

@ -606,7 +606,7 @@ void RecipientsView::removeRecipient( const QString & recipient,
{
// search a line which matches recipient and type
QListIterator<RecipientLine*> it( mLines );
RecipientLine *line;
RecipientLine *line = 0;
while (it.hasNext()) {
line = it.next();
if ( ( line->recipient().email() == recipient ) &&

Loading…
Cancel
Save