From 02d51ae409a353d3a79e976c26ccc1f652e55de8 Mon Sep 17 00:00:00 2001 From: ulf69 Date: Tue, 10 Aug 2004 22:46:12 +0000 Subject: final changes on how to send emails to selected contacts --- (limited to 'kaddressbook') 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() sendMail( mViewManager->selectedEmails().join( ", " ) ); } -void KABCore::sendMail( const QString& email ) +void KABCore::sendMail( const QString& emaillist ) { - bool result = ExternalAppHandler::instance()->mailToContacts(email); + // the parameter has the form "name1 ,name2 ;... " + if (emaillist.contains(",") > 0) + ExternalAppHandler::instance()->mailToMultipleContacts( emaillist, QString::null ); + else + ExternalAppHandler::instance()->mailToOneContact( emaillist ); } @@ -483,20 +487,9 @@ void KABCore::mailVCard( const QStringList& uids ) { QStringList urls; - QString tmpdir = locateLocal("tmp", KGlobal::getAppName()); +// QString tmpdir = locateLocal("tmp", KGlobal::getAppName()); -/*US - // Create a temp dir, so that we can put the files in it with proper names - KTempFile tempDir; - if ( tempDir.status() != 0 ) { - kdWarning() << strerror( tempDir.status() ) << endl; - return; - } - - QString dirName = tempDir.name(); - tempDir.unlink(); -*/ - QString dirName = tmpdir + "/" + KApplication::randomString( 8 ); + QString dirName = "/tmp/" + KApplication::randomString( 8 ); @@ -513,6 +506,7 @@ void KABCore::mailVCard( const QStringList& uids ) QString fileName = dirName + "/" + name; QFile outFile(fileName); + if ( outFile.open(IO_WriteOnly) ) { // file opened successfully KABC::VCardConverter converter; QString vcard; @@ -529,7 +523,7 @@ void KABCore::mailVCard( const QStringList& uids ) } } - bool result = ExternalAppHandler::instance()->mailAttachments(urls.join(", ")); + bool result = ExternalAppHandler::instance()->mailToMultipleContacts( QString::null, urls.join(", ") ); /*US -- cgit v0.9.0.2