summaryrefslogtreecommitdiff
authoralwin <alwin>2004-01-03 02:15:10 (UTC)
committer alwin <alwin>2004-01-03 02:15:10 (UTC)
commit79bca648a80c42d5dc7e7674b251715292db33b3 (patch) (side-by-side diff)
tree812b854bf4b99d259462a43e1ec10f08f5d72df2
parent2e6d55ed011834320165462b64e03ea451c90ead (diff)
downloadopie-79bca648a80c42d5dc7e7674b251715292db33b3.zip
opie-79bca648a80c42d5dc7e7674b251715292db33b3.tar.gz
opie-79bca648a80c42d5dc7e7674b251715292db33b3.tar.bz2
mail attachments will be displayed in order of attachment not sorted
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/viewmail.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/noncore/net/mail/viewmail.cpp b/noncore/net/mail/viewmail.cpp
index 5e7ffeb..d4c5150 100644
--- a/noncore/net/mail/viewmail.cpp
+++ b/noncore/net/mail/viewmail.cpp
@@ -127,48 +127,49 @@ for (unsigned int i = 0; i < body.Parts().count();++i) {
s/=1024;
++w;
if (w>=2) break;
}
switch(w) {
case 1:
q="k";
break;
case 2:
q="M";
break;
default:
q="";
break;
}
QTextOStream o(&fsize);
if (w>0) o.precision(2); else o.precision(0);
o.setf(QTextStream::fixed);
o << s << " " << q << "Byte";
desc = body.Parts()[i].Description();
parentItem = searchParent(body.Parts()[i].Positionlist());
if (parentItem) {
curItem=new AttachItem(parentItem,curItem,type,desc,filename,fsize,i,body.Parts()[i].Positionlist());
attachments->setRootIsDecorated(true);
+ curItem = parentItem;
} else {
curItem=new AttachItem(attachments,curItem,type,desc,filename,fsize,i,body.Parts()[i].Positionlist());
}
}
}
void ViewMail::slotShowHtml( bool state ) {
m_showHtml = state;
setText();
}
void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int ) {
if (!item )
return;
if ( ( ( AttachItem* )item )->Partnumber() == -1 ) {
setText();
return;
}
QPopupMenu *menu = new QPopupMenu();
int ret=0;
if ( item->text( 0 ).left( 5 ) == "text/" || item->text(0)=="message/rfc822" ) {
@@ -225,49 +226,49 @@ void ViewMail::setMail( RecMail mail ) {
m_mail2[0] = mail.To();
m_mail2[1] = mail.CC();
m_mail2[2] = mail.Bcc();
setText();
}
ViewMail::ViewMail( QWidget *parent, const char *name, WFlags fl)
: ViewMailBase(parent, name, fl), _inLoop(false)
{
m_gotBody = false;
deleted = false;
connect( reply, SIGNAL(activated()), SLOT(slotReply()));
connect( forward, SIGNAL(activated()), SLOT(slotForward()));
connect( deleteMail, SIGNAL( activated() ), SLOT( slotDeleteMail( ) ) );
connect( showHtml, SIGNAL( toggled( bool ) ), SLOT( slotShowHtml( bool ) ) );
attachments->setEnabled(m_gotBody);
connect( attachments, SIGNAL( clicked ( QListViewItem *, const QPoint & , int ) ), SLOT( slotItemClicked( QListViewItem *, const QPoint & , int ) ) );
readConfig();
-
+ attachments->setSorting(-1);
}
void ViewMail::readConfig() {
Config cfg( "mail" );
cfg.setGroup( "Settings" );
m_showHtml = cfg.readBoolEntry( "showHtml", false );
showHtml->setOn( m_showHtml );
}
void ViewMail::setText()
{
QString toString;
QString ccString;
QString bccString;
for ( QStringList::Iterator it = ( m_mail2[0] ).begin(); it != ( m_mail2[0] ).end(); ++it ) {
toString += (*it);
}
for ( QStringList::Iterator it = ( m_mail2[1] ).begin(); it != ( m_mail2[1] ).end(); ++it ) {
ccString += (*it);
}
for ( QStringList::Iterator it = ( m_mail2[2] ).begin(); it != ( m_mail2[2] ).end(); ++it ) {
bccString += (*it);