summaryrefslogtreecommitdiffabout
authorulf69 <ulf69>2004-08-10 22:46:12 (UTC)
committer ulf69 <ulf69>2004-08-10 22:46:12 (UTC)
commit02d51ae409a353d3a79e976c26ccc1f652e55de8 (patch) (side-by-side diff)
tree54d7a9f1eecd2ef9c3332f2bc22ff6ac6d9af335
parentdc81e96e29f619c6eb32c3ed18ff45b789c8504e (diff)
downloadkdepimpi-02d51ae409a353d3a79e976c26ccc1f652e55de8.zip
kdepimpi-02d51ae409a353d3a79e976c26ccc1f652e55de8.tar.gz
kdepimpi-02d51ae409a353d3a79e976c26ccc1f652e55de8.tar.bz2
final changes on how to send emails to selected contacts
Diffstat (more/less context) (show 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
@@ -467,5 +467,9 @@ void KABCore::sendMail()
-void KABCore::sendMail( const QString& email )
+void KABCore::sendMail( const QString& emaillist )
{
- bool result = ExternalAppHandler::instance()->mailToContacts(email);
+ // the parameter has the form "name1 <abc@aol.com>,name2 <abc@aol.com>;... "
+ if (emaillist.contains(",") > 0)
+ ExternalAppHandler::instance()->mailToMultipleContacts( emaillist, QString::null );
+ else
+ ExternalAppHandler::instance()->mailToOneContact( emaillist );
}
@@ -485,16 +489,5 @@ void KABCore::mailVCard( const QStringList& uids )
- 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 );
@@ -515,2 +508,3 @@ void KABCore::mailVCard( const QStringList& uids )
QFile outFile(fileName);
+
if ( outFile.open(IO_WriteOnly) ) { // file opened successfully
@@ -531,3 +525,3 @@ void KABCore::mailVCard( const QStringList& uids )
- bool result = ExternalAppHandler::instance()->mailAttachments(urls.join(", "));
+ bool result = ExternalAppHandler::instance()->mailToMultipleContacts( QString::null, urls.join(", ") );