summaryrefslogtreecommitdiffabout
path: root/kaddressbook/kabcore.cpp
Unidiff
Diffstat (limited to 'kaddressbook/kabcore.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp94
1 files changed, 63 insertions, 31 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index a7ca0ce..2a54900 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -80,4 +80,10 @@
80 80
81//US#include <qpe/resource.h> // needed for Resource::loadPixmap
82//#include <qlabel.h> 81//#include <qlabel.h>
82
83
84#ifdef Q_WS_QWS
85#include <qtopia/services.h>
86#include <qtopia/qcopenvelope_qws.h>
87#endif
88
83#endif // KAB_EMBEDDED 89#endif // KAB_EMBEDDED
@@ -93,2 +99,5 @@
93//US#include <qsplitter.h> 99//US#include <qsplitter.h>
100#include <qmap.h>
101#include <qdir.h>
102#include <qfile.h>
94#include <qvbox.h> 103#include <qvbox.h>
@@ -96,4 +105,7 @@
96#include <qclipboard.h> 105#include <qclipboard.h>
106#include <qtextstream.h>
97 107
98#include <libkdepim/categoryselectdialog.h> 108#include <libkdepim/categoryselectdialog.h>
109#include <kabc/vcardconverter.h>
110
99 111
@@ -131,6 +143,3 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const
131{ 143{
132#ifdef KAB_EMBEDDED 144
133 //US we define here our own global actioncollection.
134 //mActionCollection = new KActionCollection(this);
135#endif //KAB_EMBEDDED
136 mExtensionBarSplitter = 0; 145 mExtensionBarSplitter = 0;
@@ -198,2 +207,5 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const
198 207
208 connect( mDetails, SIGNAL( sendEmail( const QString& ) ),
209 SLOT( sendMail( const QString& ) ) );
210
199#ifndef KAB_EMBEDDED 211#ifndef KAB_EMBEDDED
@@ -202,4 +214,2 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const
202 214
203 connect( mDetails, SIGNAL( sendEmail( const QString& ) ),
204 SLOT( sendMail( const QString& ) ) );
205 connect( mDetails, SIGNAL( browse( const QString& ) ), 215 connect( mDetails, SIGNAL( browse( const QString& ) ),
@@ -223,8 +233,2 @@ KABCore::~KABCore()
223 KABC::StdAddressBook::close(); 233 KABC::StdAddressBook::close();
224
225#ifdef KAB_EMBEDDED
226 //US we define here our own global actioncollection.
227 // delete mActionCollection;
228#endif //KAB_EMBEDDED
229
230} 234}
@@ -453,7 +457,3 @@ void KABCore::sendMail()
453{ 457{
454#ifndef KAB_EMBEDDED
455 sendMail( mViewManager->selectedEmails().join( ", " ) ); 458 sendMail( mViewManager->selectedEmails().join( ", " ) );
456#else //KAB_EMBEDDED
457 qDebug("KABCore::sendMail() ust be fixed");
458#endif //KAB_EMBEDDED
459} 459}
@@ -462,7 +462,25 @@ void KABCore::sendMail( const QString& email )
462{ 462{
463#ifndef KAB_EMBEDDED 463//US original kde implementation : kapp->invokeMailer( email, "" );
464 kapp->invokeMailer( email, "" ); 464
465#else //KAB_EMBEDDED 465/*US original qtopia implementation
466 qDebug("KABCore::sendMail(const QString& email) ust be fixed"); 466 PimContact c = abList->currentEntry();
467#endif //KAB_EMBEDDED 467 QString name = c.fileAs();
468 QString email = c.defaultEmail();
469#ifndef QT_NO_COP
470 QCopEnvelope e(Service::channel("Email"), "writeMail(QString,QString)");
471 e << name << email;
472#else
473*/
474
475
476#ifndef QT_NO_COP
477 QCString channel = KABPrefs::instance()->mEmailChannel.latin1();
478 qDebug("Using QCopEnvelope e(\"" + channel + "\", \"writeMail(QMap(QString,QString))\")");
479
480 QCopEnvelope e(channel, "writeMail(QString,QString)");
481 //US we need no names in the To field. The emailadresses are enough
482 e << "" << email;
483#else
484 KMessageBox::sorry( this, i18n( "This version does not support sending emails." ) );
485#endif
468} 486}
@@ -471,3 +489,2 @@ void KABCore::mailVCard()
471{ 489{
472#ifndef KAB_EMBEDDED
473 QStringList uids = mViewManager->selectedUids(); 490 QStringList uids = mViewManager->selectedUids();
@@ -475,5 +492,2 @@ void KABCore::mailVCard()
475 mailVCard( uids ); 492 mailVCard( uids );
476#else //KAB_EMBEDDED
477 qDebug("KABCore::mailVCard() must be fixed");
478#endif //KAB_EMBEDDED
479} 493}
@@ -482,5 +496,7 @@ void KABCore::mailVCard( const QStringList& uids )
482{ 496{
483#ifndef KAB_EMBEDDED
484 QStringList urls; 497 QStringList urls;
485 498
499 QString tmpdir = locateLocal("tmp", KGlobal::getAppName());
500
501/*US
486 // Create a temp dir, so that we can put the files in it with proper names 502 // Create a temp dir, so that we can put the files in it with proper names
@@ -494,2 +510,7 @@ void KABCore::mailVCard( const QStringList& uids )
494 tempDir.unlink(); 510 tempDir.unlink();
511*/
512 QString dirName = tmpdir + "/" + KApplication::randomString( 8 );
513
514
515
495 QDir().mkdir( dirName, true ); 516 QDir().mkdir( dirName, true );
@@ -522,3 +543,3 @@ void KABCore::mailVCard( const QStringList& uids )
522 } 543 }
523 544/*US
524 kapp->invokeMailer( QString::null, QString::null, QString::null, 545 kapp->invokeMailer( QString::null, QString::null, QString::null,
@@ -528,5 +549,16 @@ void KABCore::mailVCard( const QStringList& uids )
528 urls ); // attachments 549 urls ); // attachments
529#else //KAB_EMBEDDED 550*/
530 qDebug("KABCore::mailVCard( must be fixed"); 551#ifndef QT_NO_COP
531#endif //KAB_EMBEDDED 552 QCString channel = KABPrefs::instance()->mEmailChannel.latin1();
553 qDebug("Using QCopEnvelope e(\"" + channel + "\", \"writeMail(QMap(QString,QString))\")");
554
555 QMap<QString, QString> parameterMap;
556 parameterMap.insert("ATTACHMENT<n>", urls.join(", "));
557
558 QCopEnvelope e(channel, "writeMail(QMap(QString,QString))");
559 e << parameterMap;
560#else
561 KMessageBox::sorry( this, i18n( "This version does not support sending emails." ) );
562#endif
563
532 564