Diffstat (limited to 'noncore/net/mail/libmailwrapper/imapwrapper.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/mail/libmailwrapper/imapwrapper.cpp | 86 |
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) | |||
485 | 485 | ||
486 | RecBody IMAPwrapper::fetchBody(const RecMailP&mail) | 486 | RecBodyP IMAPwrapper::fetchBody(const RecMailP&mail) |
487 | { | 487 | { |
488 | RecBody body; | 488 | RecBodyP body = new RecBody(); |
489 | const char *mb; | 489 | const char *mb; |
@@ -644,3 +644,3 @@ encodedString*IMAPwrapper::fetchRawPart(const RecMailP&mail,const QValueList<int | |||
644 | current_count means the position inside the internal loop! */ | 644 | current_count means the position inside the internal loop! */ |
645 | void IMAPwrapper::traverseBody(const RecMailP&mail,mailimap_body*body,RecBody&target_body, | 645 | void IMAPwrapper::traverseBody(const RecMailP&mail,mailimap_body*body,RecBodyP&target_body, |
646 | int current_recursion,QValueList<int>recList,int current_count) | 646 | int current_recursion,QValueList<int>recList,int current_count) |
@@ -655,6 +655,6 @@ void IMAPwrapper::traverseBody(const RecMailP&mail,mailimap_body*body,RecBody&ta | |||
655 | countlist.append(current_count); | 655 | countlist.append(current_count); |
656 | RecPart currentPart; | 656 | RecPartP currentPart = new RecPart(); |
657 | mailimap_body_type_1part*part1 = body->bd_data.bd_body_1part; | 657 | mailimap_body_type_1part*part1 = body->bd_data.bd_body_1part; |
658 | QString id(""); | 658 | QString id(""); |
659 | currentPart.setPositionlist(countlist); | 659 | currentPart->setPositionlist(countlist); |
660 | for (unsigned int j = 0; j < countlist.count();++j) { | 660 | for (unsigned int j = 0; j < countlist.count();++j) { |
@@ -664,3 +664,3 @@ void IMAPwrapper::traverseBody(const RecMailP&mail,mailimap_body*body,RecBody&ta | |||
664 | qDebug("ID = %s",id.latin1()); | 664 | qDebug("ID = %s",id.latin1()); |
665 | currentPart.setIdentifier(id); | 665 | currentPart->setIdentifier(id); |
666 | fillSinglePart(currentPart,part1); | 666 | fillSinglePart(currentPart,part1); |
@@ -668,11 +668,11 @@ void IMAPwrapper::traverseBody(const RecMailP&mail,mailimap_body*body,RecBody&ta | |||
668 | And we put it only into the mail if it is the FIRST part */ | 668 | And we put it only into the mail if it is the FIRST part */ |
669 | if (part1->bd_type==MAILIMAP_BODY_TYPE_1PART_TEXT && target_body.Bodytext().isNull() && countlist[0]==1) { | 669 | if (part1->bd_type==MAILIMAP_BODY_TYPE_1PART_TEXT && target_body->Bodytext().isNull() && countlist[0]==1) { |
670 | QString body_text = fetchTextPart(mail,countlist,true,currentPart.Encoding()); | 670 | QString body_text = fetchTextPart(mail,countlist,true,currentPart->Encoding()); |
671 | target_body.setDescription(currentPart); | 671 | target_body->setDescription(currentPart); |
672 | target_body.setBodytext(body_text); | 672 | target_body->setBodytext(body_text); |
673 | if (countlist.count()>1) { | 673 | if (countlist.count()>1) { |
674 | target_body.addPart(currentPart); | 674 | target_body->addPart(currentPart); |
675 | } | 675 | } |
676 | } else { | 676 | } else { |
677 | target_body.addPart(currentPart); | 677 | target_body->addPart(currentPart); |
678 | } | 678 | } |
@@ -693,8 +693,8 @@ void IMAPwrapper::traverseBody(const RecMailP&mail,mailimap_body*body,RecBody&ta | |||
693 | if (current_body->bd_type==MAILIMAP_BODY_MPART) { | 693 | if (current_body->bd_type==MAILIMAP_BODY_MPART) { |
694 | RecPart targetPart; | 694 | RecPartP targetPart = new RecPart(); |
695 | targetPart.setType("multipart"); | 695 | targetPart->setType("multipart"); |
696 | fillMultiPart(targetPart,mailDescription); | 696 | fillMultiPart(targetPart,mailDescription); |
697 | countlist.append(current_count); | 697 | countlist.append(current_count); |
698 | targetPart.setPositionlist(countlist); | 698 | targetPart->setPositionlist(countlist); |
699 | target_body.addPart(targetPart); | 699 | target_body->addPart(targetPart); |
700 | QString id(""); | 700 | QString id(""); |
@@ -719,3 +719,3 @@ void IMAPwrapper::traverseBody(const RecMailP&mail,mailimap_body*body,RecBody&ta | |||
719 | 719 | ||
720 | void IMAPwrapper::fillSinglePart(RecPart&target_part,mailimap_body_type_1part*Description) | 720 | void IMAPwrapper::fillSinglePart(RecPartP&target_part,mailimap_body_type_1part*Description) |
721 | { | 721 | { |
@@ -726,3 +726,3 @@ void IMAPwrapper::fillSinglePart(RecPart&target_part,mailimap_body_type_1part*De | |||
726 | case MAILIMAP_BODY_TYPE_1PART_TEXT: | 726 | case MAILIMAP_BODY_TYPE_1PART_TEXT: |
727 | target_part.setType("text"); | 727 | target_part->setType("text"); |
728 | fillSingleTextPart(target_part,Description->bd_data.bd_type_text); | 728 | fillSingleTextPart(target_part,Description->bd_data.bd_type_text); |
@@ -733,3 +733,3 @@ void IMAPwrapper::fillSinglePart(RecPart&target_part,mailimap_body_type_1part*De | |||
733 | case MAILIMAP_BODY_TYPE_1PART_MSG: | 733 | case MAILIMAP_BODY_TYPE_1PART_MSG: |
734 | target_part.setType("message"); | 734 | target_part->setType("message"); |
735 | fillSingleMsgPart(target_part,Description->bd_data.bd_type_msg); | 735 | fillSingleMsgPart(target_part,Description->bd_data.bd_type_msg); |
@@ -741,3 +741,3 @@ void IMAPwrapper::fillSinglePart(RecPart&target_part,mailimap_body_type_1part*De | |||
741 | 741 | ||
742 | void IMAPwrapper::fillSingleTextPart(RecPart&target_part,mailimap_body_type_text*which) | 742 | void IMAPwrapper::fillSingleTextPart(RecPartP&target_part,mailimap_body_type_text*which) |
743 | { | 743 | { |
@@ -749,4 +749,4 @@ void IMAPwrapper::fillSingleTextPart(RecPart&target_part,mailimap_body_type_text | |||
749 | qDebug("Type= text/%s",which->bd_media_text); | 749 | qDebug("Type= text/%s",which->bd_media_text); |
750 | target_part.setSubtype(sub.lower()); | 750 | target_part->setSubtype(sub.lower()); |
751 | target_part.setLines(which->bd_lines); | 751 | target_part->setLines(which->bd_lines); |
752 | fillBodyFields(target_part,which->bd_fields); | 752 | fillBodyFields(target_part,which->bd_fields); |
@@ -754,3 +754,3 @@ void IMAPwrapper::fillSingleTextPart(RecPart&target_part,mailimap_body_type_text | |||
754 | 754 | ||
755 | void IMAPwrapper::fillSingleMsgPart(RecPart&target_part,mailimap_body_type_msg*which) | 755 | void IMAPwrapper::fillSingleMsgPart(RecPartP&target_part,mailimap_body_type_msg*which) |
756 | { | 756 | { |
@@ -759,6 +759,6 @@ void IMAPwrapper::fillSingleMsgPart(RecPart&target_part,mailimap_body_type_msg*w | |||
759 | } | 759 | } |
760 | target_part.setSubtype("rfc822"); | 760 | target_part->setSubtype("rfc822"); |
761 | qDebug("Message part"); | 761 | qDebug("Message part"); |
762 | /* we set this type to text/plain */ | 762 | /* we set this type to text/plain */ |
763 | target_part.setLines(which->bd_lines); | 763 | target_part->setLines(which->bd_lines); |
764 | fillBodyFields(target_part,which->bd_fields); | 764 | fillBodyFields(target_part,which->bd_fields); |
@@ -766,3 +766,3 @@ void IMAPwrapper::fillSingleMsgPart(RecPart&target_part,mailimap_body_type_msg*w | |||
766 | 766 | ||
767 | void IMAPwrapper::fillMultiPart(RecPart&target_part,mailimap_body_type_mpart*which) | 767 | void IMAPwrapper::fillMultiPart(RecPartP&target_part,mailimap_body_type_mpart*which) |
768 | { | 768 | { |
@@ -770,3 +770,3 @@ void IMAPwrapper::fillMultiPart(RecPart&target_part,mailimap_body_type_mpart*whi | |||
770 | QString sub = which->bd_media_subtype; | 770 | QString sub = which->bd_media_subtype; |
771 | target_part.setSubtype(sub.lower()); | 771 | target_part->setSubtype(sub.lower()); |
772 | if (which->bd_ext_mpart && which->bd_ext_mpart->bd_parameter && which->bd_ext_mpart->bd_parameter->pa_list) { | 772 | 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 | |||
777 | if (param) { | 777 | if (param) { |
778 | target_part.addParameter(QString(param->pa_name).lower(),QString(param->pa_value)); | 778 | target_part->addParameter(QString(param->pa_name).lower(),QString(param->pa_value)); |
779 | } | 779 | } |
@@ -783,3 +783,3 @@ void IMAPwrapper::fillMultiPart(RecPart&target_part,mailimap_body_type_mpart*whi | |||
783 | 783 | ||
784 | void IMAPwrapper::fillSingleBasicPart(RecPart&target_part,mailimap_body_type_basic*which) | 784 | void IMAPwrapper::fillSingleBasicPart(RecPartP&target_part,mailimap_body_type_basic*which) |
785 | { | 785 | { |
@@ -820,4 +820,4 @@ void IMAPwrapper::fillSingleBasicPart(RecPart&target_part,mailimap_body_type_bas | |||
820 | qDebug("Type = %s/%s",type.latin1(),sub.latin1()); | 820 | qDebug("Type = %s/%s",type.latin1(),sub.latin1()); |
821 | target_part.setType(type.lower()); | 821 | target_part->setType(type.lower()); |
822 | target_part.setSubtype(sub.lower()); | 822 | target_part->setSubtype(sub.lower()); |
823 | fillBodyFields(target_part,which->bd_fields); | 823 | fillBodyFields(target_part,which->bd_fields); |
@@ -825,3 +825,3 @@ void IMAPwrapper::fillSingleBasicPart(RecPart&target_part,mailimap_body_type_bas | |||
825 | 825 | ||
826 | void IMAPwrapper::fillBodyFields(RecPart&target_part,mailimap_body_fields*which) | 826 | void IMAPwrapper::fillBodyFields(RecPartP&target_part,mailimap_body_fields*which) |
827 | { | 827 | { |
@@ -834,3 +834,3 @@ void IMAPwrapper::fillBodyFields(RecPart&target_part,mailimap_body_fields*which) | |||
834 | if (param) { | 834 | if (param) { |
835 | target_part.addParameter(QString(param->pa_name).lower(),QString(param->pa_value)); | 835 | target_part->addParameter(QString(param->pa_name).lower(),QString(param->pa_value)); |
836 | } | 836 | } |
@@ -866,6 +866,6 @@ void IMAPwrapper::fillBodyFields(RecPart&target_part,mailimap_body_fields*which) | |||
866 | if (which->bd_description) { | 866 | if (which->bd_description) { |
867 | target_part.setDescription(QString(which->bd_description)); | 867 | target_part->setDescription(QString(which->bd_description)); |
868 | } | 868 | } |
869 | target_part.setEncoding(encoding); | 869 | target_part->setEncoding(encoding); |
870 | target_part.setSize(which->bd_size); | 870 | target_part->setSize(which->bd_size); |
871 | } | 871 | } |
@@ -950,11 +950,11 @@ QString IMAPwrapper::fetchTextPart(const RecMailP&mail,const QValueList<int>&pat | |||
950 | 950 | ||
951 | QString IMAPwrapper::fetchTextPart(const RecMailP&mail,const RecPart&part) | 951 | QString IMAPwrapper::fetchTextPart(const RecMailP&mail,const RecPartP&part) |
952 | { | 952 | { |
953 | return fetchTextPart(mail,part.Positionlist(),false,part.Encoding()); | 953 | return fetchTextPart(mail,part->Positionlist(),false,part->Encoding()); |
954 | } | 954 | } |
955 | 955 | ||
956 | encodedString* IMAPwrapper::fetchDecodedPart(const RecMailP&mail,const RecPart&part) | 956 | encodedString* IMAPwrapper::fetchDecodedPart(const RecMailP&mail,const RecPartP&part) |
957 | { | 957 | { |
958 | encodedString*res = fetchRawPart(mail,part.Positionlist(),false); | 958 | encodedString*res = fetchRawPart(mail,part->Positionlist(),false); |
959 | encodedString*r = decode_String(res,part.Encoding()); | 959 | encodedString*r = decode_String(res,part->Encoding()); |
960 | delete res; | 960 | delete res; |
@@ -963,5 +963,5 @@ encodedString* IMAPwrapper::fetchDecodedPart(const RecMailP&mail,const RecPart&p | |||
963 | 963 | ||
964 | encodedString* IMAPwrapper::fetchRawPart(const RecMailP&mail,const RecPart&part) | 964 | encodedString* IMAPwrapper::fetchRawPart(const RecMailP&mail,const RecPartP&part) |
965 | { | 965 | { |
966 | return fetchRawPart(mail,part.Positionlist(),false); | 966 | return fetchRawPart(mail,part->Positionlist(),false); |
967 | } | 967 | } |