diff --git a/distributionlistdialog.cpp b/distributionlistdialog.cpp index f3f46d66b..abb73e9aa 100644 --- a/distributionlistdialog.cpp +++ b/distributionlistdialog.cpp @@ -223,11 +223,13 @@ void DistributionListDialog::slotUser1() // save the resource bool saveError = true; KABC::Ticket *ticket = ab->requestSaveTicket( resource ); - if ( ticket ) - if ( ab->save( ticket ) ) + if ( ticket ) { + if ( ab->save( ticket ) ) { saveError = false; - else + } else { ab->releaseSaveTicket( ticket ); + } + } if ( saveError ) kWarning(5006) <<" Couldn't save new addresses in the distribution list just created to the address book"; diff --git a/kmfoldermaildir.cpp b/kmfoldermaildir.cpp index d632081eb..7d9b4a55b 100644 --- a/kmfoldermaildir.cpp +++ b/kmfoldermaildir.cpp @@ -721,7 +721,7 @@ void KMFolderMaildir::readFileHeaderIntern( const QString& dir, } // Is this a long header line? - if (inHeader && line[0] == '\t' || line[0] == ' ') + if (inHeader && ( line[0] == '\t' || line[0] == ' ' ) ) { int i = 0; while (line[i] == '\t' || line[i] == ' ') diff --git a/kmgroupware.cpp b/kmgroupware.cpp index 64d672638..9a7ac558e 100644 --- a/kmgroupware.cpp +++ b/kmgroupware.cpp @@ -57,8 +57,8 @@ bool vPartFoundAndDecoded( KMMessage* msg, QString& s ) s = QString::fromUtf8( msg->bodyDecoded() ); return true; } else if( DwMime::kTypeMultipart == msg->type() && - (DwMime::kSubtypeMixed == msg->subtype() ) || - (DwMime::kSubtypeAlternative == msg->subtype() )) + ( (DwMime::kSubtypeMixed == msg->subtype() ) || + (DwMime::kSubtypeAlternative == msg->subtype() ) )) { // kDebug(5006) <<"KMGroupware looking for TNEF data"; DwBodyPart* dwPart = msg->findDwBodyPart( DwMime::kTypeApplication, diff --git a/kmheaders.cpp b/kmheaders.cpp index f80a74139..0dd2f7b17 100644 --- a/kmheaders.cpp +++ b/kmheaders.cpp @@ -2035,8 +2035,8 @@ void KMHeaders::findUnreadAux( HeaderItem*& item, MessageStatus status = msgBase->status(); if ( status.isUnread() || status.isNew() ) foundUnreadMessage = true; - if ( !onlyNew && ( status.isUnread() || status.isNew() ) - || onlyNew && status.isNew()) + if ( ( !onlyNew && ( status.isUnread() || status.isNew() ) ) + || ( onlyNew && status.isNew() ) ) lastUnread = newItem; if (newItem == item) break; newItem = static_cast(newItem->itemBelow()); @@ -2054,24 +2054,27 @@ int KMHeaders::findUnread(bool aDirNext, int aStartAt, bool onlyNew, bool accept if (!mFolder) return -1; if (mFolder->count() == -1) return -1; - if ((aStartAt >= 0) && (aStartAt < (int)mItems.size())) + if ((aStartAt >= 0) && (aStartAt < (int)mItems.size())) { item = mItems[aStartAt]; - else { + } else { item = currentHeaderItem(); - if (!item) { - if (aDirNext) - item = static_cast(firstChild()); - else - item = static_cast(lastChild()); + if ( !item ) { + if ( aDirNext ) { + item = static_cast( firstChild() ); + } else { + item = static_cast( lastChild() ); + } } if (!item) return -1; - if ( !acceptCurrent ) - if (aDirNext) - item = static_cast(item->itemBelow()); - else - item = static_cast(item->itemAbove()); + if ( !acceptCurrent ) { + if ( aDirNext ) { + item = static_cast( item->itemBelow() ); + } else { + item = static_cast( item->itemAbove() ); + } + } } pitem = item; @@ -2843,7 +2846,8 @@ bool KMHeaders::writeSortOrder() } else if( i->nextSibling()) { i = i->nextSibling(); } else { - for(i=0; !i && s.count(); i = s.pop()->nextSibling()); + for(i=0; !i && s.count(); i = s.pop()->nextSibling()) + ; } } } diff --git a/kmsearchpattern.cpp b/kmsearchpattern.cpp index 9a85840d7..641866485 100644 --- a/kmsearchpattern.cpp +++ b/kmsearchpattern.cpp @@ -293,7 +293,7 @@ bool KMSearchRuleString::matches( const DwString & aStr, KMMessage & msg, start += headerLen; size_t stop = aStr.find( '\n', start ); char ch = '\0'; - while ( stop != DwString::npos && ( ch = aStr.at( stop + 1 ) ) == ' ' || ch == '\t' ) + while ( stop != DwString::npos && ( ( ch = aStr.at( stop + 1 ) ) == ' ' || ch == '\t' ) ) stop = aStr.find( '\n', stop + 1 ); const int len = stop == DwString::npos ? aStr.length() - start : stop - start ; const QByteArray codedValue( aStr.data() + start, len + 1 );