summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp26
1 files changed, 10 insertions, 16 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index d6f0cee..6610288 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -465,9 +465,13 @@ void KABCore::sendMail()
465 sendMail( mViewManager->selectedEmails().join( ", " ) ); 465 sendMail( mViewManager->selectedEmails().join( ", " ) );
466} 466}
467 467
468void KABCore::sendMail( const QString& email ) 468void KABCore::sendMail( const QString& emaillist )
469{ 469{
470 bool result = ExternalAppHandler::instance()->mailToContacts(email); 470 // the parameter has the form "name1 <abc@aol.com>,name2 <abc@aol.com>;... "
471 if (emaillist.contains(",") > 0)
472 ExternalAppHandler::instance()->mailToMultipleContacts( emaillist, QString::null );
473 else
474 ExternalAppHandler::instance()->mailToOneContact( emaillist );
471} 475}
472 476
473 477
@@ -483,20 +487,9 @@ void KABCore::mailVCard( const QStringList& uids )
483{ 487{
484 QStringList urls; 488 QStringList urls;
485 489
486 QString tmpdir = locateLocal("tmp", KGlobal::getAppName()); 490// QString tmpdir = locateLocal("tmp", KGlobal::getAppName());
487 491
488/*US 492 QString dirName = "/tmp/" + KApplication::randomString( 8 );
489 // Create a temp dir, so that we can put the files in it with proper names
490 KTempFile tempDir;
491 if ( tempDir.status() != 0 ) {
492 kdWarning() << strerror( tempDir.status() ) << endl;
493 return;
494 }
495
496 QString dirName = tempDir.name();
497 tempDir.unlink();
498*/
499 QString dirName = tmpdir + "/" + KApplication::randomString( 8 );
500 493
501 494
502 495
@@ -513,6 +506,7 @@ void KABCore::mailVCard( const QStringList& uids )
513 QString fileName = dirName + "/" + name; 506 QString fileName = dirName + "/" + name;
514 507
515 QFile outFile(fileName); 508 QFile outFile(fileName);
509
516 if ( outFile.open(IO_WriteOnly) ) { // file opened successfully 510 if ( outFile.open(IO_WriteOnly) ) { // file opened successfully
517 KABC::VCardConverter converter; 511 KABC::VCardConverter converter;
518 QString vcard; 512 QString vcard;
@@ -529,7 +523,7 @@ void KABCore::mailVCard( const QStringList& uids )
529 } 523 }
530 } 524 }
531 525
532 bool result = ExternalAppHandler::instance()->mailAttachments(urls.join(", ")); 526 bool result = ExternalAppHandler::instance()->mailToMultipleContacts( QString::null, urls.join(", ") );
533 527
534 528
535/*US 529/*US