summaryrefslogtreecommitdiffabout
path: root/kmicromail
Side-by-side diff
Diffstat (limited to 'kmicromail') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/libmailwrapper/mailtypes.cpp5
-rw-r--r--kmicromail/libmailwrapper/mailtypes.h18
2 files changed, 18 insertions, 5 deletions
diff --git a/kmicromail/libmailwrapper/mailtypes.cpp b/kmicromail/libmailwrapper/mailtypes.cpp
index 96d55e6..70a0ab5 100644
--- a/kmicromail/libmailwrapper/mailtypes.cpp
+++ b/kmicromail/libmailwrapper/mailtypes.cpp
@@ -31,4 +31,4 @@ static bool stringCompareRec( const QString& s1, const QString& s2 )
}
-
-const QString RecMail::MsgsizeString() const
+#if 0
+QString RecMail::MsgsizeString() const
{
@@ -49,2 +49,3 @@ const QString RecMail::MsgsizeString() const
}
+#endif
bool RecMail::isEqual( RecMail* r1 )
diff --git a/kmicromail/libmailwrapper/mailtypes.h b/kmicromail/libmailwrapper/mailtypes.h
index 39c0bac..97f10d7 100644
--- a/kmicromail/libmailwrapper/mailtypes.h
+++ b/kmicromail/libmailwrapper/mailtypes.h
@@ -57,5 +57,17 @@ public:
const unsigned int Msgsize()const{return msg_size;}
- const QString MsgsizeString()const;
-
-
+ const QString MsgsizeString()const {
+ double s = msg_size;
+ int w = 0;
+ s/=1024;
+ if (s>999.0) {
+ s/=1024.0;
+ ++w;
+ }
+ QString fsize = QString::number( s, 'f', 2 );
+ if ( w == 0 ) {
+ fsize += "kB" ;
+ } else
+ fsize += "MB" ;
+ return fsize;
+ };
void setTo(const QStringList&list);