summaryrefslogtreecommitdiff
path: root/noncore/net/mail/viewmail.cpp
authoralwin <alwin>2004-03-18 18:00:18 (UTC)
committer alwin <alwin>2004-03-18 18:00:18 (UTC)
commitfef9cec046fcf21a4f762c36454b8f253dd3e25e (patch) (side-by-side diff)
treeb87ee38164e1e9ce635dde34c13677f09388c058 /noncore/net/mail/viewmail.cpp
parent69fa0e7b5cab5f4cdfdac736e31ff0fd0fbf4312 (diff)
downloadopie-fef9cec046fcf21a4f762c36454b8f253dd3e25e.zip
opie-fef9cec046fcf21a4f762c36454b8f253dd3e25e.tar.gz
opie-fef9cec046fcf21a4f762c36454b8f253dd3e25e.tar.bz2
some (hopeful) improvements
Diffstat (limited to 'noncore/net/mail/viewmail.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/viewmail.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/noncore/net/mail/viewmail.cpp b/noncore/net/mail/viewmail.cpp
index f00d2cb..156e11d 100644
--- a/noncore/net/mail/viewmail.cpp
+++ b/noncore/net/mail/viewmail.cpp
@@ -75,28 +75,28 @@ AttachItem* ViewMail::lastChild(AttachItem*parent)
{
item = temp;
}
return item;
}
-void ViewMail::setBody( RecBody body )
+void ViewMail::setBody(const RecBodyP&body )
{
m_body = body;
- m_mail[2] = body.Bodytext();
- attachbutton->setEnabled(body.Parts().count()>0);
- attachments->setEnabled(body.Parts().count()>0);
- if (body.Parts().count()==0)
+ m_mail[2] = body->Bodytext();
+ attachbutton->setEnabled(body->Parts().count()>0);
+ attachments->setEnabled(body->Parts().count()>0);
+ if (body->Parts().count()==0)
{
return;
}
AttachItem * curItem=0;
AttachItem * parentItem = 0;
- QString type=body.Description().Type()+"/"+body.Description().Subtype();
+ QString type=body->Description()->Type()+"/"+body->Description()->Subtype();
QString desc,fsize;
- double s = body.Description().Size();
+ double s = body->Description()->Size();
int w;
w=0;
while (s>1024)
{
s/=1024;
@@ -126,29 +126,29 @@ void ViewMail::setBody( RecBody body )
QTextOStream o(&fsize);
if (w>0) o.precision(2); else o.precision(0);
o.setf(QTextStream::fixed);
o << s << " " << q << "Byte";
}
- curItem=new AttachItem(attachments,curItem,type,"Mailbody","",fsize,-1,body.Description().Positionlist());
+ curItem=new AttachItem(attachments,curItem,type,"Mailbody","",fsize,-1,body->Description()->Positionlist());
QString filename = "";
- for (unsigned int i = 0; i < body.Parts().count();++i)
+ for (unsigned int i = 0; i < body->Parts().count();++i)
{
filename = "";
- type = body.Parts()[i].Type()+"/"+body.Parts()[i].Subtype();
- part_plist_t::ConstIterator it = body.Parts()[i].Parameters().begin();
- for (;it!=body.Parts()[i].Parameters().end();++it)
+ type = body->Parts()[i]->Type()+"/"+body->Parts()[i]->Subtype();
+ part_plist_t::ConstIterator it = body->Parts()[i]->Parameters().begin();
+ for (;it!=body->Parts()[i]->Parameters().end();++it)
{
qDebug(it.key());
if (it.key().lower()=="name")
{
filename=it.data();
}
}
- s = body.Parts()[i].Size();
+ s = body->Parts()[i]->Size();
w = 0;
while (s>1024)
{
s/=1024;
++w;
if (w>=2) break;
@@ -166,25 +166,25 @@ void ViewMail::setBody( RecBody body )
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());
+ desc = body->Parts()[i]->Description();
+ parentItem = searchParent(body->Parts()[i]->Positionlist());
if (parentItem)
{
AttachItem*temp = lastChild(parentItem);
if (temp) curItem = temp;
- curItem=new AttachItem(parentItem,curItem,type,desc,filename,fsize,i,body.Parts()[i].Positionlist());
+ 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());
+ curItem=new AttachItem(attachments,curItem,type,desc,filename,fsize,i,body->Parts()[i]->Positionlist());
}
}
}
void ViewMail::slotShowHtml( bool state )
@@ -223,13 +223,13 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int
types.insert( "all", "*" );
QString str = OFileDialog::getSaveFileName( 1,
"/", item->text( 2 ) , types, 0 );
if( !str.isEmpty() )
{
- encodedString*content = m_recMail->Wrapper()->fetchDecodedPart( m_recMail, m_body.Parts()[ ( ( AttachItem* )item )->Partnumber() ] );
+ encodedString*content = m_recMail->Wrapper()->fetchDecodedPart( m_recMail, m_body->Parts()[ ( ( AttachItem* )item )->Partnumber() ] );
if (content)
{
QFile output(str);
output.open(IO_WriteOnly);
output.writeBlock(content->Content(),content->Length());
output.close();
@@ -245,22 +245,22 @@ void ViewMail::slotItemClicked( QListViewItem * item , const QPoint & point, int
setText();
}
else
{
if ( m_recMail->Wrapper() != 0l )
{ // make sure that there is a wrapper , even after delete or simular actions
- browser->setText( m_recMail->Wrapper()->fetchTextPart( m_recMail, m_body.Parts()[ ( ( AttachItem* )item )->Partnumber() ] ) );
+ browser->setText( m_recMail->Wrapper()->fetchTextPart( m_recMail, m_body->Parts()[ ( ( AttachItem* )item )->Partnumber() ] ) );
}
}
break;
}
delete menu;
}
-void ViewMail::setMail( RecMailP mail )
+void ViewMail::setMail(const RecMailP&mail )
{
m_recMail = mail;
m_mail[0] = mail->getFrom();
m_mail[1] = mail->getSubject();