author | alwin <alwin> | 2003-12-19 19:29:26 (UTC) |
---|---|---|
committer | alwin <alwin> | 2003-12-19 19:29:26 (UTC) |
commit | b66e2d718769a3ac1ae6bc1fc135c04f532bdbf3 (patch) (side-by-side diff) | |
tree | 0fc344b67049b17c1c9dd010a915ef4a8a644256 | |
parent | 71aa0d1be1970a105d3324fcff5d88f3e042b3cd (diff) | |
download | opie-b66e2d718769a3ac1ae6bc1fc135c04f532bdbf3.zip opie-b66e2d718769a3ac1ae6bc1fc135c04f532bdbf3.tar.gz opie-b66e2d718769a3ac1ae6bc1fc135c04f532bdbf3.tar.bz2 |
-size of mail will be displayed
-only new/replied mail get an icon, I think it looks somewhat cleaner
-rw-r--r-- | noncore/net/mail/mainwindow.cpp | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/noncore/net/mail/mainwindow.cpp b/noncore/net/mail/mainwindow.cpp index 89530ab..9a37510 100644 --- a/noncore/net/mail/mainwindow.cpp +++ b/noncore/net/mail/mainwindow.cpp @@ -6,2 +6,3 @@ #include <qmessagebox.h> +#include <qtextstream.h> @@ -95,2 +96,3 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) mailView->addColumn( tr( "Sender" ),QListView::Manual ); + mailView->addColumn( tr( "Size" ),QListView::Manual); mailView->addColumn( tr( "Date" )); @@ -138,2 +140,3 @@ void MainWindow::slotAdjustColumns() mailView->setColumnWidth( 3, 50 ); + mailView->setColumnWidth( 4, 50 ); } @@ -204,3 +207,5 @@ void MailListViewItem::showEntry() } else if ( mail_data.getFlags().testBit( FLAG_SEEN ) == true ) { - setPixmap( 0, Resource::loadPixmap( "mail/kmmsgunseen") ); + /* I think it looks nicer if there are not such a log of icons but only on mails + replied or new - Alwin*/ + //setPixmap( 0, Resource::loadPixmap( "mail/kmmsgunseen") ); } else { @@ -208,5 +213,36 @@ void MailListViewItem::showEntry() } + double s = mail_data.Msgsize(); + int w; + w=0; + + while (s>1024) { + s/=1024; + ++w; + if (w>=2) break; + } + + QString q=""; + QString fsize=""; + switch(w) { + case 1: + q="k"; + break; + case 2: + q="M"; + break; + default: + break; + } + + { + QTextOStream o(&fsize); + if (w>0) o.precision(2); else o.precision(0); + o.setf(QTextStream::fixed); + o << s << " " << q << "Byte"; + } + setText(1,mail_data.getSubject()); setText(2,mail_data.getFrom()); - setText(3,mail_data.getDate()); + setText(3,fsize); + setText(4,mail_data.getDate()); } |