summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt4
-rw-r--r--kmicromail/accountview.h2
-rw-r--r--kmicromail/libmailwrapper/mailtypes.cpp17
-rw-r--r--kmicromail/libmailwrapper/mailtypes.h1
-rw-r--r--kmicromail/mailistviewitem.cpp24
-rw-r--r--kmicromail/opiemail.cpp38
-rw-r--r--kmicromail/viewmail.cpp7
7 files changed, 72 insertions, 21 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index 2516b2a..42b36f1 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -10,29 +10,31 @@ to "day after tomorrow".
10Made it possible to delete a Todo, which has sub-todos. 10Made it possible to delete a Todo, which has sub-todos.
11Fixed two small problems in the todo view. 11Fixed two small problems in the todo view.
12Added missing German translation for filter edit and print dialog. 12Added missing German translation for filter edit and print dialog.
13Made search dialog closeable by cancel key. 13Made search dialog closeable by cancel key.
14 14
15Made it possible to select in the date picker the (ligt grey ) 15Made it possible to select in the date picker the (ligt grey )
16dates of the prev./next month with the mouse. 16dates of the prev./next month with the mouse.
17 17
18OM/Pi: 18OM/Pi:
19"Delete mail" icon in main window now deletes all selected mails. 19"Delete mail" icon in main window now deletes all selected mails.
20Fixed the problem, that the state flag of imap mails was ignored. 20Fixed the problem, that the state flag of imap mails was ignored.
21Now mails with "FLAG_SEEN" on the imap server get no icon in the list view 21Now mails with "FLAG_SEEN" on the imap server get no icon in the list view
22to idecate that they are already seen. 22to indecate that they are already seen.
23Fixed the problem that the body of some mails was not displayed in the 23Fixed the problem that the body of some mails was not displayed in the
24mail viewer when fetching them from the imap server directly to read them. 24mail viewer when fetching them from the imap server directly to read them.
25Made it (configurable) possible to show the "To:" field in the list view. 25Made it (configurable) possible to show the "To:" field in the list view.
26Added to the mail viewer the option "View Source" to make it possible to see the raw mail data. 26Added to the mail viewer the option "View Source" to make it possible to see the raw mail data.
27Added a "Download Mail" button to the mail viewer to quickly download the viewed mail to the
28local storage folder (specified in account setiings) of the account of the mail.
27 29
28 30
29 31
30********** VERSION 1.9.19 ************ 32********** VERSION 1.9.19 ************
31 33
32Added a lot of missing translations to KA/Pi, 34Added a lot of missing translations to KA/Pi,
33Added some missing translations to KO/Pi and OM/Pi. 35Added some missing translations to KO/Pi and OM/Pi.
34 36
35Fixed some minor problems in KA/Pi + KO/Pi. 37Fixed some minor problems in KA/Pi + KO/Pi.
36 38
37Fixed a crash when closing PwM/Pi. 39Fixed a crash when closing PwM/Pi.
38Added German translation for PwM/Pi. 40Added German translation for PwM/Pi.
diff --git a/kmicromail/accountview.h b/kmicromail/accountview.h
index fcf33d1..79ed2e7 100644
--- a/kmicromail/accountview.h
+++ b/kmicromail/accountview.h
@@ -16,25 +16,25 @@ class MHviewItem;
16class AccountView : public QListView 16class AccountView : public QListView
17{ 17{
18 Q_OBJECT 18 Q_OBJECT
19 19
20public: 20public:
21 AccountView( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 ); 21 AccountView( QWidget *parent = 0, const char *name = 0, WFlags flags = 0 );
22 virtual ~AccountView(); 22 virtual ~AccountView();
23 virtual void populate( QList<Account> list ); 23 virtual void populate( QList<Account> list );
24 virtual RecBodyP fetchBody(const Opie::Core::OSmartPointer<RecMail>&aMail); 24 virtual RecBodyP fetchBody(const Opie::Core::OSmartPointer<RecMail>&aMail);
25 virtual void downloadMails(const Opie::Core::OSmartPointer<Folder>&fromFolder,AbstractMail*fromWrapper); 25 virtual void downloadMails(const Opie::Core::OSmartPointer<Folder>&fromFolder,AbstractMail*fromWrapper);
26 virtual void downloadMailsInbox(const Opie::Core::OSmartPointer<Folder>&fromFolder,AbstractMail*fromWrapper); 26 virtual void downloadMailsInbox(const Opie::Core::OSmartPointer<Folder>&fromFolder,AbstractMail*fromWrapper);
27 virtual bool currentisDraft(); 27 virtual bool currentisDraft();
28 28 QValueList<MHviewItem*> allAccounts() { return mhAccounts;}
29public slots: 29public slots:
30 virtual void refreshAll(); 30 virtual void refreshAll();
31 virtual void refresh(QListViewItem *item); 31 virtual void refresh(QListViewItem *item);
32 virtual void refreshCurrent(); 32 virtual void refreshCurrent();
33 virtual void slotHold(int, QListViewItem *,const QPoint&,int); 33 virtual void slotHold(int, QListViewItem *,const QPoint&,int);
34 virtual void slotContextMenu(int id); 34 virtual void slotContextMenu(int id);
35 void setupFolderselect(Selectstore*sels); 35 void setupFolderselect(Selectstore*sels);
36 36
37signals: 37signals:
38 void refreshMailview(const QValueList<RecMailP>& ); 38 void refreshMailview(const QValueList<RecMailP>& );
39 39
40protected: 40protected:
diff --git a/kmicromail/libmailwrapper/mailtypes.cpp b/kmicromail/libmailwrapper/mailtypes.cpp
index 89150ad..96d55e6 100644
--- a/kmicromail/libmailwrapper/mailtypes.cpp
+++ b/kmicromail/libmailwrapper/mailtypes.cpp
@@ -21,24 +21,41 @@ RecMail::RecMail(const RecMail&old)
21 21
22RecMail::~RecMail() 22RecMail::~RecMail()
23{ 23{
24 wrapper = 0; 24 wrapper = 0;
25} 25}
26static bool stringCompareRec( const QString& s1, const QString& s2 ) 26static bool stringCompareRec( const QString& s1, const QString& s2 )
27{ 27{
28 if ( s1.isEmpty() && s2.isEmpty() ) 28 if ( s1.isEmpty() && s2.isEmpty() )
29 return true; 29 return true;
30 return s1 == s2; 30 return s1 == s2;
31} 31}
32 32
33const QString RecMail::MsgsizeString() const
34{
35
36 double s = msg_size;
37 int w = 0;
38 s/=1024;
39 if (s>999.0) {
40 s/=1024.0;
41 ++w;
42 }
43 QString fsize = QString::number( s, 'f', 2 );
44 if ( w == 0 ) {
45 fsize += "kB" ;
46 } else
47 fsize += "MB" ;
48 return fsize;
49}
33bool RecMail::isEqual( RecMail* r1 ) 50bool RecMail::isEqual( RecMail* r1 )
34{ 51{
35 if ( !stringCompareRec( isodate, r1->isodate ) ) { 52 if ( !stringCompareRec( isodate, r1->isodate ) ) {
36 //qDebug("date *%s* *%s* ", isodate.latin1(), r1->isodate.latin1()); 53 //qDebug("date *%s* *%s* ", isodate.latin1(), r1->isodate.latin1());
37 return false; 54 return false;
38 } 55 }
39 if ( !stringCompareRec( subject.left(40), r1->subject.left(40) ) ) { 56 if ( !stringCompareRec( subject.left(40), r1->subject.left(40) ) ) {
40 //qDebug("sub *%s* *%s*", subject.latin1(), r1->subject.latin1()); 57 //qDebug("sub *%s* *%s*", subject.latin1(), r1->subject.latin1());
41 return false; 58 return false;
42 } 59 }
43 60
44 //qDebug("date *%s* *%s* ", isodate.latin1(), r1->isodate.latin1()); 61 //qDebug("date *%s* *%s* ", isodate.latin1(), r1->isodate.latin1());
diff --git a/kmicromail/libmailwrapper/mailtypes.h b/kmicromail/libmailwrapper/mailtypes.h
index 32d92c0..39c0bac 100644
--- a/kmicromail/libmailwrapper/mailtypes.h
+++ b/kmicromail/libmailwrapper/mailtypes.h
@@ -46,24 +46,25 @@ public:
46 const QString&getFrom()const{ return from; } 46 const QString&getFrom()const{ return from; }
47 void setFrom( const QString&a ) { from = a; } 47 void setFrom( const QString&a ) { from = a; }
48 const QString&getSubject()const { return subject; } 48 const QString&getSubject()const { return subject; }
49 void setSubject( const QString&s ) { subject = s; } 49 void setSubject( const QString&s ) { subject = s; }
50 const QString&getMbox()const{return mbox;} 50 const QString&getMbox()const{return mbox;}
51 void setMbox(const QString&box){mbox = box;} 51 void setMbox(const QString&box){mbox = box;}
52 void setMsgid(const QString&id){msg_id=id;} 52 void setMsgid(const QString&id){msg_id=id;}
53 const QString&Msgid()const{return msg_id;} 53 const QString&Msgid()const{return msg_id;}
54 void setReplyto(const QString&reply){replyto=reply;} 54 void setReplyto(const QString&reply){replyto=reply;}
55 const QString&Replyto()const{return replyto;} 55 const QString&Replyto()const{return replyto;}
56 void setMsgsize(unsigned int size){msg_size = size;} 56 void setMsgsize(unsigned int size){msg_size = size;}
57 const unsigned int Msgsize()const{return msg_size;} 57 const unsigned int Msgsize()const{return msg_size;}
58 const QString MsgsizeString()const;
58 59
59 60
60 void setTo(const QStringList&list); 61 void setTo(const QStringList&list);
61 const QStringList&To()const; 62 const QStringList&To()const;
62 void setCC(const QStringList&list); 63 void setCC(const QStringList&list);
63 const QStringList&CC()const; 64 const QStringList&CC()const;
64 void setBcc(const QStringList&list); 65 void setBcc(const QStringList&list);
65 const QStringList&Bcc()const; 66 const QStringList&Bcc()const;
66 void setInreply(const QStringList&list); 67 void setInreply(const QStringList&list);
67 const QStringList&Inreply()const; 68 const QStringList&Inreply()const;
68 void setReferences(const QStringList&list); 69 void setReferences(const QStringList&list);
69 const QStringList&References()const; 70 const QStringList&References()const;
diff --git a/kmicromail/mailistviewitem.cpp b/kmicromail/mailistviewitem.cpp
index ffb835c..137c482 100644
--- a/kmicromail/mailistviewitem.cpp
+++ b/kmicromail/mailistviewitem.cpp
@@ -13,56 +13,48 @@ MailListViewItem::MailListViewItem(QListView * parent, MailListViewItem * item )
13 13
14void MailListViewItem::showEntry() 14void MailListViewItem::showEntry()
15{ 15{
16 if ( mail_data->getFlags().testBit( FLAG_ANSWERED ) == true) { 16 if ( mail_data->getFlags().testBit( FLAG_ANSWERED ) == true) {
17 setPixmap( 0, SmallIcon ( "kmmsgreplied") ); 17 setPixmap( 0, SmallIcon ( "kmmsgreplied") );
18 } else if ( mail_data->getFlags().testBit( FLAG_SEEN ) == true ) { 18 } else if ( mail_data->getFlags().testBit( FLAG_SEEN ) == true ) {
19 /* I think it looks nicer if there are not such a log of icons but only on mails 19 /* I think it looks nicer if there are not such a log of icons but only on mails
20 replied or new - Alwin*/ 20 replied or new - Alwin*/
21 //setPixmap( 0,SmallIcon ("kmmsgunseen") ); 21 //setPixmap( 0,SmallIcon ("kmmsgunseen") );
22 } else { 22 } else {
23 setPixmap( 0,SmallIcon ( "kmmsgnew") ); 23 setPixmap( 0,SmallIcon ( "kmmsgnew") );
24 } 24 }
25 double s = mail_data->Msgsize(); 25 QString fsize = mail_data->MsgsizeString();
26 int w = 0;
27 s/=1024;
28 if (s>999.0) {
29 s/=1024.0;
30 ++w;
31 }
32 QString fsort;
33 fsort.sprintf( "%.2f", s );
34 QString fsize = QString::number( s, 'f', 2 );
35 // 1.23 26 // 1.23
36 // 11.23 27 // 11.23
37 // 111.23 28 // 111.23
38 // 999.23 maxlen 29 // 999.23 maxlen
30 QString fsort;
39 switch(fsize.length() ) { 31 switch(fsize.length() ) {
40 case 4: 32 case 6:
41 fsort = "00" + fsize ; 33 fsort = "00" + fsize ;
42 break; 34 break;
43 case 5: 35 case 7:
44 fsort = "0" + fsize ; 36 fsort = "0" + fsize ;
45 break; 37 break;
46 default: 38 default:
47 fsort = fsize ; 39 fsort = fsize ;
48 break; 40 break;
49 41
50 } 42 }
51 if ( w == 0 ) { 43 setText(3, fsize );
52 setText(3, fsize + "kB" ); 44 //qDebug("fsize *%s* ",fsize.latin1() );
45 //qDebug("fsort *%s* ",fsort.latin1() );
46 if ( fsize.right(2) == "kB" ) {
53 mKeyMap.insert(3, "k" + fsort); 47 mKeyMap.insert(3, "k" + fsort);
54 //setText(3, "kB" + fsort ); // test only
55 } else { 48 } else {
56 //setText(3, fsize + "MB");
57 mKeyMap.insert(3, "M" +fsort ); 49 mKeyMap.insert(3, "M" +fsort );
58 } 50 }
59 setText(1,mail_data->getSubject()); 51 setText(1,mail_data->getSubject());
60 setText(2,mail_data->getFrom()); 52 setText(2,mail_data->getFrom());
61 mKeyMap.insert(4,mail_data->getIsoDate()); 53 mKeyMap.insert(4,mail_data->getIsoDate());
62 setText(4,mail_data->getDate()); 54 setText(4,mail_data->getDate());
63 if ( KOPrefs::instance()->mShowToField ) 55 if ( KOPrefs::instance()->mShowToField )
64 setText(5,mail_data->To()[0]); 56 setText(5,mail_data->To()[0]);
65} 57}
66 58
67void MailListViewItem::storeData(const RecMailP&data) 59void MailListViewItem::storeData(const RecMailP&data)
68{ 60{
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp
index 6e54bf4..760e3b0 100644
--- a/kmicromail/opiemail.cpp
+++ b/kmicromail/opiemail.cpp
@@ -12,24 +12,25 @@
12#ifdef MINIKDE_KDIALOG_H 12#ifdef MINIKDE_KDIALOG_H
13#undef MINIKDE_KDIALOG_H 13#undef MINIKDE_KDIALOG_H
14#endif 14#endif
15#include "settingsdialog.h" 15#include "settingsdialog.h"
16#include "opiemail.h" 16#include "opiemail.h"
17#include "editaccounts.h" 17#include "editaccounts.h"
18#include "composemail.h" 18#include "composemail.h"
19#include "mailistviewitem.h" 19#include "mailistviewitem.h"
20#include "viewmail.h" 20#include "viewmail.h"
21#include "selectstore.h" 21#include "selectstore.h"
22#include "selectsmtp.h" 22#include "selectsmtp.h"
23#include "accountitem.h" 23#include "accountitem.h"
24#include "accountview.h"
24#include "klocale.h" 25#include "klocale.h"
25 26
26#include <qmessagebox.h> 27#include <qmessagebox.h>
27#include <qtimer.h> 28#include <qtimer.h>
28#include <qcursor.h> 29#include <qcursor.h>
29#include <qtextbrowser.h> 30#include <qtextbrowser.h>
30#include <qregexp.h> 31#include <qregexp.h>
31#include <qpe/global.h> 32#include <qpe/global.h>
32 33
33#ifdef DESKTOP_VERSION 34#ifdef DESKTOP_VERSION
34#include <qapplication.h> 35#include <qapplication.h>
35#else 36#else
@@ -304,25 +305,60 @@ void OpieMail::replyMail()
304 mail->Wrapper()->answeredMail(mail); 305 mail->Wrapper()->answeredMail(mail);
305 } 306 }
306 delete settings; 307 delete settings;
307 308
308} 309}
309void OpieMail::closeViewMail(ViewMail * vm) 310void OpieMail::closeViewMail(ViewMail * vm)
310{ 311{
311 vm->hide(); 312 vm->hide();
312} 313}
313 314
314void OpieMail::slotDownloadMail( ) 315void OpieMail::slotDownloadMail( )
315{ 316{
316 qDebug("slotDownloadMail( ) "); 317 QListViewItem*item = mailView->currentItem();
318 if (!item ) {
319 Global::statusMessage("Error: No item slected!");
320 return;
321 }
322 RecMailP mail = ((MailListViewItem*)item)->data();
323 Account * acc = mail->Wrapper()->getAccount();
324 if ( !acc ) {
325 Global::statusMessage("Mail is already stored locally!");
326 return;
327 }
328 QString lfName = acc->getLocalFolder();
329 //qDebug("local folder " + lfName );
330 if ( lfName.isEmpty() )
331 lfName = acc->getAccountName();
332 AbstractMail* targetMail = folderView->allAccounts()[0]->getWrapper();
333 //qDebug("target %d %d ",targetMail,mail->Wrapper() );
334 if ( targetMail == mail->Wrapper() ) {
335 Global::statusMessage("Mail is already locally stored!");
336 return;
337 }
338 if ( !targetMail->createMbox(lfName)) {
339 Global::statusMessage("Error creating folder!");
340 return;
341 }
342 Global::statusMessage("Fetching mail...please wait!");
343 qApp->processEvents();
344 encodedString*st = 0;
345 st = mail->Wrapper()->fetchRawBody(mail);
346 if ( st ) {
347 targetMail->storeMessage(st->Content(),st->Length(),lfName);
348 Global::statusMessage("Mail stored in "+ lfName);
349 delete st;
350 } else {
351 Global::statusMessage("Error: Cannot fetch mail!");
352 }
317} 353}
318 354
319 355
320void OpieMail::deleteAndDisplayNextMail(ViewMail * vm) 356void OpieMail::deleteAndDisplayNextMail(ViewMail * vm)
321{ 357{
322 QListViewItem*item = mailView->currentItem(); 358 QListViewItem*item = mailView->currentItem();
323 if (!item ) { 359 if (!item ) {
324 closeViewMail(vm); 360 closeViewMail(vm);
325 return; 361 return;
326 } 362 }
327 RecMailP mail = ((MailListViewItem*)item)->data(); 363 RecMailP mail = ((MailListViewItem*)item)->data();
328 mail->Wrapper()->deleteMail( mail ); 364 mail->Wrapper()->deleteMail( mail );
diff --git a/kmicromail/viewmail.cpp b/kmicromail/viewmail.cpp
index 767a369..726f540 100644
--- a/kmicromail/viewmail.cpp
+++ b/kmicromail/viewmail.cpp
@@ -368,26 +368,29 @@ void ViewMail::setText()
368 368
369 viewSource->setText(i18n("View Source")); 369 viewSource->setText(i18n("View Source"));
370 sourceOn = false; 370 sourceOn = false;
371 QString toString; 371 QString toString;
372 QString ccString; 372 QString ccString;
373 QString bccString; 373 QString bccString;
374 374
375 375
376 toString = m_mail2[0].join(","); 376 toString = m_mail2[0].join(",");
377 ccString = m_mail2[1].join(","); 377 ccString = m_mail2[1].join(",");
378 bccString = m_mail2[2].join(","); 378 bccString = m_mail2[2].join(",");
379 379
380 380#ifdef DESKTOP_VERSION
381 setCaption( i18n("E-Mail by %1").arg( m_mail[0] ) ); 381 setCaption( i18n("Size: ")+m_recMail->MsgsizeString()+" - "+i18n("E-Mail by %1").arg( m_mail[0] ) );
382#else
383 setCaption( m_recMail->MsgsizeString()+" - "+m_mail[0] );
384#endif
382 385
383 m_mailHtml = "<html><body>" 386 m_mailHtml = "<html><body>"
384 "<table width=\"100%\" border=\"0\"><tr bgcolor=\"#FFDD76\"><td>" 387 "<table width=\"100%\" border=\"0\"><tr bgcolor=\"#FFDD76\"><td>"
385 "<div align=left><b>" + deHtml( m_mail[1] ) + "</b></div>" 388 "<div align=left><b>" + deHtml( m_mail[1] ) + "</b></div>"
386 "</td></tr><tr bgcolor=\"#EEEEE6\"><td>" 389 "</td></tr><tr bgcolor=\"#EEEEE6\"><td>"
387 "<b>" + i18n( "From" ) + ": </b><font color=#6C86C0>" + deHtml( m_mail[0] ) + "</font><br>" 390 "<b>" + i18n( "From" ) + ": </b><font color=#6C86C0>" + deHtml( m_mail[0] ) + "</font><br>"
388 "<b>" + i18n( "To" ) + ": </b><font color=#6C86C0>" + deHtml( toString ) + "</font><br><b>" + 391 "<b>" + i18n( "To" ) + ": </b><font color=#6C86C0>" + deHtml( toString ) + "</font><br><b>" +
389 i18n( "Cc" ) + ": </b>" + deHtml( ccString ) + "<br>" 392 i18n( "Cc" ) + ": </b>" + deHtml( ccString ) + "<br>"
390 "<b>" + i18n( "Date" ) + ": </b> " + m_mail[3] + 393 "<b>" + i18n( "Date" ) + ": </b> " + m_mail[3] +
391 "</td></tr></table><font>"; 394 "</td></tr></table><font>";
392 395
393 if ( !m_showHtml ) 396 if ( !m_showHtml )