summaryrefslogtreecommitdiffabout
path: root/kmicromail
authorzautrix <zautrix>2004-07-03 17:56:43 (UTC)
committer zautrix <zautrix>2004-07-03 17:56:43 (UTC)
commit5e6a0e28ecc7c4bf1eb7ad8637c99e1689623ed5 (patch) (side-by-side diff)
tree9305757fd40e54bf695c67014739d2cbfe785842 /kmicromail
parent160c17bf54944df96c2c67f7c3d14882163bdbf7 (diff)
downloadkdepimpi-5e6a0e28ecc7c4bf1eb7ad8637c99e1689623ed5.zip
kdepimpi-5e6a0e28ecc7c4bf1eb7ad8637c99e1689623ed5.tar.gz
kdepimpi-5e6a0e28ecc7c4bf1eb7ad8637c99e1689623ed5.tar.bz2
bugfix of date in listview
Diffstat (limited to 'kmicromail') (more/less context) (show whitespace changes)
-rw-r--r--kmicromail/mailistviewitem.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/kmicromail/mailistviewitem.cpp b/kmicromail/mailistviewitem.cpp
index 6073da6..b9b4cd9 100644
--- a/kmicromail/mailistviewitem.cpp
+++ b/kmicromail/mailistviewitem.cpp
@@ -1,115 +1,115 @@
#include "mailistviewitem.h"
#include <libmailwrapper/abstractmail.h>
#include <qtextstream.h>
#include <kiconloader.h>
//#include <qpe/resource.h>
MailListViewItem::MailListViewItem(QListView * parent, MailListViewItem * item )
:QListViewItem(parent,item),mail_data()
{
}
void MailListViewItem::showEntry()
{
if ( mail_data->getFlags().testBit( FLAG_ANSWERED ) == true) {
setPixmap( 0, SmallIcon ( "kmmsgreplied") );
} else if ( mail_data->getFlags().testBit( FLAG_SEEN ) == true ) {
/* I think it looks nicer if there are not such a log of icons but only on mails
replied or new - Alwin*/
//setPixmap( 0,SmallIcon ("kmmsgunseen") );
} else {
setPixmap( 0,SmallIcon ( "kmmsgnew") );
}
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,fsize);
QString date = mail_data->getDate();
int kom = date.find( ",")+2;
if ( kom == 1 )
kom = 0;
if ( date.mid(kom,1) == " ")
++kom;
if ( date.mid(kom+1,1) == " " )
date = "0" + date.mid( kom );
else if ( kom )
date = date.mid( kom );
if ( kom || date.mid(2,1 ) == " ") {
QString mon = date.mid(3,3);
QString so = 00;
if ( mon == "Jan" )
so = "01";
else if ( mon == "Feb" )
so = "02";
else if ( mon == "Mar" )
so = "03";
else if ( mon == "Apr" )
so = "04";
else if ( mon == "May" )
so = "05";
else if ( mon == "Jun" )
so = "06";
else if ( mon == "Jul" )
so = "07";
else if ( mon == "Aug" )
so = "08";
else if ( mon == "Sep" )
so = "09";
else if ( mon == "Oct" )
so = "10";
else if ( mon == "Nov" )
so = "11";
else if ( mon == "Dec" )
so = "12";
- date = date.mid(7,4)+"-"+so+"-"+date.left(2)+"-"+date.mid(12);
+ date = date.mid(7,4)+"-"+so+"-"+date.left(2)+" "+date.mid(12,14);
}
// if ( date.left(1) != "1" || date.left(1) != "2" )
// date = date.mid(5);
setText(4,date);
}
void MailListViewItem::storeData(const RecMailP&data)
{
mail_data = data;
}
const RecMailP& MailListViewItem::data()const
{
return mail_data;
}
MAILLIB::ATYPE MailListViewItem::wrapperType()
{
if (!mail_data->Wrapper()) return MAILLIB::A_UNDEFINED;
return mail_data->Wrapper()->getType();
}