summaryrefslogtreecommitdiff
path: root/noncore/net/mail/composemail.cpp
Unidiff
Diffstat (limited to 'noncore/net/mail/composemail.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/mail/composemail.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/noncore/net/mail/composemail.cpp b/noncore/net/mail/composemail.cpp
index f8ac76f..b5cd75b 100644
--- a/noncore/net/mail/composemail.cpp
+++ b/noncore/net/mail/composemail.cpp
@@ -5,24 +5,25 @@
5#include <qpe/config.h> 5#include <qpe/config.h>
6#include <qpe/global.h> 6#include <qpe/global.h>
7#include <qpe/contact.h> 7#include <qpe/contact.h>
8 8
9#include "composemail.h" 9#include "composemail.h"
10 10
11#include <libmailwrapper/smtpwrapper.h> 11#include <libmailwrapper/smtpwrapper.h>
12 12
13ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags ) 13ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool modal, WFlags flags )
14 : ComposeMailUI( parent, name, modal, flags ) 14 : ComposeMailUI( parent, name, modal, flags )
15{ 15{
16 settings = s; 16 settings = s;
17 m_replyid = "";
17 18
18 QString vfilename = Global::applicationFileName("addressbook", 19 QString vfilename = Global::applicationFileName("addressbook",
19 "businesscard.vcf"); 20 "businesscard.vcf");
20 Contact c; 21 Contact c;
21 if (QFile::exists(vfilename)) { 22 if (QFile::exists(vfilename)) {
22 c = Contact::readVCard( vfilename )[0]; 23 c = Contact::readVCard( vfilename )[0];
23 } 24 }
24 25
25 QStringList mails = c.emailList(); 26 QStringList mails = c.emailList();
26 QString defmail = c.defaultEmail(); 27 QString defmail = c.defaultEmail();
27 28
28 if (defmail.length()!=0) { 29 if (defmail.length()!=0) {
@@ -75,42 +76,35 @@ void ComposeMail::pickAddress( QLineEdit *line )
75{ 76{
76 QString names = AddressPicker::getNames(); 77 QString names = AddressPicker::getNames();
77 if ( line->text().isEmpty() ) { 78 if ( line->text().isEmpty() ) {
78 line->setText( names ); 79 line->setText( names );
79 } else if ( !names.isEmpty() ) { 80 } else if ( !names.isEmpty() ) {
80 line->setText( line->text() + ", " + names ); 81 line->setText( line->text() + ", " + names );
81 } 82 }
82} 83}
83 84
84 85
85void ComposeMail::setTo( const QString & to ) 86void ComposeMail::setTo( const QString & to )
86{ 87{
87/* QString toline;
88 QStringList toEntry = to;
89 for ( QStringList::Iterator it = toEntry.begin(); it != toEntry.end(); ++it ) {
90 toline += (*it);
91 }
92 toLine->setText( toline );
93*/
94toLine->setText( to ); 88toLine->setText( to );
95} 89}
96 90
97void ComposeMail::setSubject( const QString & subject ) 91void ComposeMail::setSubject( const QString & subject )
98{ 92{
99 subjectLine->setText( subject ); 93 subjectLine->setText( subject );
100} 94}
101 95
102void ComposeMail::setInReplyTo( const QString & messageId ) 96void ComposeMail::setInReplyTo( const QString & messageId )
103{ 97{
104 98 m_replyid = messageId;
105} 99}
106 100
107void ComposeMail::setMessage( const QString & text ) 101void ComposeMail::setMessage( const QString & text )
108{ 102{
109 message->setText( text ); 103 message->setText( text );
110} 104}
111 105
112 106
113void ComposeMail::pickAddressTo() 107void ComposeMail::pickAddressTo()
114{ 108{
115 pickAddress( toLine ); 109 pickAddress( toLine );
116} 110}
@@ -198,24 +192,29 @@ void ComposeMail::accept()
198 192
199 if ( !toLine->text().isEmpty() ) { 193 if ( !toLine->text().isEmpty() ) {
200 mail->setTo( toLine->text() ); 194 mail->setTo( toLine->text() );
201 } else { 195 } else {
202 qDebug( "No Reciever spezified -> returning" ); 196 qDebug( "No Reciever spezified -> returning" );
203 return; 197 return;
204 } 198 }
205 mail->setName(senderNameEdit->text()); 199 mail->setName(senderNameEdit->text());
206 mail->setCC( ccLine->text() ); 200 mail->setCC( ccLine->text() );
207 mail->setBCC( bccLine->text() ); 201 mail->setBCC( bccLine->text() );
208 mail->setReply( replyLine->text() ); 202 mail->setReply( replyLine->text() );
209 mail->setSubject( subjectLine->text() ); 203 mail->setSubject( subjectLine->text() );
204 if (!m_replyid.isEmpty()) {
205 QStringList ids;
206 ids.append(m_replyid);
207 mail->setInreply(ids);
208 }
210 QString txt = message->text(); 209 QString txt = message->text();
211 if ( !sigMultiLine->text().isEmpty() ) { 210 if ( !sigMultiLine->text().isEmpty() ) {
212 txt.append( "\n--\n" ); 211 txt.append( "\n--\n" );
213 txt.append( sigMultiLine->text() ); 212 txt.append( sigMultiLine->text() );
214 } 213 }
215 qDebug(txt); 214 qDebug(txt);
216 mail->setMessage( txt ); 215 mail->setMessage( txt );
217 AttachViewItem *it = (AttachViewItem *) attList->firstChild(); 216 AttachViewItem *it = (AttachViewItem *) attList->firstChild();
218 while ( it != NULL ) { 217 while ( it != NULL ) {
219 mail->addAttachment( it->getAttachment() ); 218 mail->addAttachment( it->getAttachment() );
220 it = (AttachViewItem *) it->nextSibling(); 219 it = (AttachViewItem *) it->nextSibling();
221 } 220 }