summaryrefslogtreecommitdiff
path: root/noncore/net/mail
authoralwin <alwin>2004-10-24 00:55:14 (UTC)
committer alwin <alwin>2004-10-24 00:55:14 (UTC)
commit9755bc969d17fc683791abc5c6fbd50fa3112486 (patch) (unidiff)
tree0fdcf7b52b2f4627dd3efcd7330b116c4d9c4d98 /noncore/net/mail
parent12eed25c7f18285f0e342d49fd3c41eb4b14e151 (diff)
downloadopie-9755bc969d17fc683791abc5c6fbd50fa3112486.zip
opie-9755bc969d17fc683791abc5c6fbd50fa3112486.tar.gz
opie-9755bc969d17fc683791abc5c6fbd50fa3112486.tar.bz2
new options for pop3 accounts
KATE eated a lot of last spaces in files some tryouts
Diffstat (limited to 'noncore/net/mail') (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/mail/accountview.cpp15
-rw-r--r--noncore/net/mail/editaccounts.cpp4
-rw-r--r--noncore/net/mail/libmailwrapper/genericwrapper.cpp13
-rw-r--r--noncore/net/mail/libmailwrapper/imapwrapper.cpp20
-rw-r--r--noncore/net/mail/libmailwrapper/mhwrapper.cpp0
-rw-r--r--noncore/net/mail/libmailwrapper/pop3wrapper.cpp9
-rw-r--r--noncore/net/mail/libmailwrapper/pop3wrapper.h2
-rw-r--r--noncore/net/mail/libmailwrapper/settings.cpp29
-rw-r--r--noncore/net/mail/libmailwrapper/settings.h7
-rw-r--r--noncore/net/mail/pop3configui.ui68
10 files changed, 140 insertions, 27 deletions
diff --git a/noncore/net/mail/accountview.cpp b/noncore/net/mail/accountview.cpp
index 662e555..0fe8475 100644
--- a/noncore/net/mail/accountview.cpp
+++ b/noncore/net/mail/accountview.cpp
@@ -65,6 +65,4 @@ void AccountView::populate( QList<Account> list )
65 Account *it; 65 Account *it;
66 for ( it = list.first(); it; it = list.next() ) 66 for ( it = list.first(); it; it = list.next() ) {
67 { 67 if ( it->getType() == MAILLIB::A_IMAP ) {
68 if ( it->getType() == MAILLIB::A_IMAP )
69 {
70 IMAPaccount *imap = static_cast<IMAPaccount *>(it); 68 IMAPaccount *imap = static_cast<IMAPaccount *>(it);
@@ -72,5 +70,3 @@ void AccountView::populate( QList<Account> list )
72 imapAccounts.append(new IMAPviewItem( imap, this )); 70 imapAccounts.append(new IMAPviewItem( imap, this ));
73 } 71 } else if ( it->getType() == MAILLIB::A_POP3 ) {
74 else if ( it->getType() == MAILLIB::A_POP3 )
75 {
76 POP3account *pop3 = static_cast<POP3account *>(it); 72 POP3account *pop3 = static_cast<POP3account *>(it);
@@ -79,5 +75,3 @@ void AccountView::populate( QList<Account> list )
79 (void) new POP3viewItem( pop3, this ); 75 (void) new POP3viewItem( pop3, this );
80 } 76 } else if ( it->getType() == MAILLIB::A_NNTP ) {
81 else if ( it->getType() == MAILLIB::A_NNTP )
82 {
83 NNTPaccount *nntp = static_cast<NNTPaccount *>(it); 77 NNTPaccount *nntp = static_cast<NNTPaccount *>(it);
@@ -86,2 +80,3 @@ void AccountView::populate( QList<Account> list )
86 (void) new NNTPviewItem( nntp, this ); 80 (void) new NNTPviewItem( nntp, this );
81 } else if ( it->getType() == MAILLIB::A_MH ) {
87 } 82 }
diff --git a/noncore/net/mail/editaccounts.cpp b/noncore/net/mail/editaccounts.cpp
index b0ce57d..b7c137d 100644
--- a/noncore/net/mail/editaccounts.cpp
+++ b/noncore/net/mail/editaccounts.cpp
@@ -424,2 +424,4 @@ void POP3config::fillValues()
424 passLine->setText( data->getPassword() ); 424 passLine->setText( data->getPassword() );
425 m_CheckSize->setChecked(data->getCheckMaxSize());
426 m_MailLimitBox->setValue(data->getMaxSize());
425} 427}
@@ -434,2 +436,4 @@ void POP3config::accept()
434 data->setPassword( passLine->text() ); 436 data->setPassword( passLine->text() );
437 data->setMaxSize(m_MailLimitBox->value());
438 data->setCheckMaxSize(m_CheckSize->isChecked());
435 439
diff --git a/noncore/net/mail/libmailwrapper/genericwrapper.cpp b/noncore/net/mail/libmailwrapper/genericwrapper.cpp
index 1caa375..5ec9415 100644
--- a/noncore/net/mail/libmailwrapper/genericwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/genericwrapper.cpp
@@ -5,2 +5,4 @@
5#include <opie2/odebug.h> 5#include <opie2/odebug.h>
6#include <qpe/timestring.h>
7#include <qdatetime.h>
6 8
@@ -245,8 +247,7 @@ QString Genericwrapper::parseDateTime( mailimf_date_time *date )
245{ 247{
246 char tmp[23]; 248 QDateTime da(QDate(date->dt_year,date->dt_month,date->dt_day),QTime(date->dt_hour,date->dt_min,date->dt_sec));
247 249 QString timestring = TimeString::numberDateString(QDate(date->dt_year,date->dt_month,date->dt_day))+" ";
248 snprintf( tmp, 23, "%02i.%02i.%04i %02i:%02i:%02i %+05i", 250 timestring+=TimeString::timeString(QTime(date->dt_hour,date->dt_min,date->dt_sec))+" ";
249 date->dt_day, date->dt_month, date->dt_year, date->dt_hour, date->dt_min, date->dt_sec, date->dt_zone ); 251 timestring.sprintf(timestring+" %+05i",date->dt_zone);
250 252 return timestring;
251 return QString( tmp );
252} 253}
diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.cpp b/noncore/net/mail/libmailwrapper/imapwrapper.cpp
index 9b7c0e0..fe75a15 100644
--- a/noncore/net/mail/libmailwrapper/imapwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/imapwrapper.cpp
@@ -239,2 +239,6 @@ void IMAPwrapper::listMessages(const QString&mailbox,QValueList<Opie::Core::OSma
239 set = mailimap_set_new_interval( 1, last ); 239 set = mailimap_set_new_interval( 1, last );
240
241
242 fetchType = mailimap_fetch_type_new_all();
243/*
240 fetchType = mailimap_fetch_type_new_fetch_att_list_empty(); 244 fetchType = mailimap_fetch_type_new_fetch_att_list_empty();
@@ -244,3 +248,3 @@ void IMAPwrapper::listMessages(const QString&mailbox,QValueList<Opie::Core::OSma
244 mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_rfc822_size()); 248 mailimap_fetch_type_new_fetch_att_list_add(fetchType,mailimap_fetch_att_new_rfc822_size());
245 249*/
246 err = mailimap_fetch( m_imap, set, fetchType, &result ); 250 err = mailimap_fetch( m_imap, set, fetchType, &result );
@@ -377,2 +381,3 @@ RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att)
377 } 381 }
382 size = 0;
378 m = new RecMail(); 383 m = new RecMail();
@@ -380,3 +385,2 @@ RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att)
380 current = c; 385 current = c;
381 size = 0;
382 item = (mailimap_msg_att_item*)current->data; 386 item = (mailimap_msg_att_item*)current->data;
@@ -467,3 +471,9 @@ RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att)
467#if 0 471#if 0
468 mailimap_date_time*d = item->att_data.att_static->att_data.att_internal_date; 472 mailimap_date_time*date = item->att_data.att_static->att_data.att_internal_date;
473 if (date->dt_sec>60 || date->dt_sec<0) date->dt_sec=0;
474 //QDateTime da(QDate(d->dt_year,date->dt_month,date->dt_day),QTime(date->dt_hour,date->dt_min,date->dt_sec));
475 QString timestring = TimeString::numberDateString(QDate(date->dt_year,date->dt_month,date->dt_day))+" ";
476 timestring+=TimeString::timeString(QTime(date->dt_hour,date->dt_min,date->dt_sec))+" ";
477 timestring.sprintf(timestring+" %+05i",date->dt_zone);
478 m->setDate(timestring);
469 QDateTime da(QDate(d->dt_year,d->dt_month,d->dt_day),QTime(d->dt_hour,d->dt_min,d->dt_sec)); 479 QDateTime da(QDate(d->dt_year,d->dt_month,d->dt_day),QTime(d->dt_hour,d->dt_min,d->dt_sec));
@@ -473,3 +483,4 @@ RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att)
473 } else if (item->att_data.att_static->att_type==MAILIMAP_MSG_ATT_RFC822_SIZE) { 483 } else if (item->att_data.att_static->att_type==MAILIMAP_MSG_ATT_RFC822_SIZE) {
474 size = item->att_data.att_static->att_data.att_rfc822_size; 484 //size = item->att_data.att_static->att_data.att_rfc822_size;
485 m->setMsgsize(item->att_data.att_static->att_data.att_rfc822_size);
475 } 486 }
@@ -483,3 +494,2 @@ RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att)
483 m->setFlags(mFlags); 494 m->setFlags(mFlags);
484 m->setMsgsize(size);
485 } 495 }
diff --git a/noncore/net/mail/libmailwrapper/mhwrapper.cpp b/noncore/net/mail/libmailwrapper/mhwrapper.cpp
index 403afcf..765a21c 100644
--- a/noncore/net/mail/libmailwrapper/mhwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/mhwrapper.cpp
diff --git a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp
index 3cfd1ee..2d66fc9 100644
--- a/noncore/net/mail/libmailwrapper/pop3wrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/pop3wrapper.cpp
@@ -9,2 +9,3 @@
9#include <qfile.h> 9#include <qfile.h>
10#include <qmessagebox.h>
10 11
@@ -20,2 +21,4 @@ POP3wrapper::POP3wrapper( POP3account *a )
20 last_msg_id = 0; 21 last_msg_id = 0;
22 m_maxsize = account->getMaxSize();
23 m_checksize = account->getCheckMaxSize();
21} 24}
@@ -47,4 +50,8 @@ RecBodyP POP3wrapper::fetchBody( const RecMailP &mail ) {
47 mailmessage * mailmsg; 50 mailmessage * mailmsg;
48 if (mail->Msgsize()>HARD_MSG_SIZE_LIMIT) { 51 if (mail->Msgsize()/1024>m_maxsize && m_checksize && mail->getNumber()!=last_msg_id) {
52 QString quest = QString(tr("Download mail?\nIt is %1 kByte but your limit is %2 kByte")).arg(mail->Msgsize()/1024).arg(m_maxsize);
53 int yesno = QMessageBox::warning(0,tr("Download message"),
54 quest,tr("Yes"),tr("No"),QString::null,0,1);
49 odebug << "Message to large: " << mail->Msgsize() << "" << oendl; 55 odebug << "Message to large: " << mail->Msgsize() << "" << oendl;
56 if (yesno==1)
50 return body; 57 return body;
diff --git a/noncore/net/mail/libmailwrapper/pop3wrapper.h b/noncore/net/mail/libmailwrapper/pop3wrapper.h
index 5101fa5..8c36cf9 100644
--- a/noncore/net/mail/libmailwrapper/pop3wrapper.h
+++ b/noncore/net/mail/libmailwrapper/pop3wrapper.h
@@ -39,2 +39,4 @@ protected:
39 mailstorage*m_pop3; 39 mailstorage*m_pop3;
40 int m_maxsize;
41 bool m_checksize;
40}; 42};
diff --git a/noncore/net/mail/libmailwrapper/settings.cpp b/noncore/net/mail/libmailwrapper/settings.cpp
index 3c9b25c..09be91b 100644
--- a/noncore/net/mail/libmailwrapper/settings.cpp
+++ b/noncore/net/mail/libmailwrapper/settings.cpp
@@ -18,3 +18,2 @@
18 18
19
20Settings::Settings() 19Settings::Settings()
@@ -215,2 +214,4 @@ POP3account::POP3account()
215 port = POP3_PORT; 214 port = POP3_PORT;
215 m_CheckSize = true;
216 m_MaxSize = 1024;
216} 217}
@@ -226,2 +227,4 @@ POP3account::POP3account( QString filename )
226 port = POP3_PORT; 227 port = POP3_PORT;
228 m_CheckSize = true;
229 m_MaxSize = 1024;
227} 230}
@@ -255,2 +258,4 @@ void POP3account::read()
255 offline = conf->readBoolEntry("Offline",false); 258 offline = conf->readBoolEntry("Offline",false);
259 m_CheckSize = conf->readBoolEntry("Checkmaxsize",true);
260 m_MaxSize = conf->readNumEntry("Maxsize",1024);
256 delete conf; 261 delete conf;
@@ -273,2 +278,4 @@ void POP3account::save()
273 conf->writeEntry( "Offline",offline); 278 conf->writeEntry( "Offline",offline);
279 conf->writeEntry("Checkmaxsize",m_CheckSize);
280 conf->writeEntry("Maxsize",m_MaxSize);
274 conf->write(); 281 conf->write();
@@ -283,2 +290,22 @@ QString POP3account::getFileName()
283 290
291bool POP3account::getCheckMaxSize()const
292{
293 return m_CheckSize;
294}
295
296void POP3account::setCheckMaxSize(bool aValue)
297{
298 m_CheckSize = aValue;
299}
300
301int POP3account::getMaxSize()const
302{
303 return m_MaxSize;
304}
305
306void POP3account::setMaxSize(int aValue)
307{
308 m_MaxSize = aValue;
309}
310
284SMTPaccount::SMTPaccount() 311SMTPaccount::SMTPaccount()
diff --git a/noncore/net/mail/libmailwrapper/settings.h b/noncore/net/mail/libmailwrapper/settings.h
index bf27b97..8683a05 100644
--- a/noncore/net/mail/libmailwrapper/settings.h
+++ b/noncore/net/mail/libmailwrapper/settings.h
@@ -91,2 +91,6 @@ public:
91 virtual QString getFileName(); 91 virtual QString getFileName();
92 virtual bool getCheckMaxSize()const;
93 virtual void setCheckMaxSize(bool);
94 virtual int getMaxSize()const;
95 virtual void setMaxSize(int);
92 96
@@ -94,3 +98,4 @@ private:
94 QString file; 98 QString file;
95 99 bool m_CheckSize;
100 int m_MaxSize;
96}; 101};
diff --git a/noncore/net/mail/pop3configui.ui b/noncore/net/mail/pop3configui.ui
index 1014ef4..e560661 100644
--- a/noncore/net/mail/pop3configui.ui
+++ b/noncore/net/mail/pop3configui.ui
@@ -13,3 +13,3 @@
13 <y>0</y> 13 <y>0</y>
14 <width>314</width> 14 <width>302</width>
15 <height>410</height> 15 <height>410</height>
@@ -30,3 +30,3 @@
30 <name>margin</name> 30 <name>margin</name>
31 <number>3</number> 31 <number>11</number>
32 </property> 32 </property>
@@ -34,3 +34,3 @@
34 <name>spacing</name> 34 <name>spacing</name>
35 <number>3</number> 35 <number>6</number>
36 </property> 36 </property>
@@ -321,2 +321,60 @@
321 </widget> 321 </widget>
322 <widget>
323 <class>QCheckBox</class>
324 <property stdset="1">
325 <name>name</name>
326 <cstring>m_CheckSize</cstring>
327 </property>
328 <property stdset="1">
329 <name>text</name>
330 <string>ask before downloading large mails</string>
331 </property>
332 </widget>
333 <widget>
334 <class>QLayoutWidget</class>
335 <property stdset="1">
336 <name>name</name>
337 <cstring>Layout9</cstring>
338 </property>
339 <grid>
340 <property stdset="1">
341 <name>margin</name>
342 <number>0</number>
343 </property>
344 <property stdset="1">
345 <name>spacing</name>
346 <number>6</number>
347 </property>
348 <widget row="0" column="0" >
349 <class>QLabel</class>
350 <property stdset="1">
351 <name>name</name>
352 <cstring>m_MailLimitLabel</cstring>
353 </property>
354 <property stdset="1">
355 <name>text</name>
356 <string>Large mail size (kb):</string>
357 </property>
358 </widget>
359 <widget row="0" column="1" >
360 <class>QSpinBox</class>
361 <property stdset="1">
362 <name>name</name>
363 <cstring>m_MailLimitBox</cstring>
364 </property>
365 <property stdset="1">
366 <name>suffix</name>
367 <string> kB</string>
368 </property>
369 <property stdset="1">
370 <name>maxValue</name>
371 <number>5120</number>
372 </property>
373 <property stdset="1">
374 <name>minValue</name>
375 <number>1</number>
376 </property>
377 </widget>
378 </grid>
379 </widget>
322 <spacer> 380 <spacer>
@@ -348,4 +406,8 @@
348 <tabstop>portLine</tabstop> 406 <tabstop>portLine</tabstop>
407 <tabstop>ComboBox1</tabstop>
408 <tabstop>CommandEdit</tabstop>
349 <tabstop>userLine</tabstop> 409 <tabstop>userLine</tabstop>
350 <tabstop>passLine</tabstop> 410 <tabstop>passLine</tabstop>
411 <tabstop>m_CheckSize</tabstop>
412 <tabstop>m_MailLimitBox</tabstop>
351</tabstops> 413</tabstops>