summaryrefslogtreecommitdiffabout
path: root/kmicromail/mailistviewitem.cpp
Side-by-side diff
Diffstat (limited to 'kmicromail/mailistviewitem.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kmicromail/mailistviewitem.cpp24
1 files changed, 8 insertions, 16 deletions
diff --git a/kmicromail/mailistviewitem.cpp b/kmicromail/mailistviewitem.cpp
index ffb835c..137c482 100644
--- a/kmicromail/mailistviewitem.cpp
+++ b/kmicromail/mailistviewitem.cpp
@@ -22,25 +22,17 @@ void MailListViewItem::showEntry()
} else {
setPixmap( 0,SmallIcon ( "kmmsgnew") );
}
- double s = mail_data->Msgsize();
- int w = 0;
- s/=1024;
- if (s>999.0) {
- s/=1024.0;
- ++w;
- }
- QString fsort;
- fsort.sprintf( "%.2f", s );
- QString fsize = QString::number( s, 'f', 2 );
+ QString fsize = mail_data->MsgsizeString();
// 1.23
// 11.23
// 111.23
// 999.23 maxlen
+ QString fsort;
switch(fsize.length() ) {
- case 4:
+ case 6:
fsort = "00" + fsize ;
break;
- case 5:
+ case 7:
fsort = "0" + fsize ;
break;
default:
@@ -48,12 +40,12 @@ void MailListViewItem::showEntry()
break;
}
- if ( w == 0 ) {
- setText(3, fsize + "kB" );
+ setText(3, fsize );
+ //qDebug("fsize *%s* ",fsize.latin1() );
+ //qDebug("fsort *%s* ",fsort.latin1() );
+ if ( fsize.right(2) == "kB" ) {
mKeyMap.insert(3, "k" + fsort);
- //setText(3, "kB" + fsort ); // test only
} else {
- //setText(3, fsize + "MB");
mKeyMap.insert(3, "M" +fsort );
}
setText(1,mail_data->getSubject());