author | alwin <alwin> | 2003-12-28 17:32:43 (UTC) |
---|---|---|
committer | alwin <alwin> | 2003-12-28 17:32:43 (UTC) |
commit | 696a2dcfcb65fbb24b709bbae0a18a7854e2d72c (patch) (unidiff) | |
tree | e813c9508881796cf999e9c25c05e4482c6fd9e8 /noncore/net | |
parent | b900cad9c050c2d5963228a2191e13053457ef1d (diff) | |
download | opie-696a2dcfcb65fbb24b709bbae0a18a7854e2d72c.zip opie-696a2dcfcb65fbb24b709bbae0a18a7854e2d72c.tar.gz opie-696a2dcfcb65fbb24b709bbae0a18a7854e2d72c.tar.bz2 |
reduced to the max...
- from address isn't setup any longer within the smtp account (it makes realy no
sense, a smtp account describes the connection to a smtp server, not the
identity of the sender)
- from address is taken from the personal info of the addressbook (thats why this
info exists). Of course the user can change it when sending an email.
- user can select a from with a selection of the mails given in their personal
infos.
- in addresspicker: use "<Firstname> <Lastname>" instead of "Filename"
- settings ui: switched of the part within the smtp accounts describing the
identitiy of user
ToDo: a dialog setting up a default signature
-rw-r--r-- | noncore/net/mail/addresspicker.cpp | 2 | ||||
-rw-r--r-- | noncore/net/mail/composemail.cpp | 48 | ||||
-rw-r--r-- | noncore/net/mail/composemailui.ui | 186 | ||||
-rw-r--r-- | noncore/net/mail/editaccounts.cpp | 23 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/settings.cpp | 25 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/settings.h | 20 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/smtpwrapper.cpp | 54 | ||||
-rw-r--r-- | noncore/net/mail/libmailwrapper/smtpwrapper.h | 3 | ||||
-rw-r--r-- | noncore/net/mail/settings.cpp | 25 | ||||
-rw-r--r-- | noncore/net/mail/settings.h | 20 | ||||
-rw-r--r-- | noncore/net/mail/smtpconfigui.ui | 401 | ||||
-rw-r--r-- | noncore/net/mail/smtpwrapper.cpp | 54 | ||||
-rw-r--r-- | noncore/net/mail/smtpwrapper.h | 3 |
13 files changed, 322 insertions, 542 deletions
diff --git a/noncore/net/mail/addresspicker.cpp b/noncore/net/mail/addresspicker.cpp index 581de62..7857870 100644 --- a/noncore/net/mail/addresspicker.cpp +++ b/noncore/net/mail/addresspicker.cpp | |||
@@ -35,3 +35,3 @@ AddressPicker::AddressPicker( QWidget *parent, const char *name, bool modal, WFl | |||
35 | if ((*it).fileAs().length()>0) { | 35 | if ((*it).fileAs().length()>0) { |
36 | pre = "\""+(*it).fileAs()+"\" <"; | 36 | pre = "\""+(*it).firstName()+" "+(*it).lastName()+"\" <"; |
37 | suf = ">"; | 37 | suf = ">"; |
diff --git a/noncore/net/mail/composemail.cpp b/noncore/net/mail/composemail.cpp index 73d1a43..13c7900 100644 --- a/noncore/net/mail/composemail.cpp +++ b/noncore/net/mail/composemail.cpp | |||
@@ -5,2 +5,4 @@ | |||
5 | #include <qpe/config.h> | 5 | #include <qpe/config.h> |
6 | #include <qpe/global.h> | ||
7 | #include <qpe/contact.h> | ||
6 | 8 | ||
@@ -14,2 +16,22 @@ ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool m | |||
14 | 16 | ||
17 | QString vfilename = Global::applicationFileName("addressbook", | ||
18 | "businesscard.vcf"); | ||
19 | Contact c; | ||
20 | if (QFile::exists(vfilename)) { | ||
21 | c = Contact::readVCard( vfilename )[0]; | ||
22 | } | ||
23 | |||
24 | QStringList mails = c.emailList(); | ||
25 | QString defmail = c.defaultEmail(); | ||
26 | |||
27 | if (defmail.length()!=0) { | ||
28 | fromBox->insertItem(defmail); | ||
29 | } | ||
30 | QStringList::ConstIterator sit = mails.begin(); | ||
31 | for (;sit!=mails.end();++sit) { | ||
32 | if ( (*sit)==defmail) | ||
33 | continue; | ||
34 | fromBox->insertItem((*sit)); | ||
35 | } | ||
36 | senderNameEdit->setText(c.firstName()+" "+c.lastName()); | ||
15 | Config cfg( "mail" ); | 37 | Config cfg( "mail" ); |
@@ -22,2 +44,3 @@ ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool m | |||
22 | QList<Account> accounts = settings->getAccounts(); | 44 | QList<Account> accounts = settings->getAccounts(); |
45 | |||
23 | Account *it; | 46 | Account *it; |
@@ -26,3 +49,3 @@ ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool m | |||
26 | SMTPaccount *smtp = static_cast<SMTPaccount *>(it); | 49 | SMTPaccount *smtp = static_cast<SMTPaccount *>(it); |
27 | fromBox->insertItem( smtp->getMail() ); | 50 | smtpAccountBox->insertItem( smtp->getAccountName() ); |
28 | smtpAccounts.append( smtp ); | 51 | smtpAccounts.append( smtp ); |
@@ -32,3 +55,3 @@ ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool m | |||
32 | if ( smtpAccounts.count() > 0 ) { | 55 | if ( smtpAccounts.count() > 0 ) { |
33 | fillValues( fromBox->currentItem() ); | 56 | fillValues( smtpAccountBox->currentItem() ); |
34 | } else { | 57 | } else { |
@@ -40,3 +63,3 @@ ComposeMail::ComposeMail( Settings *s, QWidget *parent, const char *name, bool m | |||
40 | 63 | ||
41 | connect( fromBox, SIGNAL( activated( int ) ), SLOT( fillValues( int ) ) ); | 64 | connect( smtpAccountBox, SIGNAL( activated( int ) ), SLOT( fillValues( int ) ) ); |
42 | connect( toButton, SIGNAL( clicked() ), SLOT( pickAddressTo() ) ); | 65 | connect( toButton, SIGNAL( clicked() ), SLOT( pickAddressTo() ) ); |
@@ -110,4 +133,4 @@ void ComposeMail::fillValues( int current ) | |||
110 | { | 133 | { |
134 | #if 0 | ||
111 | SMTPaccount *smtp = smtpAccounts.at( current ); | 135 | SMTPaccount *smtp = smtpAccounts.at( current ); |
112 | |||
113 | ccLine->clear(); | 136 | ccLine->clear(); |
@@ -124,4 +147,4 @@ void ComposeMail::fillValues( int current ) | |||
124 | } | 147 | } |
125 | |||
126 | sigMultiLine->setText( smtp->getSignature() ); | 148 | sigMultiLine->setText( smtp->getSignature() ); |
149 | #endif | ||
127 | } | 150 | } |
@@ -165,10 +188,10 @@ void ComposeMail::accept() | |||
165 | 188 | ||
166 | 189 | #if 0 | |
167 | qDebug( "Sending Mail with " + | 190 | qDebug( "Sending Mail with " + |
168 | smtpAccounts.at( fromBox->currentItem() )->getAccountName() ); | 191 | smtpAccounts.at( smtpAccountBox->currentItem() )->getAccountName() ); |
192 | #endif | ||
169 | Mail *mail = new Mail(); | 193 | Mail *mail = new Mail(); |
170 | SMTPaccount *smtp = smtpAccounts.at( fromBox->currentItem() ); | ||
171 | 194 | ||
172 | mail->setMail( smtp->getMail() ); | 195 | SMTPaccount *smtp = smtpAccounts.at( smtpAccountBox->currentItem() ); |
173 | mail->setName( smtp->getName() ); | 196 | mail->setMail(fromBox->currentText()); |
174 | 197 | ||
@@ -180,3 +203,3 @@ void ComposeMail::accept() | |||
180 | } | 203 | } |
181 | 204 | mail->setName(senderNameEdit->text()); | |
182 | mail->setCC( ccLine->text() ); | 205 | mail->setCC( ccLine->text() ); |
@@ -190,2 +213,3 @@ void ComposeMail::accept() | |||
190 | } | 213 | } |
214 | qDebug(txt); | ||
191 | mail->setMessage( txt ); | 215 | mail->setMessage( txt ); |
@@ -198,3 +222,3 @@ void ComposeMail::accept() | |||
198 | SMTPwrapper wrapper( settings ); | 222 | SMTPwrapper wrapper( settings ); |
199 | wrapper.sendMail( *mail,checkBoxLater->isChecked() ); | 223 | wrapper.sendMail( *mail,smtp,checkBoxLater->isChecked() ); |
200 | 224 | ||
diff --git a/noncore/net/mail/composemailui.ui b/noncore/net/mail/composemailui.ui index 4d225e4..aebdf67 100644 --- a/noncore/net/mail/composemailui.ui +++ b/noncore/net/mail/composemailui.ui | |||
@@ -13,3 +13,3 @@ | |||
13 | <y>0</y> | 13 | <y>0</y> |
14 | <width>260</width> | 14 | <width>252</width> |
15 | <height>360</height> | 15 | <height>360</height> |
@@ -30,3 +30,3 @@ | |||
30 | <name>margin</name> | 30 | <name>margin</name> |
31 | <number>3</number> | 31 | <number>1</number> |
32 | </property> | 32 | </property> |
@@ -34,5 +34,23 @@ | |||
34 | <name>spacing</name> | 34 | <name>spacing</name> |
35 | <number>3</number> | 35 | <number>1</number> |
36 | </property> | 36 | </property> |
37 | <widget> | 37 | <widget> |
38 | <class>QLayoutWidget</class> | ||
39 | <property stdset="1"> | ||
40 | <name>name</name> | ||
41 | <cstring>Layout4</cstring> | ||
42 | </property> | ||
43 | <property> | ||
44 | <name>layoutSpacing</name> | ||
45 | </property> | ||
46 | <grid> | ||
47 | <property stdset="1"> | ||
48 | <name>margin</name> | ||
49 | <number>0</number> | ||
50 | </property> | ||
51 | <property stdset="1"> | ||
52 | <name>spacing</name> | ||
53 | <number>3</number> | ||
54 | </property> | ||
55 | <widget row="0" column="0" > | ||
38 | <class>QCheckBox</class> | 56 | <class>QCheckBox</class> |
@@ -47,2 +65,29 @@ | |||
47 | </widget> | 65 | </widget> |
66 | <widget row="0" column="1" > | ||
67 | <class>QLabel</class> | ||
68 | <property stdset="1"> | ||
69 | <name>name</name> | ||
70 | <cstring>accountLabel</cstring> | ||
71 | </property> | ||
72 | <property stdset="1"> | ||
73 | <name>text</name> | ||
74 | <string>use:</string> | ||
75 | </property> | ||
76 | </widget> | ||
77 | <widget row="0" column="2" > | ||
78 | <class>QComboBox</class> | ||
79 | <property stdset="1"> | ||
80 | <name>name</name> | ||
81 | <cstring>smtpAccountBox</cstring> | ||
82 | </property> | ||
83 | <property stdset="1"> | ||
84 | <name>sizePolicy</name> | ||
85 | <sizepolicy> | ||
86 | <hsizetype>3</hsizetype> | ||
87 | <vsizetype>0</vsizetype> | ||
88 | </sizepolicy> | ||
89 | </property> | ||
90 | </widget> | ||
91 | </grid> | ||
92 | </widget> | ||
48 | <widget> | 93 | <widget> |
@@ -69,2 +114,38 @@ | |||
69 | </attribute> | 114 | </attribute> |
115 | <vbox> | ||
116 | <property stdset="1"> | ||
117 | <name>margin</name> | ||
118 | <number>1</number> | ||
119 | </property> | ||
120 | <property stdset="1"> | ||
121 | <name>spacing</name> | ||
122 | <number>1</number> | ||
123 | </property> | ||
124 | <widget> | ||
125 | <class>QLayoutWidget</class> | ||
126 | <property stdset="1"> | ||
127 | <name>name</name> | ||
128 | <cstring>Layout10</cstring> | ||
129 | </property> | ||
130 | <property> | ||
131 | <name>layoutSpacing</name> | ||
132 | </property> | ||
133 | <grid> | ||
134 | <property stdset="1"> | ||
135 | <name>margin</name> | ||
136 | <number>0</number> | ||
137 | </property> | ||
138 | <property stdset="1"> | ||
139 | <name>spacing</name> | ||
140 | <number>1</number> | ||
141 | </property> | ||
142 | <widget row="0" column="1" > | ||
143 | <class>QLayoutWidget</class> | ||
144 | <property stdset="1"> | ||
145 | <name>name</name> | ||
146 | <cstring>Layout9</cstring> | ||
147 | </property> | ||
148 | <property> | ||
149 | <name>layoutSpacing</name> | ||
150 | </property> | ||
70 | <grid> | 151 | <grid> |
@@ -72,3 +153,3 @@ | |||
72 | <name>margin</name> | 153 | <name>margin</name> |
73 | <number>-1</number> | 154 | <number>0</number> |
74 | </property> | 155 | </property> |
@@ -76,4 +157,56 @@ | |||
76 | <name>spacing</name> | 157 | <name>spacing</name> |
77 | <number>-1</number> | 158 | <number>3</number> |
78 | </property> | 159 | </property> |
160 | <widget row="0" column="1" > | ||
161 | <class>QComboBox</class> | ||
162 | <property stdset="1"> | ||
163 | <name>name</name> | ||
164 | <cstring>fromBox</cstring> | ||
165 | </property> | ||
166 | <property stdset="1"> | ||
167 | <name>sizePolicy</name> | ||
168 | <sizepolicy> | ||
169 | <hsizetype>3</hsizetype> | ||
170 | <vsizetype>0</vsizetype> | ||
171 | </sizepolicy> | ||
172 | </property> | ||
173 | <property stdset="1"> | ||
174 | <name>editable</name> | ||
175 | <bool>true</bool> | ||
176 | </property> | ||
177 | <property stdset="1"> | ||
178 | <name>duplicatesEnabled</name> | ||
179 | <bool>false</bool> | ||
180 | </property> | ||
181 | </widget> | ||
182 | <widget row="0" column="0" > | ||
183 | <class>QLineEdit</class> | ||
184 | <property stdset="1"> | ||
185 | <name>name</name> | ||
186 | <cstring>senderNameEdit</cstring> | ||
187 | </property> | ||
188 | <property stdset="1"> | ||
189 | <name>sizePolicy</name> | ||
190 | <sizepolicy> | ||
191 | <hsizetype>0</hsizetype> | ||
192 | <vsizetype>0</vsizetype> | ||
193 | </sizepolicy> | ||
194 | </property> | ||
195 | <property stdset="1"> | ||
196 | <name>minimumSize</name> | ||
197 | <size> | ||
198 | <width>70</width> | ||
199 | <height>0</height> | ||
200 | </size> | ||
201 | </property> | ||
202 | <property stdset="1"> | ||
203 | <name>maximumSize</name> | ||
204 | <size> | ||
205 | <width>70</width> | ||
206 | <height>32767</height> | ||
207 | </size> | ||
208 | </property> | ||
209 | </widget> | ||
210 | </grid> | ||
211 | </widget> | ||
79 | <widget row="2" column="1" > | 212 | <widget row="2" column="1" > |
@@ -84,8 +217,22 @@ | |||
84 | </property> | 217 | </property> |
218 | <property stdset="1"> | ||
219 | <name>sizePolicy</name> | ||
220 | <sizepolicy> | ||
221 | <hsizetype>3</hsizetype> | ||
222 | <vsizetype>0</vsizetype> | ||
223 | </sizepolicy> | ||
224 | </property> | ||
85 | </widget> | 225 | </widget> |
86 | <widget row="3" column="0" rowspan="1" colspan="2" > | 226 | <widget row="1" column="1" > |
87 | <class>QMultiLineEdit</class> | 227 | <class>QLineEdit</class> |
88 | <property stdset="1"> | 228 | <property stdset="1"> |
89 | <name>name</name> | 229 | <name>name</name> |
90 | <cstring>message</cstring> | 230 | <cstring>toLine</cstring> |
231 | </property> | ||
232 | <property stdset="1"> | ||
233 | <name>sizePolicy</name> | ||
234 | <sizepolicy> | ||
235 | <hsizetype>3</hsizetype> | ||
236 | <vsizetype>0</vsizetype> | ||
237 | </sizepolicy> | ||
91 | </property> | 238 | </property> |
@@ -114,16 +261,2 @@ | |||
114 | </widget> | 261 | </widget> |
115 | <widget row="1" column="1" > | ||
116 | <class>QLineEdit</class> | ||
117 | <property stdset="1"> | ||
118 | <name>name</name> | ||
119 | <cstring>toLine</cstring> | ||
120 | </property> | ||
121 | </widget> | ||
122 | <widget row="0" column="1" > | ||
123 | <class>QComboBox</class> | ||
124 | <property stdset="1"> | ||
125 | <name>name</name> | ||
126 | <cstring>fromBox</cstring> | ||
127 | </property> | ||
128 | </widget> | ||
129 | <widget row="1" column="0" > | 262 | <widget row="1" column="0" > |
@@ -142,2 +275,11 @@ | |||
142 | <widget> | 275 | <widget> |
276 | <class>QMultiLineEdit</class> | ||
277 | <property stdset="1"> | ||
278 | <name>name</name> | ||
279 | <cstring>message</cstring> | ||
280 | </property> | ||
281 | </widget> | ||
282 | </vbox> | ||
283 | </widget> | ||
284 | <widget> | ||
143 | <class>QWidget</class> | 285 | <class>QWidget</class> |
diff --git a/noncore/net/mail/editaccounts.cpp b/noncore/net/mail/editaccounts.cpp index 1246037..de36e0d 100644 --- a/noncore/net/mail/editaccounts.cpp +++ b/noncore/net/mail/editaccounts.cpp | |||
@@ -357,5 +357,2 @@ SMTPconfig::SMTPconfig( SMTPaccount *account, QWidget *parent, const char *name, | |||
357 | 357 | ||
358 | connect( ccBox, SIGNAL( toggled( bool ) ), ccLine, SLOT( setEnabled( bool ) ) ); | ||
359 | connect( bccBox, SIGNAL( toggled( bool ) ), bccLine, SLOT( setEnabled( bool ) ) ); | ||
360 | connect( replyBox, SIGNAL( toggled( bool ) ), replyLine, SLOT( setEnabled( bool ) ) ); | ||
361 | connect( loginBox, SIGNAL( toggled( bool ) ), userLine, SLOT( setEnabled( bool ) ) ); | 358 | connect( loginBox, SIGNAL( toggled( bool ) ), userLine, SLOT( setEnabled( bool ) ) ); |
@@ -386,12 +383,2 @@ void SMTPconfig::fillValues() | |||
386 | passLine->setText( data->getPassword() ); | 383 | passLine->setText( data->getPassword() ); |
387 | nameLine->setText( data->getName() ); | ||
388 | mailLine->setText( data->getMail() ); | ||
389 | orgLine->setText( data->getOrg() ); | ||
390 | ccBox->setChecked( data->getUseCC() ); | ||
391 | ccLine->setText( data->getCC() ); | ||
392 | bccBox->setChecked( data->getUseBCC() ); | ||
393 | bccLine->setText( data->getBCC() ); | ||
394 | replyBox->setChecked( data->getUseReply() ); | ||
395 | replyLine->setText( data->getReply() ); | ||
396 | sigMultiLine->setText( data->getSignature() ); | ||
397 | } | 384 | } |
@@ -407,12 +394,2 @@ void SMTPconfig::accept() | |||
407 | data->setPassword( passLine->text() ); | 394 | data->setPassword( passLine->text() ); |
408 | data->setName( nameLine->text() ); | ||
409 | data->setMail( mailLine->text() ); | ||
410 | data->setOrg( orgLine->text() ); | ||
411 | data->setCC( ccLine->text() ); | ||
412 | data->setUseCC( ccBox->isChecked() ); | ||
413 | data->setBCC( bccLine->text() ); | ||
414 | data->setUseBCC( bccBox->isChecked() ); | ||
415 | data->setReply( replyLine->text() ); | ||
416 | data->setUseReply( replyBox->isChecked() ); | ||
417 | data->setSignature( sigMultiLine->text() ); | ||
418 | 395 | ||
diff --git a/noncore/net/mail/libmailwrapper/settings.cpp b/noncore/net/mail/libmailwrapper/settings.cpp index b580954..17aa1b0 100644 --- a/noncore/net/mail/libmailwrapper/settings.cpp +++ b/noncore/net/mail/libmailwrapper/settings.cpp | |||
@@ -275,5 +275,2 @@ SMTPaccount::SMTPaccount( QString filename ) | |||
275 | login = false; | 275 | login = false; |
276 | useCC = false; | ||
277 | useBCC = false; | ||
278 | useReply = false; | ||
279 | type = "SMTP"; | 276 | type = "SMTP"; |
@@ -308,13 +305,2 @@ void SMTPaccount::read() | |||
308 | password = conf->readEntryCrypt( "Password" ); | 305 | password = conf->readEntryCrypt( "Password" ); |
309 | useCC = conf->readBoolEntry( "useCC" ); | ||
310 | useBCC = conf->readBoolEntry( "useBCC" ); | ||
311 | useReply = conf->readBoolEntry( "useReply" ); | ||
312 | name = conf->readEntry( "Name" ); | ||
313 | mail = conf->readEntry( "Mail" ); | ||
314 | org = conf->readEntry( "Org" ); | ||
315 | cc = conf->readEntry( "CC" ); | ||
316 | bcc = conf->readEntry( "BCC" ); | ||
317 | reply = conf->readEntry( "Reply" ); | ||
318 | signature = conf->readEntry( "Signature" ); | ||
319 | signature = signature.replace( QRegExp( "<br>" ), "\n" ); | ||
320 | } | 306 | } |
@@ -335,13 +321,2 @@ void SMTPaccount::save() | |||
335 | conf->writeEntryCrypt( "Password", password ); | 321 | conf->writeEntryCrypt( "Password", password ); |
336 | conf->writeEntry( "useCC", useCC ); | ||
337 | conf->writeEntry( "useBCC", useBCC ); | ||
338 | conf->writeEntry( "useReply", useReply ); | ||
339 | conf->writeEntry( "Name", name ); | ||
340 | conf->writeEntry( "Mail", mail ); | ||
341 | conf->writeEntry( "Org", org ); | ||
342 | conf->writeEntry( "CC", cc ); | ||
343 | conf->writeEntry( "BCC", bcc ); | ||
344 | conf->writeEntry( "Reply", reply ); | ||
345 | conf->writeEntry( "Signature", | ||
346 | signature.replace( QRegExp( "\\n" ), "<br>" ) ); | ||
347 | conf->write(); | 322 | conf->write(); |
diff --git a/noncore/net/mail/libmailwrapper/settings.h b/noncore/net/mail/libmailwrapper/settings.h index 22184a5..caa5dfc 100644 --- a/noncore/net/mail/libmailwrapper/settings.h +++ b/noncore/net/mail/libmailwrapper/settings.h | |||
@@ -95,22 +95,2 @@ public: | |||
95 | 95 | ||
96 | void setName( QString str ) { name = str; } | ||
97 | QString getName() { return name; } | ||
98 | void setMail( QString str ) { mail = str; } | ||
99 | QString getMail() { return mail; } | ||
100 | void setOrg( QString str ) { org = str; } | ||
101 | QString getOrg() { return org; } | ||
102 | void setUseCC( bool b ) { useCC = b; } | ||
103 | bool getUseCC() { return useCC; } | ||
104 | void setCC( QString str ) { cc = str; } | ||
105 | QString getCC() { return cc; } | ||
106 | void setUseBCC( bool b ) { useBCC = b; } | ||
107 | bool getUseBCC() { return useBCC; } | ||
108 | void setBCC( QString str ) { bcc = str; } | ||
109 | QString getBCC() { return bcc; } | ||
110 | void setUseReply( bool b ) { useReply = b; } | ||
111 | bool getUseReply() { return useReply; } | ||
112 | void setReply( QString str ) { reply = str; } | ||
113 | QString getReply() { return reply; } | ||
114 | void setSignature( QString str ) { signature = str; } | ||
115 | QString getSignature() { return signature; } | ||
116 | void setLogin( bool b ) { login = b; } | 96 | void setLogin( bool b ) { login = b; } |
diff --git a/noncore/net/mail/libmailwrapper/smtpwrapper.cpp b/noncore/net/mail/libmailwrapper/smtpwrapper.cpp index 521cd0a..30c0707 100644 --- a/noncore/net/mail/libmailwrapper/smtpwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/smtpwrapper.cpp | |||
@@ -130,5 +130,5 @@ mailimf_fields *SMTPwrapper::createImfFields(const Mail&mail ) | |||
130 | mailimf_field *xmailer; | 130 | mailimf_field *xmailer; |
131 | mailimf_mailbox *sender, *fromBox; | 131 | mailimf_mailbox *sender=0,*fromBox=0; |
132 | mailimf_mailbox_list *from; | 132 | mailimf_mailbox_list *from=0; |
133 | mailimf_address_list *to, *cc, *bcc, *reply; | 133 | mailimf_address_list *to=0, *cc=0, *bcc=0, *reply=0; |
134 | char *subject = strdup( mail.getSubject().latin1() ); | 134 | char *subject = strdup( mail.getSubject().latin1() ); |
@@ -169,12 +169,12 @@ mailimf_fields *SMTPwrapper::createImfFields(const Mail&mail ) | |||
169 | err_free_xmailer: | 169 | err_free_xmailer: |
170 | mailimf_field_free( xmailer ); | 170 | if (xmailer) mailimf_field_free( xmailer ); |
171 | err_free_fields: | 171 | err_free_fields: |
172 | mailimf_fields_free( fields ); | 172 | if (fields) mailimf_fields_free( fields ); |
173 | err_free_reply: | 173 | err_free_reply: |
174 | mailimf_address_list_free( reply ); | 174 | if (reply) mailimf_address_list_free( reply ); |
175 | mailimf_address_list_free( bcc ); | 175 | if (bcc) mailimf_address_list_free( bcc ); |
176 | mailimf_address_list_free( cc ); | 176 | if (cc) mailimf_address_list_free( cc ); |
177 | mailimf_address_list_free( to ); | 177 | if (to) mailimf_address_list_free( to ); |
178 | err_free_from: | 178 | err_free_from: |
179 | mailimf_mailbox_list_free( from ); | 179 | if (from) mailimf_mailbox_list_free( from ); |
180 | err_free_fromBox: | 180 | err_free_fromBox: |
@@ -182,5 +182,5 @@ err_free_fromBox: | |||
182 | err_free_sender: | 182 | err_free_sender: |
183 | mailimf_mailbox_free( sender ); | 183 | if (sender) mailimf_mailbox_free( sender ); |
184 | err_free: | 184 | err_free: |
185 | free( subject ); | 185 | if (subject) free( subject ); |
186 | qDebug( "createImfFields - error" ); | 186 | qDebug( "createImfFields - error" ); |
@@ -208,3 +208,3 @@ mailmime *SMTPwrapper::buildTxtPart(const QString&str ) | |||
208 | 208 | ||
209 | fields = mailmime_fields_new_encoding(MAILMIME_MECHANISM_QUOTED_PRINTABLE); | 209 | fields = mailmime_fields_new_encoding(MAILMIME_MECHANISM_8BIT); |
210 | if ( fields == NULL ) goto err_free_content; | 210 | if ( fields == NULL ) goto err_free_content; |
@@ -464,22 +464,2 @@ char *SMTPwrapper::getFrom( mailmime *mail ) | |||
464 | 464 | ||
465 | SMTPaccount *SMTPwrapper::getAccount(const QString&name ) | ||
466 | { | ||
467 | SMTPaccount *smtp; | ||
468 | |||
469 | QList<Account> list = settings->getAccounts(); | ||
470 | Account *it; | ||
471 | for ( it = list.first(); it; it = list.next() ) { | ||
472 | if ( it->getType().compare( "SMTP" ) == 0 ) { | ||
473 | smtp = static_cast<SMTPaccount *>(it); | ||
474 | if ( smtp->getName()== name ) { | ||
475 | qDebug( "SMTPaccount found for" ); | ||
476 | qDebug( name ); | ||
477 | return smtp; | ||
478 | } | ||
479 | } | ||
480 | } | ||
481 | |||
482 | return NULL; | ||
483 | } | ||
484 | |||
485 | void SMTPwrapper::progress( size_t current, size_t maximum ) | 465 | void SMTPwrapper::progress( size_t current, size_t maximum ) |
@@ -615,3 +595,3 @@ free_mem: | |||
615 | 595 | ||
616 | void SMTPwrapper::sendMail(const Mail&mail,bool later ) | 596 | void SMTPwrapper::sendMail(const Mail&mail,SMTPaccount*aSmtp,bool later ) |
617 | { | 597 | { |
@@ -619,4 +599,8 @@ void SMTPwrapper::sendMail(const Mail&mail,bool later ) | |||
619 | 599 | ||
620 | SMTPaccount *smtp = getAccount(mail.getName()); | 600 | SMTPaccount *smtp = aSmtp; |
621 | 601 | ||
602 | if (!later && !smtp) { | ||
603 | qDebug("Didn't get any send method - giving up"); | ||
604 | return; | ||
605 | } | ||
622 | mimeMail = createMimeMail(mail ); | 606 | mimeMail = createMimeMail(mail ); |
diff --git a/noncore/net/mail/libmailwrapper/smtpwrapper.h b/noncore/net/mail/libmailwrapper/smtpwrapper.h index f734fa4..0535983 100644 --- a/noncore/net/mail/libmailwrapper/smtpwrapper.h +++ b/noncore/net/mail/libmailwrapper/smtpwrapper.h | |||
@@ -29,3 +29,3 @@ public: | |||
29 | virtual ~SMTPwrapper(){} | 29 | virtual ~SMTPwrapper(){} |
30 | void sendMail(const Mail& mail,bool later=false ); | 30 | void sendMail(const Mail& mail,SMTPaccount*smtp,bool later=false ); |
31 | bool flushOutbox(SMTPaccount*smtp); | 31 | bool flushOutbox(SMTPaccount*smtp); |
@@ -44,3 +44,2 @@ protected: | |||
44 | clist *createRcptList( mailimf_fields *fields ); | 44 | clist *createRcptList( mailimf_fields *fields ); |
45 | SMTPaccount *getAccount(const QString&from ); | ||
46 | 45 | ||
diff --git a/noncore/net/mail/settings.cpp b/noncore/net/mail/settings.cpp index b580954..17aa1b0 100644 --- a/noncore/net/mail/settings.cpp +++ b/noncore/net/mail/settings.cpp | |||
@@ -275,5 +275,2 @@ SMTPaccount::SMTPaccount( QString filename ) | |||
275 | login = false; | 275 | login = false; |
276 | useCC = false; | ||
277 | useBCC = false; | ||
278 | useReply = false; | ||
279 | type = "SMTP"; | 276 | type = "SMTP"; |
@@ -308,13 +305,2 @@ void SMTPaccount::read() | |||
308 | password = conf->readEntryCrypt( "Password" ); | 305 | password = conf->readEntryCrypt( "Password" ); |
309 | useCC = conf->readBoolEntry( "useCC" ); | ||
310 | useBCC = conf->readBoolEntry( "useBCC" ); | ||
311 | useReply = conf->readBoolEntry( "useReply" ); | ||
312 | name = conf->readEntry( "Name" ); | ||
313 | mail = conf->readEntry( "Mail" ); | ||
314 | org = conf->readEntry( "Org" ); | ||
315 | cc = conf->readEntry( "CC" ); | ||
316 | bcc = conf->readEntry( "BCC" ); | ||
317 | reply = conf->readEntry( "Reply" ); | ||
318 | signature = conf->readEntry( "Signature" ); | ||
319 | signature = signature.replace( QRegExp( "<br>" ), "\n" ); | ||
320 | } | 306 | } |
@@ -335,13 +321,2 @@ void SMTPaccount::save() | |||
335 | conf->writeEntryCrypt( "Password", password ); | 321 | conf->writeEntryCrypt( "Password", password ); |
336 | conf->writeEntry( "useCC", useCC ); | ||
337 | conf->writeEntry( "useBCC", useBCC ); | ||
338 | conf->writeEntry( "useReply", useReply ); | ||
339 | conf->writeEntry( "Name", name ); | ||
340 | conf->writeEntry( "Mail", mail ); | ||
341 | conf->writeEntry( "Org", org ); | ||
342 | conf->writeEntry( "CC", cc ); | ||
343 | conf->writeEntry( "BCC", bcc ); | ||
344 | conf->writeEntry( "Reply", reply ); | ||
345 | conf->writeEntry( "Signature", | ||
346 | signature.replace( QRegExp( "\\n" ), "<br>" ) ); | ||
347 | conf->write(); | 322 | conf->write(); |
diff --git a/noncore/net/mail/settings.h b/noncore/net/mail/settings.h index 22184a5..caa5dfc 100644 --- a/noncore/net/mail/settings.h +++ b/noncore/net/mail/settings.h | |||
@@ -95,22 +95,2 @@ public: | |||
95 | 95 | ||
96 | void setName( QString str ) { name = str; } | ||
97 | QString getName() { return name; } | ||
98 | void setMail( QString str ) { mail = str; } | ||
99 | QString getMail() { return mail; } | ||
100 | void setOrg( QString str ) { org = str; } | ||
101 | QString getOrg() { return org; } | ||
102 | void setUseCC( bool b ) { useCC = b; } | ||
103 | bool getUseCC() { return useCC; } | ||
104 | void setCC( QString str ) { cc = str; } | ||
105 | QString getCC() { return cc; } | ||
106 | void setUseBCC( bool b ) { useBCC = b; } | ||
107 | bool getUseBCC() { return useBCC; } | ||
108 | void setBCC( QString str ) { bcc = str; } | ||
109 | QString getBCC() { return bcc; } | ||
110 | void setUseReply( bool b ) { useReply = b; } | ||
111 | bool getUseReply() { return useReply; } | ||
112 | void setReply( QString str ) { reply = str; } | ||
113 | QString getReply() { return reply; } | ||
114 | void setSignature( QString str ) { signature = str; } | ||
115 | QString getSignature() { return signature; } | ||
116 | void setLogin( bool b ) { login = b; } | 96 | void setLogin( bool b ) { login = b; } |
diff --git a/noncore/net/mail/smtpconfigui.ui b/noncore/net/mail/smtpconfigui.ui index 2cae8d6..f5ce8cb 100644 --- a/noncore/net/mail/smtpconfigui.ui +++ b/noncore/net/mail/smtpconfigui.ui | |||
@@ -13,4 +13,4 @@ | |||
13 | <y>0</y> | 13 | <y>0</y> |
14 | <width>253</width> | 14 | <width>241</width> |
15 | <height>342</height> | 15 | <height>321</height> |
16 | </rect> | 16 | </rect> |
@@ -30,3 +30,3 @@ | |||
30 | <name>margin</name> | 30 | <name>margin</name> |
31 | <number>0</number> | 31 | <number>2</number> |
32 | </property> | 32 | </property> |
@@ -34,16 +34,9 @@ | |||
34 | <name>spacing</name> | 34 | <name>spacing</name> |
35 | <number>0</number> | 35 | <number>2</number> |
36 | </property> | 36 | </property> |
37 | <widget> | 37 | <widget> |
38 | <class>QTabWidget</class> | 38 | <class>QLayoutWidget</class> |
39 | <property stdset="1"> | 39 | <property stdset="1"> |
40 | <name>name</name> | 40 | <name>name</name> |
41 | <cstring>smtpTab</cstring> | 41 | <cstring>Layout4</cstring> |
42 | </property> | ||
43 | <property stdset="1"> | ||
44 | <name>caption</name> | ||
45 | <string></string> | ||
46 | </property> | ||
47 | <property> | ||
48 | <name>layoutMargin</name> | ||
49 | </property> | 42 | </property> |
@@ -52,12 +45,2 @@ | |||
52 | </property> | 45 | </property> |
53 | <widget> | ||
54 | <class>QWidget</class> | ||
55 | <property stdset="1"> | ||
56 | <name>name</name> | ||
57 | <cstring>serverTab</cstring> | ||
58 | </property> | ||
59 | <attribute> | ||
60 | <name>title</name> | ||
61 | <string>Server</string> | ||
62 | </attribute> | ||
63 | <grid> | 46 | <grid> |
@@ -65,3 +48,3 @@ | |||
65 | <name>margin</name> | 48 | <name>margin</name> |
66 | <number>4</number> | 49 | <number>0</number> |
67 | </property> | 50 | </property> |
@@ -69,49 +52,5 @@ | |||
69 | <name>spacing</name> | 52 | <name>spacing</name> |
70 | <number>3</number> | 53 | <number>2</number> |
71 | </property> | 54 | </property> |
72 | <widget row="3" column="0" > | 55 | <widget row="0" column="0" rowspan="1" colspan="2" > |
73 | <class>QLabel</class> | ||
74 | <property stdset="1"> | ||
75 | <name>name</name> | ||
76 | <cstring>portLabel</cstring> | ||
77 | </property> | ||
78 | <property stdset="1"> | ||
79 | <name>text</name> | ||
80 | <string>Port</string> | ||
81 | </property> | ||
82 | </widget> | ||
83 | <widget row="2" column="1" rowspan="1" colspan="2" > | ||
84 | <class>QLineEdit</class> | ||
85 | <property stdset="1"> | ||
86 | <name>name</name> | ||
87 | <cstring>serverLine</cstring> | ||
88 | </property> | ||
89 | <property> | ||
90 | <name>toolTip</name> | ||
91 | <string>Name of the SMTP Server</string> | ||
92 | </property> | ||
93 | </widget> | ||
94 | <widget row="2" column="0" > | ||
95 | <class>QLabel</class> | ||
96 | <property stdset="1"> | ||
97 | <name>name</name> | ||
98 | <cstring>serverLabel</cstring> | ||
99 | </property> | ||
100 | <property stdset="1"> | ||
101 | <name>text</name> | ||
102 | <string>Server</string> | ||
103 | </property> | ||
104 | </widget> | ||
105 | <widget row="3" column="1" rowspan="1" colspan="2" > | ||
106 | <class>QLineEdit</class> | ||
107 | <property stdset="1"> | ||
108 | <name>name</name> | ||
109 | <cstring>portLine</cstring> | ||
110 | </property> | ||
111 | <property> | ||
112 | <name>toolTip</name> | ||
113 | <string>Port of the SMTP Server</string> | ||
114 | </property> | ||
115 | </widget> | ||
116 | <widget row="0" column="0" > | ||
117 | <class>QLabel</class> | 56 | <class>QLabel</class> |
@@ -126,47 +65,3 @@ | |||
126 | </widget> | 65 | </widget> |
127 | <widget row="0" column="1" rowspan="1" colspan="2" > | 66 | <widget row="8" column="2" > |
128 | <class>QLineEdit</class> | ||
129 | <property stdset="1"> | ||
130 | <name>name</name> | ||
131 | <cstring>accountLine</cstring> | ||
132 | </property> | ||
133 | <property> | ||
134 | <name>toolTip</name> | ||
135 | <string>Name of the Account</string> | ||
136 | </property> | ||
137 | </widget> | ||
138 | <widget row="1" column="0" rowspan="1" colspan="3" > | ||
139 | <class>Line</class> | ||
140 | <property stdset="1"> | ||
141 | <name>name</name> | ||
142 | <cstring>line1</cstring> | ||
143 | </property> | ||
144 | <property stdset="1"> | ||
145 | <name>orientation</name> | ||
146 | <enum>Horizontal</enum> | ||
147 | </property> | ||
148 | </widget> | ||
149 | <widget row="4" column="1" > | ||
150 | <class>QCheckBox</class> | ||
151 | <property stdset="1"> | ||
152 | <name>name</name> | ||
153 | <cstring>sslBox</cstring> | ||
154 | </property> | ||
155 | <property stdset="1"> | ||
156 | <name>text</name> | ||
157 | <string>Use SSL</string> | ||
158 | </property> | ||
159 | </widget> | ||
160 | <widget row="5" column="0" rowspan="1" colspan="3" > | ||
161 | <class>Line</class> | ||
162 | <property stdset="1"> | ||
163 | <name>name</name> | ||
164 | <cstring>line2</cstring> | ||
165 | </property> | ||
166 | <property stdset="1"> | ||
167 | <name>orientation</name> | ||
168 | <enum>Horizontal</enum> | ||
169 | </property> | ||
170 | </widget> | ||
171 | <widget row="8" column="1" rowspan="1" colspan="2" > | ||
172 | <class>QLineEdit</class> | 67 | <class>QLineEdit</class> |
@@ -185,3 +80,3 @@ | |||
185 | </widget> | 80 | </widget> |
186 | <widget row="6" column="1" rowspan="1" colspan="2" > | 81 | <widget row="4" column="0" rowspan="1" colspan="3" > |
187 | <class>QCheckBox</class> | 82 | <class>QCheckBox</class> |
@@ -189,14 +84,3 @@ | |||
189 | <name>name</name> | 84 | <name>name</name> |
190 | <cstring>loginBox</cstring> | 85 | <cstring>sslBox</cstring> |
191 | </property> | ||
192 | <property stdset="1"> | ||
193 | <name>text</name> | ||
194 | <string>Use Login</string> | ||
195 | </property> | ||
196 | </widget> | ||
197 | <widget row="8" column="0" > | ||
198 | <class>QLabel</class> | ||
199 | <property stdset="1"> | ||
200 | <name>name</name> | ||
201 | <cstring>passLabel</cstring> | ||
202 | </property> | 86 | </property> |
@@ -204,10 +88,10 @@ | |||
204 | <name>text</name> | 88 | <name>text</name> |
205 | <string>Password</string> | 89 | <string>Use SSL</string> |
206 | </property> | 90 | </property> |
207 | </widget> | 91 | </widget> |
208 | <widget row="7" column="0" > | 92 | <widget row="6" column="0" rowspan="1" colspan="3" > |
209 | <class>QLabel</class> | 93 | <class>QCheckBox</class> |
210 | <property stdset="1"> | 94 | <property stdset="1"> |
211 | <name>name</name> | 95 | <name>name</name> |
212 | <cstring>userLabel</cstring> | 96 | <cstring>loginBox</cstring> |
213 | </property> | 97 | </property> |
@@ -215,6 +99,6 @@ | |||
215 | <name>text</name> | 99 | <name>text</name> |
216 | <string>User</string> | 100 | <string>Use Login</string> |
217 | </property> | 101 | </property> |
218 | </widget> | 102 | </widget> |
219 | <widget row="7" column="1" rowspan="1" colspan="2" > | 103 | <widget row="0" column="2" > |
220 | <class>QLineEdit</class> | 104 | <class>QLineEdit</class> |
@@ -222,77 +106,3 @@ | |||
222 | <name>name</name> | 106 | <name>name</name> |
223 | <cstring>userLine</cstring> | 107 | <cstring>accountLine</cstring> |
224 | </property> | ||
225 | <property stdset="1"> | ||
226 | <name>enabled</name> | ||
227 | <bool>false</bool> | ||
228 | </property> | ||
229 | </widget> | ||
230 | <spacer row="9" column="2" > | ||
231 | <property> | ||
232 | <name>name</name> | ||
233 | <cstring>spacer</cstring> | ||
234 | </property> | ||
235 | <property stdset="1"> | ||
236 | <name>orientation</name> | ||
237 | <enum>Vertical</enum> | ||
238 | </property> | ||
239 | <property stdset="1"> | ||
240 | <name>sizeType</name> | ||
241 | <enum>Expanding</enum> | ||
242 | </property> | ||
243 | <property> | ||
244 | <name>sizeHint</name> | ||
245 | <size> | ||
246 | <width>20</width> | ||
247 | <height>20</height> | ||
248 | </size> | ||
249 | </property> | ||
250 | </spacer> | ||
251 | </grid> | ||
252 | </widget> | ||
253 | <widget> | ||
254 | <class>QWidget</class> | ||
255 | <property stdset="1"> | ||
256 | <name>name</name> | ||
257 | <cstring>identityTab</cstring> | ||
258 | </property> | ||
259 | <attribute> | ||
260 | <name>title</name> | ||
261 | <string>Identity</string> | ||
262 | </attribute> | ||
263 | <grid> | ||
264 | <property stdset="1"> | ||
265 | <name>margin</name> | ||
266 | <number>4</number> | ||
267 | </property> | ||
268 | <property stdset="1"> | ||
269 | <name>spacing</name> | ||
270 | <number>3</number> | ||
271 | </property> | ||
272 | <widget row="9" column="0" rowspan="1" colspan="4" > | ||
273 | <class>QMultiLineEdit</class> | ||
274 | <property stdset="1"> | ||
275 | <name>name</name> | ||
276 | <cstring>sigMultiLine</cstring> | ||
277 | </property> | ||
278 | </widget> | ||
279 | <spacer row="10" column="3" > | ||
280 | <property> | ||
281 | <name>name</name> | ||
282 | <cstring>Spacer3</cstring> | ||
283 | </property> | ||
284 | <property stdset="1"> | ||
285 | <name>orientation</name> | ||
286 | <enum>Vertical</enum> | ||
287 | </property> | ||
288 | <property stdset="1"> | ||
289 | <name>sizeType</name> | ||
290 | <enum>Expanding</enum> | ||
291 | </property> | ||
292 | <property> | ||
293 | <name>sizeHint</name> | ||
294 | <size> | ||
295 | <width>20</width> | ||
296 | <height>20</height> | ||
297 | </size> | ||
298 | </property> | 108 | </property> |
@@ -302,26 +112,4 @@ | |||
302 | </property> | 112 | </property> |
303 | </spacer> | ||
304 | <widget row="8" column="0" rowspan="1" colspan="3" > | ||
305 | <class>QLabel</class> | ||
306 | <property stdset="1"> | ||
307 | <name>name</name> | ||
308 | <cstring>sigLabel</cstring> | ||
309 | </property> | ||
310 | <property stdset="1"> | ||
311 | <name>text</name> | ||
312 | <string>Signature</string> | ||
313 | </property> | ||
314 | </widget> | ||
315 | <widget row="6" column="2" rowspan="1" colspan="2" > | ||
316 | <class>QLineEdit</class> | ||
317 | <property stdset="1"> | ||
318 | <name>name</name> | ||
319 | <cstring>replyLine</cstring> | ||
320 | </property> | ||
321 | <property stdset="1"> | ||
322 | <name>enabled</name> | ||
323 | <bool>false</bool> | ||
324 | </property> | ||
325 | </widget> | 113 | </widget> |
326 | <widget row="5" column="2" rowspan="1" colspan="2" > | 114 | <widget row="2" column="1" rowspan="1" colspan="2" > |
327 | <class>QLineEdit</class> | 115 | <class>QLineEdit</class> |
@@ -329,10 +117,10 @@ | |||
329 | <name>name</name> | 117 | <name>name</name> |
330 | <cstring>bccLine</cstring> | 118 | <cstring>serverLine</cstring> |
331 | </property> | 119 | </property> |
332 | <property stdset="1"> | 120 | <property> |
333 | <name>enabled</name> | 121 | <name>toolTip</name> |
334 | <bool>false</bool> | 122 | <string>Name of the SMTP Server</string> |
335 | </property> | 123 | </property> |
336 | </widget> | 124 | </widget> |
337 | <widget row="4" column="2" rowspan="1" colspan="2" > | 125 | <widget row="7" column="2" > |
338 | <class>QLineEdit</class> | 126 | <class>QLineEdit</class> |
@@ -340,3 +128,3 @@ | |||
340 | <name>name</name> | 128 | <name>name</name> |
341 | <cstring>ccLine</cstring> | 129 | <cstring>userLine</cstring> |
342 | </property> | 130 | </property> |
@@ -347,18 +135,7 @@ | |||
347 | </widget> | 135 | </widget> |
348 | <widget row="5" column="0" rowspan="1" colspan="2" > | 136 | <widget row="8" column="0" rowspan="1" colspan="2" > |
349 | <class>QCheckBox</class> | 137 | <class>QLabel</class> |
350 | <property stdset="1"> | ||
351 | <name>name</name> | ||
352 | <cstring>bccBox</cstring> | ||
353 | </property> | ||
354 | <property stdset="1"> | ||
355 | <name>text</name> | ||
356 | <string>BCC</string> | ||
357 | </property> | ||
358 | </widget> | ||
359 | <widget row="6" column="0" rowspan="1" colspan="2" > | ||
360 | <class>QCheckBox</class> | ||
361 | <property stdset="1"> | 138 | <property stdset="1"> |
362 | <name>name</name> | 139 | <name>name</name> |
363 | <cstring>replyBox</cstring> | 140 | <cstring>passLabel</cstring> |
364 | </property> | 141 | </property> |
@@ -366,10 +143,10 @@ | |||
366 | <name>text</name> | 143 | <name>text</name> |
367 | <string>Reply-To</string> | 144 | <string>Password</string> |
368 | </property> | 145 | </property> |
369 | </widget> | 146 | </widget> |
370 | <widget row="4" column="0" rowspan="1" colspan="2" > | 147 | <widget row="3" column="0" > |
371 | <class>QCheckBox</class> | 148 | <class>QLabel</class> |
372 | <property stdset="1"> | 149 | <property stdset="1"> |
373 | <name>name</name> | 150 | <name>name</name> |
374 | <cstring>ccBox</cstring> | 151 | <cstring>portLabel</cstring> |
375 | </property> | 152 | </property> |
@@ -377,6 +154,6 @@ | |||
377 | <name>text</name> | 154 | <name>text</name> |
378 | <string>CC</string> | 155 | <string>Port</string> |
379 | </property> | 156 | </property> |
380 | </widget> | 157 | </widget> |
381 | <widget row="1" column="0" > | 158 | <widget row="2" column="0" > |
382 | <class>QLabel</class> | 159 | <class>QLabel</class> |
@@ -384,3 +161,3 @@ | |||
384 | <name>name</name> | 161 | <name>name</name> |
385 | <cstring>mailLabel</cstring> | 162 | <cstring>serverLabel</cstring> |
386 | </property> | 163 | </property> |
@@ -388,6 +165,6 @@ | |||
388 | <name>text</name> | 165 | <name>text</name> |
389 | <string>E-Mail</string> | 166 | <string>Server</string> |
390 | </property> | 167 | </property> |
391 | </widget> | 168 | </widget> |
392 | <widget row="0" column="1" rowspan="1" colspan="3" > | 169 | <widget row="3" column="1" rowspan="1" colspan="2" > |
393 | <class>QLineEdit</class> | 170 | <class>QLineEdit</class> |
@@ -395,3 +172,3 @@ | |||
395 | <name>name</name> | 172 | <name>name</name> |
396 | <cstring>nameLine</cstring> | 173 | <cstring>portLine</cstring> |
397 | </property> | 174 | </property> |
@@ -399,17 +176,24 @@ | |||
399 | <name>toolTip</name> | 176 | <name>toolTip</name> |
400 | <string>Your Full Name</string> | 177 | <string>Port of the SMTP Server</string> |
401 | </property> | 178 | </property> |
402 | </widget> | 179 | </widget> |
403 | <widget row="0" column="0" > | 180 | <widget row="1" column="0" rowspan="1" colspan="3" > |
404 | <class>QLabel</class> | 181 | <class>Line</class> |
405 | <property stdset="1"> | 182 | <property stdset="1"> |
406 | <name>name</name> | 183 | <name>name</name> |
407 | <cstring>nameLabel</cstring> | 184 | <cstring>line1</cstring> |
408 | </property> | 185 | </property> |
409 | <property stdset="1"> | 186 | <property stdset="1"> |
410 | <name>text</name> | 187 | <name>sizePolicy</name> |
411 | <string>Name</string> | 188 | <sizepolicy> |
189 | <hsizetype>3</hsizetype> | ||
190 | <vsizetype>0</vsizetype> | ||
191 | </sizepolicy> | ||
192 | </property> | ||
193 | <property stdset="1"> | ||
194 | <name>orientation</name> | ||
195 | <enum>Horizontal</enum> | ||
412 | </property> | 196 | </property> |
413 | </widget> | 197 | </widget> |
414 | <widget row="2" column="0" > | 198 | <widget row="7" column="0" rowspan="1" colspan="2" > |
415 | <class>QLabel</class> | 199 | <class>QLabel</class> |
@@ -417,3 +201,3 @@ | |||
417 | <name>name</name> | 201 | <name>name</name> |
418 | <cstring>orgLabel</cstring> | 202 | <cstring>userLabel</cstring> |
419 | </property> | 203 | </property> |
@@ -421,38 +205,17 @@ | |||
421 | <name>text</name> | 205 | <name>text</name> |
422 | <string>Org.</string> | 206 | <string>User</string> |
423 | </property> | ||
424 | <property> | ||
425 | <name>layoutMargin</name> | ||
426 | </property> | ||
427 | <property> | ||
428 | <name>layoutSpacing</name> | ||
429 | </property> | ||
430 | </widget> | ||
431 | <widget row="2" column="1" rowspan="1" colspan="3" > | ||
432 | <class>QLineEdit</class> | ||
433 | <property stdset="1"> | ||
434 | <name>name</name> | ||
435 | <cstring>orgLine</cstring> | ||
436 | </property> | ||
437 | <property> | ||
438 | <name>toolTip</name> | ||
439 | <string>Your Organisation</string> | ||
440 | </property> | 207 | </property> |
441 | </widget> | 208 | </widget> |
442 | <widget row="1" column="1" rowspan="1" colspan="3" > | 209 | <widget row="5" column="0" rowspan="1" colspan="3" > |
443 | <class>QLineEdit</class> | 210 | <class>Line</class> |
444 | <property stdset="1"> | 211 | <property stdset="1"> |
445 | <name>name</name> | 212 | <name>name</name> |
446 | <cstring>mailLine</cstring> | 213 | <cstring>line2</cstring> |
447 | </property> | ||
448 | <property> | ||
449 | <name>toolTip</name> | ||
450 | <string>Your E-Mail Adress</string> | ||
451 | </property> | 214 | </property> |
452 | </widget> | ||
453 | <widget row="3" column="0" rowspan="1" colspan="4" > | ||
454 | <class>Line</class> | ||
455 | <property stdset="1"> | 215 | <property stdset="1"> |
456 | <name>name</name> | 216 | <name>sizePolicy</name> |
457 | <cstring>line3</cstring> | 217 | <sizepolicy> |
218 | <hsizetype>3</hsizetype> | ||
219 | <vsizetype>0</vsizetype> | ||
220 | </sizepolicy> | ||
458 | </property> | 221 | </property> |
@@ -463,7 +226,8 @@ | |||
463 | </widget> | 226 | </widget> |
464 | <widget row="7" column="0" rowspan="1" colspan="4" > | 227 | </grid> |
465 | <class>Line</class> | 228 | </widget> |
466 | <property stdset="1"> | 229 | <spacer> |
230 | <property> | ||
467 | <name>name</name> | 231 | <name>name</name> |
468 | <cstring>line4</cstring> | 232 | <cstring>spacer</cstring> |
469 | </property> | 233 | </property> |
@@ -471,8 +235,16 @@ | |||
471 | <name>orientation</name> | 235 | <name>orientation</name> |
472 | <enum>Horizontal</enum> | 236 | <enum>Vertical</enum> |
473 | </property> | 237 | </property> |
474 | </widget> | 238 | <property stdset="1"> |
475 | </grid> | 239 | <name>sizeType</name> |
476 | </widget> | 240 | <enum>Expanding</enum> |
477 | </widget> | 241 | </property> |
242 | <property> | ||
243 | <name>sizeHint</name> | ||
244 | <size> | ||
245 | <width>20</width> | ||
246 | <height>20</height> | ||
247 | </size> | ||
248 | </property> | ||
249 | </spacer> | ||
478 | </vbox> | 250 | </vbox> |
@@ -487,13 +259,2 @@ | |||
487 | <tabstop>passLine</tabstop> | 259 | <tabstop>passLine</tabstop> |
488 | <tabstop>smtpTab</tabstop> | ||
489 | <tabstop>nameLine</tabstop> | ||
490 | <tabstop>mailLine</tabstop> | ||
491 | <tabstop>orgLine</tabstop> | ||
492 | <tabstop>ccBox</tabstop> | ||
493 | <tabstop>ccLine</tabstop> | ||
494 | <tabstop>bccBox</tabstop> | ||
495 | <tabstop>bccLine</tabstop> | ||
496 | <tabstop>replyBox</tabstop> | ||
497 | <tabstop>replyLine</tabstop> | ||
498 | <tabstop>sigMultiLine</tabstop> | ||
499 | </tabstops> | 260 | </tabstops> |
diff --git a/noncore/net/mail/smtpwrapper.cpp b/noncore/net/mail/smtpwrapper.cpp index 521cd0a..30c0707 100644 --- a/noncore/net/mail/smtpwrapper.cpp +++ b/noncore/net/mail/smtpwrapper.cpp | |||
@@ -130,5 +130,5 @@ mailimf_fields *SMTPwrapper::createImfFields(const Mail&mail ) | |||
130 | mailimf_field *xmailer; | 130 | mailimf_field *xmailer; |
131 | mailimf_mailbox *sender, *fromBox; | 131 | mailimf_mailbox *sender=0,*fromBox=0; |
132 | mailimf_mailbox_list *from; | 132 | mailimf_mailbox_list *from=0; |
133 | mailimf_address_list *to, *cc, *bcc, *reply; | 133 | mailimf_address_list *to=0, *cc=0, *bcc=0, *reply=0; |
134 | char *subject = strdup( mail.getSubject().latin1() ); | 134 | char *subject = strdup( mail.getSubject().latin1() ); |
@@ -169,12 +169,12 @@ mailimf_fields *SMTPwrapper::createImfFields(const Mail&mail ) | |||
169 | err_free_xmailer: | 169 | err_free_xmailer: |
170 | mailimf_field_free( xmailer ); | 170 | if (xmailer) mailimf_field_free( xmailer ); |
171 | err_free_fields: | 171 | err_free_fields: |
172 | mailimf_fields_free( fields ); | 172 | if (fields) mailimf_fields_free( fields ); |
173 | err_free_reply: | 173 | err_free_reply: |
174 | mailimf_address_list_free( reply ); | 174 | if (reply) mailimf_address_list_free( reply ); |
175 | mailimf_address_list_free( bcc ); | 175 | if (bcc) mailimf_address_list_free( bcc ); |
176 | mailimf_address_list_free( cc ); | 176 | if (cc) mailimf_address_list_free( cc ); |
177 | mailimf_address_list_free( to ); | 177 | if (to) mailimf_address_list_free( to ); |
178 | err_free_from: | 178 | err_free_from: |
179 | mailimf_mailbox_list_free( from ); | 179 | if (from) mailimf_mailbox_list_free( from ); |
180 | err_free_fromBox: | 180 | err_free_fromBox: |
@@ -182,5 +182,5 @@ err_free_fromBox: | |||
182 | err_free_sender: | 182 | err_free_sender: |
183 | mailimf_mailbox_free( sender ); | 183 | if (sender) mailimf_mailbox_free( sender ); |
184 | err_free: | 184 | err_free: |
185 | free( subject ); | 185 | if (subject) free( subject ); |
186 | qDebug( "createImfFields - error" ); | 186 | qDebug( "createImfFields - error" ); |
@@ -208,3 +208,3 @@ mailmime *SMTPwrapper::buildTxtPart(const QString&str ) | |||
208 | 208 | ||
209 | fields = mailmime_fields_new_encoding(MAILMIME_MECHANISM_QUOTED_PRINTABLE); | 209 | fields = mailmime_fields_new_encoding(MAILMIME_MECHANISM_8BIT); |
210 | if ( fields == NULL ) goto err_free_content; | 210 | if ( fields == NULL ) goto err_free_content; |
@@ -464,22 +464,2 @@ char *SMTPwrapper::getFrom( mailmime *mail ) | |||
464 | 464 | ||
465 | SMTPaccount *SMTPwrapper::getAccount(const QString&name ) | ||
466 | { | ||
467 | SMTPaccount *smtp; | ||
468 | |||
469 | QList<Account> list = settings->getAccounts(); | ||
470 | Account *it; | ||
471 | for ( it = list.first(); it; it = list.next() ) { | ||
472 | if ( it->getType().compare( "SMTP" ) == 0 ) { | ||
473 | smtp = static_cast<SMTPaccount *>(it); | ||
474 | if ( smtp->getName()== name ) { | ||
475 | qDebug( "SMTPaccount found for" ); | ||
476 | qDebug( name ); | ||
477 | return smtp; | ||
478 | } | ||
479 | } | ||
480 | } | ||
481 | |||
482 | return NULL; | ||
483 | } | ||
484 | |||
485 | void SMTPwrapper::progress( size_t current, size_t maximum ) | 465 | void SMTPwrapper::progress( size_t current, size_t maximum ) |
@@ -615,3 +595,3 @@ free_mem: | |||
615 | 595 | ||
616 | void SMTPwrapper::sendMail(const Mail&mail,bool later ) | 596 | void SMTPwrapper::sendMail(const Mail&mail,SMTPaccount*aSmtp,bool later ) |
617 | { | 597 | { |
@@ -619,4 +599,8 @@ void SMTPwrapper::sendMail(const Mail&mail,bool later ) | |||
619 | 599 | ||
620 | SMTPaccount *smtp = getAccount(mail.getName()); | 600 | SMTPaccount *smtp = aSmtp; |
621 | 601 | ||
602 | if (!later && !smtp) { | ||
603 | qDebug("Didn't get any send method - giving up"); | ||
604 | return; | ||
605 | } | ||
622 | mimeMail = createMimeMail(mail ); | 606 | mimeMail = createMimeMail(mail ); |
diff --git a/noncore/net/mail/smtpwrapper.h b/noncore/net/mail/smtpwrapper.h index f734fa4..0535983 100644 --- a/noncore/net/mail/smtpwrapper.h +++ b/noncore/net/mail/smtpwrapper.h | |||
@@ -29,3 +29,3 @@ public: | |||
29 | virtual ~SMTPwrapper(){} | 29 | virtual ~SMTPwrapper(){} |
30 | void sendMail(const Mail& mail,bool later=false ); | 30 | void sendMail(const Mail& mail,SMTPaccount*smtp,bool later=false ); |
31 | bool flushOutbox(SMTPaccount*smtp); | 31 | bool flushOutbox(SMTPaccount*smtp); |
@@ -44,3 +44,2 @@ protected: | |||
44 | clist *createRcptList( mailimf_fields *fields ); | 44 | clist *createRcptList( mailimf_fields *fields ); |
45 | SMTPaccount *getAccount(const QString&from ); | ||
46 | 45 | ||