From kde-commits Mon Apr 30 22:38:03 2007 From: Allen Winter Date: Mon, 30 Apr 2007 22:38:03 +0000 To: kde-commits Subject: KDE/kdepim/kmail Message-Id: <1177972683.412633.557.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=117797269500751 SVN commit 659863 by winterz: forward port SVN commit 659861 by winterz: fix "attendee in CC-field are missing from an invitation if the own email address could not be found". Patch from Martin. Thanks! M +23 -19 callback.cpp --- trunk/KDE/kdepim/kmail/callback.cpp #659862:659863 @@ -108,24 +108,26 @@ QString Callback::receiver() const { - if ( mReceiverSet ) + if ( mReceiverSet ) { // Already figured this out return mReceiver; + } mReceiverSet = true; QStringList addrs = KPIMUtils::splitAddressList( mMsg->to() ); int found = 0; - for( QStringList::Iterator it = addrs.begin(); it != addrs.end(); ++it ) { - if( kmkernel->identityManager()->identityForAddress( *it ) != - KPIM::Identity::null() ) { + for ( QStringList::Iterator it = addrs.begin(); it != addrs.end(); ++it ) { + if ( kmkernel->identityManager()->identityForAddress( *it ) != + KPIM::Identity::null() ) { // Ok, this could be us ++found; mReceiver = *it; } } + QStringList ccaddrs = KPIMUtils::splitAddressList( mMsg->cc() ); - for( QStringList::Iterator it = ccaddrs.begin(); it != ccaddrs.end(); ++it ) { + for ( QStringList::Iterator it = ccaddrs.begin(); it != ccaddrs.end(); ++it ) { if( kmkernel->identityManager()->identityForAddress( *it ) != KPIM::Identity::null() ) { // Ok, this could be us @@ -133,27 +135,28 @@ mReceiver = *it; } } - if( found != 1 ) { + if ( found != 1 ) { bool ok; QString selectMessage; - if (found == 0) { + if ( found == 0 ) { selectMessage = i18n("None of your identities match the " - "receiver of this message,
please " - "choose which of the following addresses " - "is yours, if any:"); + "receiver of this message,
please " + "choose which of the following addresses " + "is yours, if any:"); } else { selectMessage = i18n("Several of your identities match the " - "receiver of this message,
please " - "choose which of the following addresses " - "is yours:"); + "receiver of this message,
please " + "choose which of the following addresses " + "is yours:"); } - mReceiver = - KInputDialog::getItem( i18n( "Select Address" ), - selectMessage, - addrs, 0, false, &ok, kmkernel->mainWin() ); - if( !ok ) + mReceiver = KInputDialog::getItem( + i18n( "Select Address" ), + selectMessage, + addrs+ccaddrs, 0, false, &ok, kmkernel->mainWin() ); + if ( !ok ) { mReceiver.clear(); + } } return mReceiver; @@ -162,6 +165,7 @@ void Callback::closeIfSecondaryWindow() const { KMail::SecondaryWindow *window = dynamic_cast( mReaderWin->mainWindow() ); - if ( window ) + if ( window ) { window->close(); + } }