author | alwin <alwin> | 2004-03-12 19:24:38 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-03-12 19:24:38 (UTC) |
commit | b600871ce93553a116a66fd80acd6dfc1cc46829 (patch) (unidiff) | |
tree | b361346a49e09d9f0220993583bf183cf29bd974 /noncore/net/mail/libmailwrapper/imapwrapper.cpp | |
parent | 874d5a34eca296263dcd1adf857aebe9981825a1 (diff) | |
download | opie-b600871ce93553a116a66fd80acd6dfc1cc46829.zip opie-b600871ce93553a116a66fd80acd6dfc1cc46829.tar.gz opie-b600871ce93553a116a66fd80acd6dfc1cc46829.tar.bz2 |
some more smart-pointers
some bugfixes
some renaming of internals
Diffstat (limited to 'noncore/net/mail/libmailwrapper/imapwrapper.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/mail/libmailwrapper/imapwrapper.cpp | 49 |
1 files changed, 24 insertions, 25 deletions
diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.cpp b/noncore/net/mail/libmailwrapper/imapwrapper.cpp index 3b3be0f..071e734 100644 --- a/noncore/net/mail/libmailwrapper/imapwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/imapwrapper.cpp | |||
@@ -206,5 +206,5 @@ void IMAPwrapper::logout() | |||
206 | } | 206 | } |
207 | 207 | ||
208 | void IMAPwrapper::listMessages(const QString&mailbox,QList<RecMail> &target ) | 208 | void IMAPwrapper::listMessages(const QString&mailbox,QValueList<Opie::OSmartPointer<RecMail> > &target ) |
209 | { | 209 | { |
210 | int err = MAILIMAP_NO_ERROR; | 210 | int err = MAILIMAP_NO_ERROR; |
@@ -267,5 +267,5 @@ void IMAPwrapper::listMessages(const QString&mailbox,QList<RecMail> &target ) | |||
267 | } | 267 | } |
268 | 268 | ||
269 | QValueList<Opie::osmart_pointer<Folder> >* IMAPwrapper::listFolders() | 269 | QValueList<Opie::OSmartPointer<Folder> >* IMAPwrapper::listFolders() |
270 | { | 270 | { |
271 | const char *path, *mask; | 271 | const char *path, *mask; |
@@ -483,5 +483,5 @@ RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att) | |||
483 | } | 483 | } |
484 | 484 | ||
485 | RecBody IMAPwrapper::fetchBody(const RecMail&mail) | 485 | RecBody IMAPwrapper::fetchBody(const RecMailP&mail) |
486 | { | 486 | { |
487 | RecBody body; | 487 | RecBody body; |
@@ -495,5 +495,5 @@ RecBody IMAPwrapper::fetchBody(const RecMail&mail) | |||
495 | mailimap_body*body_desc = 0; | 495 | mailimap_body*body_desc = 0; |
496 | 496 | ||
497 | mb = mail.getMbox().latin1(); | 497 | mb = mail->getMbox().latin1(); |
498 | 498 | ||
499 | login(); | 499 | login(); |
@@ -501,5 +501,5 @@ RecBody IMAPwrapper::fetchBody(const RecMail&mail) | |||
501 | return body; | 501 | return body; |
502 | } | 502 | } |
503 | err = selectMbox(mail.getMbox()); | 503 | err = selectMbox(mail->getMbox()); |
504 | if ( err != MAILIMAP_NO_ERROR ) { | 504 | if ( err != MAILIMAP_NO_ERROR ) { |
505 | return body; | 505 | return body; |
@@ -507,5 +507,5 @@ RecBody IMAPwrapper::fetchBody(const RecMail&mail) | |||
507 | 507 | ||
508 | /* the range has to start at 1!!! not with 0!!!! */ | 508 | /* the range has to start at 1!!! not with 0!!!! */ |
509 | set = mailimap_set_new_interval( mail.getNumber(),mail.getNumber() ); | 509 | set = mailimap_set_new_interval( mail->getNumber(),mail->getNumber() ); |
510 | fetchAtt = mailimap_fetch_att_new_bodystructure(); | 510 | fetchAtt = mailimap_fetch_att_new_bodystructure(); |
511 | fetchType = mailimap_fetch_type_new_fetch_att(fetchAtt); | 511 | fetchType = mailimap_fetch_type_new_fetch_att(fetchAtt); |
@@ -569,5 +569,5 @@ QStringList IMAPwrapper::address_list_to_stringlist(clist*list) | |||
569 | } | 569 | } |
570 | 570 | ||
571 | encodedString*IMAPwrapper::fetchRawPart(const RecMail&mail,const QValueList<int>&path,bool internal_call) | 571 | encodedString*IMAPwrapper::fetchRawPart(const RecMailP&mail,const QValueList<int>&path,bool internal_call) |
572 | { | 572 | { |
573 | encodedString*res=new encodedString; | 573 | encodedString*res=new encodedString; |
@@ -586,10 +586,10 @@ encodedString*IMAPwrapper::fetchRawPart(const RecMail&mail,const QValueList<int> | |||
586 | } | 586 | } |
587 | if (!internal_call) { | 587 | if (!internal_call) { |
588 | err = selectMbox(mail.getMbox()); | 588 | err = selectMbox(mail->getMbox()); |
589 | if ( err != MAILIMAP_NO_ERROR ) { | 589 | if ( err != MAILIMAP_NO_ERROR ) { |
590 | return res; | 590 | return res; |
591 | } | 591 | } |
592 | } | 592 | } |
593 | set = mailimap_set_new_single(mail.getNumber()); | 593 | set = mailimap_set_new_single(mail->getNumber()); |
594 | 594 | ||
595 | clist*id_list = 0; | 595 | clist*id_list = 0; |
@@ -642,5 +642,5 @@ encodedString*IMAPwrapper::fetchRawPart(const RecMail&mail,const QValueList<int> | |||
642 | /* current_recursion is for recursive calls. | 642 | /* current_recursion is for recursive calls. |
643 | current_count means the position inside the internal loop! */ | 643 | current_count means the position inside the internal loop! */ |
644 | void IMAPwrapper::traverseBody(const RecMail&mail,mailimap_body*body,RecBody&target_body, | 644 | void IMAPwrapper::traverseBody(const RecMailP&mail,mailimap_body*body,RecBody&target_body, |
645 | int current_recursion,QValueList<int>recList,int current_count) | 645 | int current_recursion,QValueList<int>recList,int current_count) |
646 | { | 646 | { |
@@ -870,5 +870,5 @@ void IMAPwrapper::fillBodyFields(RecPart&target_part,mailimap_body_fields*which) | |||
870 | } | 870 | } |
871 | 871 | ||
872 | void IMAPwrapper::deleteMail(const RecMail&mail) | 872 | void IMAPwrapper::deleteMail(const RecMailP&mail) |
873 | { | 873 | { |
874 | mailimap_flag_list*flist; | 874 | mailimap_flag_list*flist; |
@@ -880,5 +880,5 @@ void IMAPwrapper::deleteMail(const RecMail&mail) | |||
880 | return; | 880 | return; |
881 | } | 881 | } |
882 | err = selectMbox(mail.getMbox()); | 882 | err = selectMbox(mail->getMbox()); |
883 | if ( err != MAILIMAP_NO_ERROR ) { | 883 | if ( err != MAILIMAP_NO_ERROR ) { |
884 | return; | 884 | return; |
@@ -887,5 +887,5 @@ void IMAPwrapper::deleteMail(const RecMail&mail) | |||
887 | mailimap_flag_list_add(flist,mailimap_flag_new_deleted()); | 887 | mailimap_flag_list_add(flist,mailimap_flag_new_deleted()); |
888 | store_flags = mailimap_store_att_flags_new_set_flags(flist); | 888 | store_flags = mailimap_store_att_flags_new_set_flags(flist); |
889 | set = mailimap_set_new_single(mail.getNumber()); | 889 | set = mailimap_set_new_single(mail->getNumber()); |
890 | err = mailimap_store(m_imap,set,store_flags); | 890 | err = mailimap_store(m_imap,set,store_flags); |
891 | mailimap_set_free( set ); | 891 | mailimap_set_free( set ); |
@@ -905,5 +905,5 @@ void IMAPwrapper::deleteMail(const RecMail&mail) | |||
905 | } | 905 | } |
906 | 906 | ||
907 | void IMAPwrapper::answeredMail(const RecMail&mail) | 907 | void IMAPwrapper::answeredMail(const RecMailP&mail) |
908 | { | 908 | { |
909 | mailimap_flag_list*flist; | 909 | mailimap_flag_list*flist; |
@@ -915,5 +915,5 @@ void IMAPwrapper::answeredMail(const RecMail&mail) | |||
915 | return; | 915 | return; |
916 | } | 916 | } |
917 | err = selectMbox(mail.getMbox()); | 917 | err = selectMbox(mail->getMbox()); |
918 | if ( err != MAILIMAP_NO_ERROR ) { | 918 | if ( err != MAILIMAP_NO_ERROR ) { |
919 | return; | 919 | return; |
@@ -922,5 +922,5 @@ void IMAPwrapper::answeredMail(const RecMail&mail) | |||
922 | mailimap_flag_list_add(flist,mailimap_flag_new_answered()); | 922 | mailimap_flag_list_add(flist,mailimap_flag_new_answered()); |
923 | store_flags = mailimap_store_att_flags_new_add_flags(flist); | 923 | store_flags = mailimap_store_att_flags_new_add_flags(flist); |
924 | set = mailimap_set_new_single(mail.getNumber()); | 924 | set = mailimap_set_new_single(mail->getNumber()); |
925 | err = mailimap_store(m_imap,set,store_flags); | 925 | err = mailimap_store(m_imap,set,store_flags); |
926 | mailimap_set_free( set ); | 926 | mailimap_set_free( set ); |
@@ -933,5 +933,5 @@ void IMAPwrapper::answeredMail(const RecMail&mail) | |||
933 | } | 933 | } |
934 | 934 | ||
935 | QString IMAPwrapper::fetchTextPart(const RecMail&mail,const QValueList<int>&path,bool internal_call,const QString&enc) | 935 | QString IMAPwrapper::fetchTextPart(const RecMailP&mail,const QValueList<int>&path,bool internal_call,const QString&enc) |
936 | { | 936 | { |
937 | QString body(""); | 937 | QString body(""); |
@@ -948,10 +948,10 @@ QString IMAPwrapper::fetchTextPart(const RecMail&mail,const QValueList<int>&path | |||
948 | } | 948 | } |
949 | 949 | ||
950 | QString IMAPwrapper::fetchTextPart(const RecMail&mail,const RecPart&part) | 950 | QString IMAPwrapper::fetchTextPart(const RecMailP&mail,const RecPart&part) |
951 | { | 951 | { |
952 | return fetchTextPart(mail,part.Positionlist(),false,part.Encoding()); | 952 | return fetchTextPart(mail,part.Positionlist(),false,part.Encoding()); |
953 | } | 953 | } |
954 | 954 | ||
955 | encodedString* IMAPwrapper::fetchDecodedPart(const RecMail&mail,const RecPart&part) | 955 | encodedString* IMAPwrapper::fetchDecodedPart(const RecMailP&mail,const RecPart&part) |
956 | { | 956 | { |
957 | encodedString*res = fetchRawPart(mail,part.Positionlist(),false); | 957 | encodedString*res = fetchRawPart(mail,part.Positionlist(),false); |
@@ -961,5 +961,5 @@ encodedString* IMAPwrapper::fetchDecodedPart(const RecMail&mail,const RecPart&pa | |||
961 | } | 961 | } |
962 | 962 | ||
963 | encodedString* IMAPwrapper::fetchRawPart(const RecMail&mail,const RecPart&part) | 963 | encodedString* IMAPwrapper::fetchRawPart(const RecMailP&mail,const RecPart&part) |
964 | { | 964 | { |
965 | return fetchRawPart(mail,part.Positionlist(),false); | 965 | return fetchRawPart(mail,part.Positionlist(),false); |
@@ -1056,5 +1056,4 @@ void IMAPwrapper::statusFolder(folderStat&target_stat,const QString & mailbox) | |||
1056 | clistiter * cur = 0; | 1056 | clistiter * cur = 0; |
1057 | int r = 0; | 1057 | int r = 0; |
1058 | int res = 0; | ||
1059 | target_stat.message_count = 0; | 1058 | target_stat.message_count = 0; |
1060 | target_stat.message_unseen = 0; | 1059 | target_stat.message_unseen = 0; |
@@ -1116,5 +1115,5 @@ const QString&IMAPwrapper::getName()const | |||
1116 | } | 1115 | } |
1117 | 1116 | ||
1118 | encodedString* IMAPwrapper::fetchRawBody(const RecMail&mail) | 1117 | encodedString* IMAPwrapper::fetchRawBody(const RecMailP&mail) |
1119 | { | 1118 | { |
1120 | // dummy | 1119 | // dummy |
@@ -1155,5 +1154,5 @@ void IMAPwrapper::mvcpAllMails(const FolderP&fromFolder, | |||
1155 | } | 1154 | } |
1156 | 1155 | ||
1157 | void IMAPwrapper::mvcpMail(const RecMail&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) | 1156 | void IMAPwrapper::mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) |
1158 | { | 1157 | { |
1159 | if (targetWrapper != this) { | 1158 | if (targetWrapper != this) { |
@@ -1167,9 +1166,9 @@ void IMAPwrapper::mvcpMail(const RecMail&mail,const QString&targetFolder,Abstrac | |||
1167 | return; | 1166 | return; |
1168 | } | 1167 | } |
1169 | int err = selectMbox(mail.getMbox()); | 1168 | int err = selectMbox(mail->getMbox()); |
1170 | if ( err != MAILIMAP_NO_ERROR ) { | 1169 | if ( err != MAILIMAP_NO_ERROR ) { |
1171 | return; | 1170 | return; |
1172 | } | 1171 | } |
1173 | set = mailimap_set_new_single(mail.getNumber()); | 1172 | set = mailimap_set_new_single(mail->getNumber()); |
1174 | err = mailimap_copy(m_imap,set,targetFolder.latin1()); | 1173 | err = mailimap_copy(m_imap,set,targetFolder.latin1()); |
1175 | mailimap_set_free( set ); | 1174 | mailimap_set_free( set ); |