[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kmail-devel
Subject:    patch for mail sizes
From:       Eduardo Dominguez <edmz () yahoo ! com>
Date:       2001-06-28 19:26:15
[Download RAW message or body]

I modified kmheaders so that mail sizes get displayed
in KB/MB instead of just bytes.
  This is my first patch ever, trying to understand how kmail
works. So I am sending this patch more as a RFC than any
other thing. I am not sure if my patch affects something
else and I know I am not doing it the best way possible.
I am just trying to learn, so dont be harsh on me :)

   Thanks in advance

-- 
edmz


["kmail.diff" (text/x-diff)]

? kmail.patch
Index: kmheaders.cpp
===================================================================
RCS file: /home/kde/kdenetwork/kmail/kmheaders.cpp,v
retrieving revision 1.302
diff -u -b -p -u -3 -p -r1.302 kmheaders.cpp
--- kmheaders.cpp	2001/06/16 15:42:39	1.302
+++ kmheaders.cpp	2001/06/28 18:17:46
@@ -207,8 +207,19 @@ public:
         tmp = KMHeaders::formatDate(mMsgBase->date(), headers->paintInfo()->dateDisplay );
     } else if(col == headers->paintInfo()->sizeCol
       && headers->paintInfo()->showSize) {
-        tmp.setNum(mMsgBase->msgSize());
-
+    	int tmpSize = mMsgBase->msgSize() >> 10;
+		if( tmpSize < 1024 ){
+		  if(!tmpSize)
+			tmpSize=1;
+		  tmp.setNum(tmpSize);
+		  tmp.append("KB");
+    	}else{
+		  tmpSize >>= 10;
+		  if(!tmpSize)
+			tmpSize=1;
+		  tmp.setNum(tmpSize);
+		  tmp.append("MB");
+		}
     } else if(col == headers->paintInfo()->scoreCol) {
       tmp.setNum(headers->messageScore(mMsgId));
     }

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

_______________________________________________
Kmail Developers mailing list
Kmail@master.kde.org
http://master.kde.org/mailman/listinfo/kmail


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic