-rw-r--r-- | noncore/net/mail/opiemail.cpp | 21 | ||||
-rw-r--r-- | noncore/net/mail/opiemail.h | 1 |
2 files changed, 17 insertions, 5 deletions
diff --git a/noncore/net/mail/opiemail.cpp b/noncore/net/mail/opiemail.cpp index 0dede90..2909893 100644 --- a/noncore/net/mail/opiemail.cpp +++ b/noncore/net/mail/opiemail.cpp | |||
@@ -31,11 +31,10 @@ void OpieMail::appMessage(const QCString &msg, const QByteArray &data) | |||
31 | { | 31 | { |
32 | // copied from old mail2 | 32 | // copied from old mail2 |
33 | // TODO: compose mail should get parameters of a recipient for starting | ||
34 | // from addressbook. (qcop signal "writeMail(string,string)") | ||
35 | if (msg == "writeMail(QString,QString)") { | 33 | if (msg == "writeMail(QString,QString)") { |
36 | QDataStream stream(data,IO_ReadOnly); | 34 | QDataStream stream(data,IO_ReadOnly); |
37 | QString name, email; | 35 | QString name, email; |
38 | stream >> name >> email; | 36 | stream >> name >> email; |
39 | slotComposeMail(); | 37 | // removing the whitespaces at beginning and end is needed! |
38 | slotwriteMail(name.stripWhiteSpace(),email.stripWhiteSpace()); | ||
40 | } else if (msg == "newMail()") { | 39 | } else if (msg == "newMail()") { |
41 | slotComposeMail(); | 40 | slotComposeMail(); |
@@ -43,8 +42,14 @@ void OpieMail::appMessage(const QCString &msg, const QByteArray &data) | |||
43 | } | 42 | } |
44 | 43 | ||
45 | void OpieMail::slotComposeMail() | 44 | void OpieMail::slotwriteMail(const QString&name,const QString&email) |
46 | { | 45 | { |
47 | qDebug( "Compose Mail" ); | ||
48 | ComposeMail compose( settings, this, 0 , true ); | 46 | ComposeMail compose( settings, this, 0 , true ); |
47 | if (!email.isEmpty()) { | ||
48 | if (!name.isEmpty()) { | ||
49 | compose.setTo("\"" + name + "\"" + " " + "<"+ email + ">"); | ||
50 | } else { | ||
51 | compose.setTo(email); | ||
52 | } | ||
53 | } | ||
49 | compose.showMaximized(); | 54 | compose.showMaximized(); |
50 | compose.slotAdjustColumns(); | 55 | compose.slotAdjustColumns(); |
@@ -52,4 +57,10 @@ void OpieMail::slotComposeMail() | |||
52 | } | 57 | } |
53 | 58 | ||
59 | void OpieMail::slotComposeMail() | ||
60 | { | ||
61 | qDebug( "Compose Mail" ); | ||
62 | slotwriteMail(0l,0l); | ||
63 | } | ||
64 | |||
54 | void OpieMail::slotSendQueued() | 65 | void OpieMail::slotSendQueued() |
55 | { | 66 | { |
diff --git a/noncore/net/mail/opiemail.h b/noncore/net/mail/opiemail.h index 3cf5972..8cbcaa4 100644 --- a/noncore/net/mail/opiemail.h +++ b/noncore/net/mail/opiemail.h | |||
@@ -14,4 +14,5 @@ public: | |||
14 | 14 | ||
15 | public slots: | 15 | public slots: |
16 | void slotwriteMail(const QString&name,const QString&email); | ||
16 | void slotComposeMail(); | 17 | void slotComposeMail(); |
17 | void appMessage(const QCString &msg, const QByteArray &data); | 18 | void appMessage(const QCString &msg, const QByteArray &data); |