summaryrefslogtreecommitdiffabout
path: root/kmicromail/opiemail.cpp
Unidiff
Diffstat (limited to 'kmicromail/opiemail.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/opiemail.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp
index 3e560c5..a1c5645 100644
--- a/kmicromail/opiemail.cpp
+++ b/kmicromail/opiemail.cpp
@@ -6,16 +6,17 @@
6#include "editaccounts.h" 6#include "editaccounts.h"
7#include "composemail.h" 7#include "composemail.h"
8#include "mailistviewitem.h" 8#include "mailistviewitem.h"
9#include "viewmail.h" 9#include "viewmail.h"
10#include "selectstore.h" 10#include "selectstore.h"
11#include "selectsmtp.h" 11#include "selectsmtp.h"
12 12
13#include <qmessagebox.h> 13#include <qmessagebox.h>
14#include <libkdepim/externalapphandler.h>
14 15
15#include <qpe/qpeapplication.h> 16#include <qpe/qpeapplication.h>
16#include <libmailwrapper/smtpwrapper.h> 17#include <libmailwrapper/smtpwrapper.h>
17#include <libmailwrapper/mailtypes.h> 18#include <libmailwrapper/mailtypes.h>
18#include <libmailwrapper/abstractmail.h> 19#include <libmailwrapper/abstractmail.h>
19/* OPIE */ 20/* OPIE */
20//#include <qpe/resource.h> 21//#include <qpe/resource.h>
21//#include <qpe/qpeapplication.h> 22//#include <qpe/qpeapplication.h>
@@ -42,25 +43,26 @@ void OpieMail::appMessage(const QCString &msg, const QByteArray &data)
42{ 43{
43 44
44} 45}
45#include <stdlib.h> 46#include <stdlib.h>
46void OpieMail::message(const QCString &msg, const QByteArray &data) 47void OpieMail::message(const QCString &msg, const QByteArray &data)
47{ 48{
48 // copied from old mail2 49 // copied from old mail2
49 static int ii = 0; 50 static int ii = 0;
50 51 qDebug("call ############################# %d ", ii);
51 // block second call 52 // block second call
52 if ( ii < 2 ) { 53 if ( ii < 2 ) {
53 ++ii; 54 //++ii;
54 if ( ii > 1 ) { 55 if ( ii > 1 ) {
55 qDebug("qcop call blocked "); 56 qDebug("qcop call blocked ");
56 return; 57 //return;
57 } 58 }
58 } 59 }
60 ++ii;
59 //qDebug("KM:appMessage %d *%s* %x", ii, msg.data(), this); 61 //qDebug("KM:appMessage %d *%s* %x", ii, msg.data(), this);
60 if (msg == "writeMail(QString,QString)") 62 if (msg == "writeMail(QString,QString)")
61 { 63 {
62 QDataStream stream(data,IO_ReadOnly); 64 QDataStream stream(data,IO_ReadOnly);
63 QString name, email; 65 QString name, email;
64 stream >> name >> email; 66 stream >> name >> email;
65 // removing the whitespaces at beginning and end is needed! 67 // removing the whitespaces at beginning and end is needed!
66 slotwriteMail(name.stripWhiteSpace(),email.stripWhiteSpace()); 68 slotwriteMail(name.stripWhiteSpace(),email.stripWhiteSpace());
@@ -74,17 +76,18 @@ void OpieMail::message(const QCString &msg, const QByteArray &data)
74 QDataStream stream(data,IO_ReadOnly); 76 QDataStream stream(data,IO_ReadOnly);
75 QString nameemail; 77 QString nameemail;
76 stream >> nameemail; 78 stream >> nameemail;
77 // the format is 79 // the format is
78 // NAME <EMAIL>:SUBJECT 80 // NAME <EMAIL>:SUBJECT
79 //qDebug("message %s ", nameemail.latin1()); 81 //qDebug("message %s ", nameemail.latin1());
80 82
81 slotwriteMail2( nameemail ); 83 slotwriteMail2( nameemail );
82 } 84 } else
85 ExternalAppHandler::instance()->appMessage ( msg, data);
83} 86}
84void OpieMail::slotwriteMail2(const QString& namemail ) 87void OpieMail::slotwriteMail2(const QString& namemail )
85{ 88{
86 // qDebug("OpieMail::slotwriteMail2 "); 89 // qDebug("OpieMail::slotwriteMail2 ");
87 qApp->processEvents(); 90 qApp->processEvents();
88 ComposeMail compose( settings, this, 0, true ); 91 ComposeMail compose( settings, this, 0, true );
89 if ( !namemail.isEmpty() ) { 92 if ( !namemail.isEmpty() ) {
90 QString to = namemail; 93 QString to = namemail;