[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdepim/kmail
From:       Allen Winter <winter () kde ! org>
Date:       2007-04-30 22:38:03
Message-ID: 1177972683.412633.557.nullmailer () svn ! kde ! org
[Download RAW message or body]

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("<qt>None of your identities match the "
-          "receiver of this message,<br>please "
-          "choose which of the following addresses "
-          "is yours, if any:");
+                           "receiver of this message,<br>please "
+                           "choose which of the following addresses "
+                           "is yours, if any:");
     } else {
       selectMessage = i18n("<qt>Several of your identities match the "
-          "receiver of this message,<br>please "
-          "choose which of the following addresses "
-          "is yours:");
+                           "receiver of this message,<br>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<KMail::SecondaryWindow*>( mReaderWin->mainWindow() );
-  if ( window )
+  if ( window ) {
     window->close();
+  }
 }
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic