summaryrefslogtreecommitdiff
path: root/noncore/net/mail/libmailwrapper/imapwrapper.cpp
Side-by-side diff
Diffstat (limited to 'noncore/net/mail/libmailwrapper/imapwrapper.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/mail/libmailwrapper/imapwrapper.cpp86
1 files changed, 43 insertions, 43 deletions
diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.cpp b/noncore/net/mail/libmailwrapper/imapwrapper.cpp
index 56e7df9..230cf53 100644
--- a/noncore/net/mail/libmailwrapper/imapwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/imapwrapper.cpp
@@ -485,5 +485,5 @@ RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att)
-RecBody IMAPwrapper::fetchBody(const RecMailP&mail)
+RecBodyP IMAPwrapper::fetchBody(const RecMailP&mail)
{
- RecBody body;
+ RecBodyP body = new RecBody();
const char *mb;
@@ -644,3 +644,3 @@ encodedString*IMAPwrapper::fetchRawPart(const RecMailP&mail,const QValueList<int
current_count means the position inside the internal loop! */
-void IMAPwrapper::traverseBody(const RecMailP&mail,mailimap_body*body,RecBody&target_body,
+void IMAPwrapper::traverseBody(const RecMailP&mail,mailimap_body*body,RecBodyP&target_body,
int current_recursion,QValueList<int>recList,int current_count)
@@ -655,6 +655,6 @@ void IMAPwrapper::traverseBody(const RecMailP&mail,mailimap_body*body,RecBody&ta
countlist.append(current_count);
- RecPart currentPart;
+ RecPartP currentPart = new RecPart();
mailimap_body_type_1part*part1 = body->bd_data.bd_body_1part;
QString id("");
- currentPart.setPositionlist(countlist);
+ currentPart->setPositionlist(countlist);
for (unsigned int j = 0; j < countlist.count();++j) {
@@ -664,3 +664,3 @@ void IMAPwrapper::traverseBody(const RecMailP&mail,mailimap_body*body,RecBody&ta
qDebug("ID = %s",id.latin1());
- currentPart.setIdentifier(id);
+ currentPart->setIdentifier(id);
fillSinglePart(currentPart,part1);
@@ -668,11 +668,11 @@ void IMAPwrapper::traverseBody(const RecMailP&mail,mailimap_body*body,RecBody&ta
And we put it only into the mail if it is the FIRST part */
- if (part1->bd_type==MAILIMAP_BODY_TYPE_1PART_TEXT && target_body.Bodytext().isNull() && countlist[0]==1) {
- QString body_text = fetchTextPart(mail,countlist,true,currentPart.Encoding());
- target_body.setDescription(currentPart);
- target_body.setBodytext(body_text);
+ if (part1->bd_type==MAILIMAP_BODY_TYPE_1PART_TEXT && target_body->Bodytext().isNull() && countlist[0]==1) {
+ QString body_text = fetchTextPart(mail,countlist,true,currentPart->Encoding());
+ target_body->setDescription(currentPart);
+ target_body->setBodytext(body_text);
if (countlist.count()>1) {
- target_body.addPart(currentPart);
+ target_body->addPart(currentPart);
}
} else {
- target_body.addPart(currentPart);
+ target_body->addPart(currentPart);
}
@@ -693,8 +693,8 @@ void IMAPwrapper::traverseBody(const RecMailP&mail,mailimap_body*body,RecBody&ta
if (current_body->bd_type==MAILIMAP_BODY_MPART) {
- RecPart targetPart;
- targetPart.setType("multipart");
+ RecPartP targetPart = new RecPart();
+ targetPart->setType("multipart");
fillMultiPart(targetPart,mailDescription);
countlist.append(current_count);
- targetPart.setPositionlist(countlist);
- target_body.addPart(targetPart);
+ targetPart->setPositionlist(countlist);
+ target_body->addPart(targetPart);
QString id("");
@@ -719,3 +719,3 @@ void IMAPwrapper::traverseBody(const RecMailP&mail,mailimap_body*body,RecBody&ta
-void IMAPwrapper::fillSinglePart(RecPart&target_part,mailimap_body_type_1part*Description)
+void IMAPwrapper::fillSinglePart(RecPartP&target_part,mailimap_body_type_1part*Description)
{
@@ -726,3 +726,3 @@ void IMAPwrapper::fillSinglePart(RecPart&target_part,mailimap_body_type_1part*De
case MAILIMAP_BODY_TYPE_1PART_TEXT:
- target_part.setType("text");
+ target_part->setType("text");
fillSingleTextPart(target_part,Description->bd_data.bd_type_text);
@@ -733,3 +733,3 @@ void IMAPwrapper::fillSinglePart(RecPart&target_part,mailimap_body_type_1part*De
case MAILIMAP_BODY_TYPE_1PART_MSG:
- target_part.setType("message");
+ target_part->setType("message");
fillSingleMsgPart(target_part,Description->bd_data.bd_type_msg);
@@ -741,3 +741,3 @@ void IMAPwrapper::fillSinglePart(RecPart&target_part,mailimap_body_type_1part*De
-void IMAPwrapper::fillSingleTextPart(RecPart&target_part,mailimap_body_type_text*which)
+void IMAPwrapper::fillSingleTextPart(RecPartP&target_part,mailimap_body_type_text*which)
{
@@ -749,4 +749,4 @@ void IMAPwrapper::fillSingleTextPart(RecPart&target_part,mailimap_body_type_text
qDebug("Type= text/%s",which->bd_media_text);
- target_part.setSubtype(sub.lower());
- target_part.setLines(which->bd_lines);
+ target_part->setSubtype(sub.lower());
+ target_part->setLines(which->bd_lines);
fillBodyFields(target_part,which->bd_fields);
@@ -754,3 +754,3 @@ void IMAPwrapper::fillSingleTextPart(RecPart&target_part,mailimap_body_type_text
-void IMAPwrapper::fillSingleMsgPart(RecPart&target_part,mailimap_body_type_msg*which)
+void IMAPwrapper::fillSingleMsgPart(RecPartP&target_part,mailimap_body_type_msg*which)
{
@@ -759,6 +759,6 @@ void IMAPwrapper::fillSingleMsgPart(RecPart&target_part,mailimap_body_type_msg*w
}
- target_part.setSubtype("rfc822");
+ target_part->setSubtype("rfc822");
qDebug("Message part");
/* we set this type to text/plain */
- target_part.setLines(which->bd_lines);
+ target_part->setLines(which->bd_lines);
fillBodyFields(target_part,which->bd_fields);
@@ -766,3 +766,3 @@ void IMAPwrapper::fillSingleMsgPart(RecPart&target_part,mailimap_body_type_msg*w
-void IMAPwrapper::fillMultiPart(RecPart&target_part,mailimap_body_type_mpart*which)
+void IMAPwrapper::fillMultiPart(RecPartP&target_part,mailimap_body_type_mpart*which)
{
@@ -770,3 +770,3 @@ void IMAPwrapper::fillMultiPart(RecPart&target_part,mailimap_body_type_mpart*whi
QString sub = which->bd_media_subtype;
- target_part.setSubtype(sub.lower());
+ target_part->setSubtype(sub.lower());
if (which->bd_ext_mpart && which->bd_ext_mpart->bd_parameter && which->bd_ext_mpart->bd_parameter->pa_list) {
@@ -777,3 +777,3 @@ void IMAPwrapper::fillMultiPart(RecPart&target_part,mailimap_body_type_mpart*whi
if (param) {
- target_part.addParameter(QString(param->pa_name).lower(),QString(param->pa_value));
+ target_part->addParameter(QString(param->pa_name).lower(),QString(param->pa_value));
}
@@ -783,3 +783,3 @@ void IMAPwrapper::fillMultiPart(RecPart&target_part,mailimap_body_type_mpart*whi
-void IMAPwrapper::fillSingleBasicPart(RecPart&target_part,mailimap_body_type_basic*which)
+void IMAPwrapper::fillSingleBasicPart(RecPartP&target_part,mailimap_body_type_basic*which)
{
@@ -820,4 +820,4 @@ void IMAPwrapper::fillSingleBasicPart(RecPart&target_part,mailimap_body_type_bas
qDebug("Type = %s/%s",type.latin1(),sub.latin1());
- target_part.setType(type.lower());
- target_part.setSubtype(sub.lower());
+ target_part->setType(type.lower());
+ target_part->setSubtype(sub.lower());
fillBodyFields(target_part,which->bd_fields);
@@ -825,3 +825,3 @@ void IMAPwrapper::fillSingleBasicPart(RecPart&target_part,mailimap_body_type_bas
-void IMAPwrapper::fillBodyFields(RecPart&target_part,mailimap_body_fields*which)
+void IMAPwrapper::fillBodyFields(RecPartP&target_part,mailimap_body_fields*which)
{
@@ -834,3 +834,3 @@ void IMAPwrapper::fillBodyFields(RecPart&target_part,mailimap_body_fields*which)
if (param) {
- target_part.addParameter(QString(param->pa_name).lower(),QString(param->pa_value));
+ target_part->addParameter(QString(param->pa_name).lower(),QString(param->pa_value));
}
@@ -866,6 +866,6 @@ void IMAPwrapper::fillBodyFields(RecPart&target_part,mailimap_body_fields*which)
if (which->bd_description) {
- target_part.setDescription(QString(which->bd_description));
+ target_part->setDescription(QString(which->bd_description));
}
- target_part.setEncoding(encoding);
- target_part.setSize(which->bd_size);
+ target_part->setEncoding(encoding);
+ target_part->setSize(which->bd_size);
}
@@ -950,11 +950,11 @@ QString IMAPwrapper::fetchTextPart(const RecMailP&mail,const QValueList<int>&pat
-QString IMAPwrapper::fetchTextPart(const RecMailP&mail,const RecPart&part)
+QString IMAPwrapper::fetchTextPart(const RecMailP&mail,const RecPartP&part)
{
- return fetchTextPart(mail,part.Positionlist(),false,part.Encoding());
+ return fetchTextPart(mail,part->Positionlist(),false,part->Encoding());
}
-encodedString* IMAPwrapper::fetchDecodedPart(const RecMailP&mail,const RecPart&part)
+encodedString* IMAPwrapper::fetchDecodedPart(const RecMailP&mail,const RecPartP&part)
{
- encodedString*res = fetchRawPart(mail,part.Positionlist(),false);
- encodedString*r = decode_String(res,part.Encoding());
+ encodedString*res = fetchRawPart(mail,part->Positionlist(),false);
+ encodedString*r = decode_String(res,part->Encoding());
delete res;
@@ -963,5 +963,5 @@ encodedString* IMAPwrapper::fetchDecodedPart(const RecMailP&mail,const RecPart&p
-encodedString* IMAPwrapper::fetchRawPart(const RecMailP&mail,const RecPart&part)
+encodedString* IMAPwrapper::fetchRawPart(const RecMailP&mail,const RecPartP&part)
{
- return fetchRawPart(mail,part.Positionlist(),false);
+ return fetchRawPart(mail,part->Positionlist(),false);
}