summaryrefslogtreecommitdiffabout
path: root/kaddressbook
authorulf69 <ulf69>2004-08-10 22:46:12 (UTC)
committer ulf69 <ulf69>2004-08-10 22:46:12 (UTC)
commit02d51ae409a353d3a79e976c26ccc1f652e55de8 (patch) (unidiff)
tree54d7a9f1eecd2ef9c3332f2bc22ff6ac6d9af335 /kaddressbook
parentdc81e96e29f619c6eb32c3ed18ff45b789c8504e (diff)
downloadkdepimpi-02d51ae409a353d3a79e976c26ccc1f652e55de8.zip
kdepimpi-02d51ae409a353d3a79e976c26ccc1f652e55de8.tar.gz
kdepimpi-02d51ae409a353d3a79e976c26ccc1f652e55de8.tar.bz2
final changes on how to send emails to selected contacts
Diffstat (limited to 'kaddressbook') (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
@@ -464,11 +464,15 @@ void KABCore::sendMail()
464{ 464{
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
474 478
@@ -482,22 +486,11 @@ void KABCore::mailVCard()
482void KABCore::mailVCard( const QStringList& uids ) 486void 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
503 QDir().mkdir( dirName, true ); 496 QDir().mkdir( dirName, true );
@@ -512,8 +505,9 @@ void KABCore::mailVCard( const QStringList& uids )
512 505
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;
519 513
@@ -528,9 +522,9 @@ void KABCore::mailVCard( const QStringList& uids )
528 urls.append( fileName ); 522 urls.append( fileName );
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
536 kapp->invokeMailer( QString::null, QString::null, QString::null, 530 kapp->invokeMailer( QString::null, QString::null, QString::null,