summaryrefslogtreecommitdiff
path: root/noncore/net/mail/libmailwrapper/imapwrapper.cpp
Unidiff
Diffstat (limited to 'noncore/net/mail/libmailwrapper/imapwrapper.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/libmailwrapper/imapwrapper.cpp66
1 files changed, 33 insertions, 33 deletions
diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.cpp b/noncore/net/mail/libmailwrapper/imapwrapper.cpp
index 657c2ba..35468fe 100644
--- a/noncore/net/mail/libmailwrapper/imapwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/imapwrapper.cpp
@@ -30,7 +30,7 @@ int IMAPwrapper::selectMbox(const QString&mbox)
30 } 30 }
31 int err = mailimap_select( m_imap, (char*)mbox.latin1()); 31 int err = mailimap_select( m_imap, (char*)mbox.latin1());
32 if ( err != MAILIMAP_NO_ERROR ) { 32 if ( err != MAILIMAP_NO_ERROR ) {
33 qDebug("error selecting mailbox: %s",m_imap->imap_response); 33 odebug << "error selecting mailbox: " << m_imap->imap_response << "" << oendl;
34 m_Lastmbox = ""; 34 m_Lastmbox = "";
35 return err; 35 return err;
36 } 36 }
@@ -41,7 +41,7 @@ int IMAPwrapper::selectMbox(const QString&mbox)
41void IMAPwrapper::imap_progress( size_t current, size_t maximum ) 41void IMAPwrapper::imap_progress( size_t current, size_t maximum )
42{ 42{
43 qApp->processEvents(); 43 qApp->processEvents();
44 qDebug( "IMAP: %i of %i", current, maximum ); 44 odebug << "IMAP: " << current << " of " << maximum << "" << oendl;
45} 45}
46 46
47bool IMAPwrapper::start_tls(bool force_tls) 47bool IMAPwrapper::start_tls(bool force_tls)
@@ -53,7 +53,7 @@ bool IMAPwrapper::start_tls(bool force_tls)
53 err = mailimap_capability(m_imap,&cap_data); 53 err = mailimap_capability(m_imap,&cap_data);
54 if (err != MAILIMAP_NO_ERROR) { 54 if (err != MAILIMAP_NO_ERROR) {
55 Global::statusMessage("error getting capabilities!"); 55 Global::statusMessage("error getting capabilities!");
56 qDebug("error getting capabilities!"); 56 odebug << "error getting capabilities!" << oendl;
57 return false; 57 return false;
58 } 58 }
59 clistiter * cur; 59 clistiter * cur;
@@ -74,7 +74,7 @@ bool IMAPwrapper::start_tls(bool force_tls)
74 err = mailimap_starttls(m_imap); 74 err = mailimap_starttls(m_imap);
75 if (err != MAILIMAP_NO_ERROR && force_tls) { 75 if (err != MAILIMAP_NO_ERROR && force_tls) {
76 Global::statusMessage(tr("Server has no TLS support!")); 76 Global::statusMessage(tr("Server has no TLS support!"));
77 qDebug("Server has no TLS support!"); 77 odebug << "Server has no TLS support!" << oendl;
78 try_tls = false; 78 try_tls = false;
79 } else { 79 } else {
80 mailstream_low * low; 80 mailstream_low * low;
@@ -125,7 +125,7 @@ void IMAPwrapper::login()
125 pass = login.getPassword().latin1(); 125 pass = login.getPassword().latin1();
126 } else { 126 } else {
127 // cancel 127 // cancel
128 qDebug( "IMAP: Login canceled" ); 128 odebug << "IMAP: Login canceled" << oendl;
129 return; 129 return;
130 } 130 }
131 } else { 131 } else {
@@ -148,7 +148,7 @@ void IMAPwrapper::login()
148 } 148 }
149 149
150 if ( ssl ) { 150 if ( ssl ) {
151 qDebug( "using ssl" ); 151 odebug << "using ssl" << oendl;
152 err = mailimap_ssl_connect( m_imap, (char*)server, port ); 152 err = mailimap_ssl_connect( m_imap, (char*)server, port );
153 } else { 153 } else {
154 err = mailimap_socket_connect( m_imap, (char*)server, port ); 154 err = mailimap_socket_connect( m_imap, (char*)server, port );
@@ -176,7 +176,7 @@ void IMAPwrapper::login()
176 bool ok = true; 176 bool ok = true;
177 if (force_tls && !try_tls) { 177 if (force_tls && !try_tls) {
178 Global::statusMessage(tr("Server has no TLS support!")); 178 Global::statusMessage(tr("Server has no TLS support!"));
179 qDebug("Server has no TLS support!"); 179 odebug << "Server has no TLS support!" << oendl;
180 ok = false; 180 ok = false;
181 } 181 }
182 182
@@ -317,7 +317,7 @@ QValueList<Opie::Core::OSmartPointer<Folder> >* IMAPwrapper::listFolders()
317 folders->append( new IMAPFolder(temp,del,selectable,no_inferiors,account->getPrefix())); 317 folders->append( new IMAPFolder(temp,del,selectable,no_inferiors,account->getPrefix()));
318 } 318 }
319 } else { 319 } else {
320 qDebug("error fetching folders: %s",m_imap->imap_response); 320 odebug << "error fetching folders: " << m_imap->imap_response << "" << oendl;
321 } 321 }
322 mailimap_list_result_free( result ); 322 mailimap_list_result_free( result );
323 323
@@ -327,7 +327,7 @@ QValueList<Opie::Core::OSmartPointer<Folder> >* IMAPwrapper::listFolders()
327 mask = "*" ; 327 mask = "*" ;
328 path = account->getPrefix().latin1(); 328 path = account->getPrefix().latin1();
329 if (!path) path = ""; 329 if (!path) path = "";
330 qDebug(path); 330 odebug << path << oendl;
331 err = mailimap_list( m_imap, (char*)path, (char*)mask, &result ); 331 err = mailimap_list( m_imap, (char*)path, (char*)mask, &result );
332 if ( err == MAILIMAP_NO_ERROR ) { 332 if ( err == MAILIMAP_NO_ERROR ) {
333 current = result->first; 333 current = result->first;
@@ -354,7 +354,7 @@ QValueList<Opie::Core::OSmartPointer<Folder> >* IMAPwrapper::listFolders()
354 folders->append(new IMAPFolder(temp,del,selectable,no_inferiors,account->getPrefix())); 354 folders->append(new IMAPFolder(temp,del,selectable,no_inferiors,account->getPrefix()));
355 } 355 }
356 } else { 356 } else {
357 qDebug("error fetching folders %s",m_imap->imap_response); 357 odebug << "error fetching folders " << m_imap->imap_response << "" << oendl;
358 } 358 }
359 if (result) mailimap_list_result_free( result ); 359 if (result) mailimap_list_result_free( result );
360 return folders; 360 return folders;
@@ -466,8 +466,8 @@ RecMail*IMAPwrapper::parse_list_result(mailimap_msg_att* m_att)
466#if 0 466#if 0
467 mailimap_date_time*d = item->att_data.att_static->att_data.att_internal_date; 467 mailimap_date_time*d = item->att_data.att_static->att_data.att_internal_date;
468 QDateTime da(QDate(d->dt_year,d->dt_month,d->dt_day),QTime(d->dt_hour,d->dt_min,d->dt_sec)); 468 QDateTime da(QDate(d->dt_year,d->dt_month,d->dt_day),QTime(d->dt_hour,d->dt_min,d->dt_sec));
469 qDebug("%i %i %i - %i %i %i",d->dt_year,d->dt_month,d->dt_day,d->dt_hour,d->dt_min,d->dt_sec); 469 odebug << "" << d->dt_year << " " << d->dt_month << " " << d->dt_day << " - " << d->dt_hour << " " << d->dt_min << " " << d->dt_sec << "" << oendl;
470 qDebug(da.toString()); 470 odebug << da.toString() << oendl;
471#endif 471#endif
472 } else if (item->att_data.att_static->att_type==MAILIMAP_MSG_ATT_RFC822_SIZE) { 472 } else if (item->att_data.att_static->att_type==MAILIMAP_MSG_ATT_RFC822_SIZE) {
473 size = item->att_data.att_static->att_data.att_rfc822_size; 473 size = item->att_data.att_static->att_data.att_rfc822_size;
@@ -524,7 +524,7 @@ RecBodyP IMAPwrapper::fetchBody(const RecMailP&mail)
524 body_desc = item->att_data.att_static->att_data.att_body; 524 body_desc = item->att_data.att_static->att_data.att_body;
525 traverseBody(mail,body_desc,body,0,path); 525 traverseBody(mail,body_desc,body,0,path);
526 } else { 526 } else {
527 qDebug("error fetching body: %s",m_imap->imap_response); 527 odebug << "error fetching body: " << m_imap->imap_response << "" << oendl;
528 } 528 }
529 if (result) mailimap_fetch_list_free(result); 529 if (result) mailimap_fetch_list_free(result);
530 return body; 530 return body;
@@ -636,7 +636,7 @@ encodedString*IMAPwrapper::fetchRawPart(const RecMailP&mail,const QValueList<int
636 } 636 }
637 } 637 }
638 } else { 638 } else {
639 qDebug("error fetching text: %s",m_imap->imap_response); 639 odebug << "error fetching text: " << m_imap->imap_response << "" << oendl;
640 } 640 }
641 if (result) mailimap_fetch_list_free(result); 641 if (result) mailimap_fetch_list_free(result);
642 return res; 642 return res;
@@ -663,7 +663,7 @@ void IMAPwrapper::traverseBody(const RecMailP&mail,mailimap_body*body,RecBodyP&t
663 id+=(j>0?" ":""); 663 id+=(j>0?" ":"");
664 id+=QString("%1").arg(countlist[j]); 664 id+=QString("%1").arg(countlist[j]);
665 } 665 }
666 qDebug("ID = %s",id.latin1()); 666 odebug << "ID = " << id.latin1() << "" << oendl;
667 currentPart->setIdentifier(id); 667 currentPart->setIdentifier(id);
668 fillSinglePart(currentPart,part1); 668 fillSinglePart(currentPart,part1);
669 /* important: Check for is NULL 'cause a body can be empty! 669 /* important: Check for is NULL 'cause a body can be empty!
@@ -704,7 +704,7 @@ void IMAPwrapper::traverseBody(const RecMailP&mail,mailimap_body*body,RecBodyP&t
704 id+=(j>0?" ":""); 704 id+=(j>0?" ":"");
705 id+=QString("%1").arg(countlist[j]); 705 id+=QString("%1").arg(countlist[j]);
706 } 706 }
707 qDebug("ID(mpart) = %s",id.latin1()); 707 odebug << "ID(mpart) = " << id.latin1() << "" << oendl;
708 } 708 }
709 traverseBody(mail,current_body,target_body,current_recursion+1,countlist,ccount); 709 traverseBody(mail,current_body,target_body,current_recursion+1,countlist,ccount);
710 if (current_body->bd_type==MAILIMAP_BODY_MPART) { 710 if (current_body->bd_type==MAILIMAP_BODY_MPART) {
@@ -748,7 +748,7 @@ void IMAPwrapper::fillSingleTextPart(RecPartP&target_part,mailimap_body_type_tex
748 } 748 }
749 QString sub; 749 QString sub;
750 sub = which->bd_media_text; 750 sub = which->bd_media_text;
751 qDebug("Type= text/%s",which->bd_media_text); 751 odebug << "Type= text/" << which->bd_media_text << "" << oendl;
752 target_part->setSubtype(sub.lower()); 752 target_part->setSubtype(sub.lower());
753 target_part->setLines(which->bd_lines); 753 target_part->setLines(which->bd_lines);
754 fillBodyFields(target_part,which->bd_fields); 754 fillBodyFields(target_part,which->bd_fields);
@@ -760,7 +760,7 @@ void IMAPwrapper::fillSingleMsgPart(RecPartP&target_part,mailimap_body_type_msg*
760 return; 760 return;
761 } 761 }
762 target_part->setSubtype("rfc822"); 762 target_part->setSubtype("rfc822");
763 qDebug("Message part"); 763 odebug << "Message part" << oendl;
764 /* we set this type to text/plain */ 764 /* we set this type to text/plain */
765 target_part->setLines(which->bd_lines); 765 target_part->setLines(which->bd_lines);
766 fillBodyFields(target_part,which->bd_fields); 766 fillBodyFields(target_part,which->bd_fields);
@@ -819,7 +819,7 @@ void IMAPwrapper::fillSingleBasicPart(RecPartP&target_part,mailimap_body_type_ba
819 } else { 819 } else {
820 sub = ""; 820 sub = "";
821 } 821 }
822 qDebug("Type = %s/%s",type.latin1(),sub.latin1()); 822 odebug << "Type = " << type.latin1() << "/" << sub.latin1() << "" << oendl;
823 target_part->setType(type.lower()); 823 target_part->setType(type.lower());
824 target_part->setSubtype(sub.lower()); 824 target_part->setSubtype(sub.lower());
825 fillBodyFields(target_part,which->bd_fields); 825 fillBodyFields(target_part,which->bd_fields);
@@ -895,16 +895,16 @@ void IMAPwrapper::deleteMail(const RecMailP&mail)
895 mailimap_store_att_flags_free(store_flags); 895 mailimap_store_att_flags_free(store_flags);
896 896
897 if (err != MAILIMAP_NO_ERROR) { 897 if (err != MAILIMAP_NO_ERROR) {
898 qDebug("error deleting mail: %s",m_imap->imap_response); 898 odebug << "error deleting mail: " << m_imap->imap_response << "" << oendl;
899 return; 899 return;
900 } 900 }
901 qDebug("deleting mail: %s",m_imap->imap_response); 901 odebug << "deleting mail: " << m_imap->imap_response << "" << oendl;
902 /* should we realy do that at this moment? */ 902 /* should we realy do that at this moment? */
903 err = mailimap_expunge(m_imap); 903 err = mailimap_expunge(m_imap);
904 if (err != MAILIMAP_NO_ERROR) { 904 if (err != MAILIMAP_NO_ERROR) {
905 qDebug("error deleting mail: %s",m_imap->imap_response); 905 odebug << "error deleting mail: " << m_imap->imap_response << "" << oendl;
906 } 906 }
907 qDebug("Delete successfull %s",m_imap->imap_response); 907 odebug << "Delete successfull " << m_imap->imap_response << "" << oendl;
908} 908}
909 909
910void IMAPwrapper::answeredMail(const RecMailP&mail) 910void IMAPwrapper::answeredMail(const RecMailP&mail)
@@ -930,7 +930,7 @@ void IMAPwrapper::answeredMail(const RecMailP&mail)
930 mailimap_store_att_flags_free(store_flags); 930 mailimap_store_att_flags_free(store_flags);
931 931
932 if (err != MAILIMAP_NO_ERROR) { 932 if (err != MAILIMAP_NO_ERROR) {
933 qDebug("error marking mail: %s",m_imap->imap_response); 933 odebug << "error marking mail: " << m_imap->imap_response << "" << oendl;
934 return; 934 return;
935 } 935 }
936} 936}
@@ -998,14 +998,14 @@ int IMAPwrapper::deleteAllMail(const FolderP&folder)
998 Global::statusMessage(tr("error deleting mail: %s").arg(m_imap->imap_response)); 998 Global::statusMessage(tr("error deleting mail: %s").arg(m_imap->imap_response));
999 return 0; 999 return 0;
1000 } 1000 }
1001 qDebug("deleting mail: %s",m_imap->imap_response); 1001 odebug << "deleting mail: " << m_imap->imap_response << "" << oendl;
1002 /* should we realy do that at this moment? */ 1002 /* should we realy do that at this moment? */
1003 err = mailimap_expunge(m_imap); 1003 err = mailimap_expunge(m_imap);
1004 if (err != MAILIMAP_NO_ERROR) { 1004 if (err != MAILIMAP_NO_ERROR) {
1005 Global::statusMessage(tr("error deleting mail: %s").arg(m_imap->imap_response)); 1005 Global::statusMessage(tr("error deleting mail: %s").arg(m_imap->imap_response));
1006 return 0; 1006 return 0;
1007 } 1007 }
1008 qDebug("Delete successfull %s",m_imap->imap_response); 1008 odebug << "Delete successfull " << m_imap->imap_response << "" << oendl;
1009 return 1; 1009 return 1;
1010} 1010}
1011 1011
@@ -1030,7 +1030,7 @@ int IMAPwrapper::createMbox(const QString&folder,const FolderP&parentfolder,cons
1030 return 0; 1030 return 0;
1031 } 1031 }
1032 } 1032 }
1033 qDebug("Creating %s",pre.latin1()); 1033 odebug << "Creating " << pre.latin1() << "" << oendl;
1034 int res = mailimap_create(m_imap,pre.latin1()); 1034 int res = mailimap_create(m_imap,pre.latin1());
1035 if (res != MAILIMAP_NO_ERROR) { 1035 if (res != MAILIMAP_NO_ERROR) {
1036 Global::statusMessage(tr("%1").arg(m_imap->imap_response)); 1036 Global::statusMessage(tr("%1").arg(m_imap->imap_response));
@@ -1089,7 +1089,7 @@ void IMAPwrapper::statusFolder(folderStat&target_stat,const QString & mailbox)
1089 } 1089 }
1090 } 1090 }
1091 } else { 1091 } else {
1092 qDebug("Error retrieving status"); 1092 odebug << "Error retrieving status" << oendl;
1093 } 1093 }
1094 if (status) mailimap_mailbox_data_status_free(status); 1094 if (status) mailimap_mailbox_data_status_free(status);
1095 if (att_list) mailimap_status_att_list_free(att_list); 1095 if (att_list) mailimap_status_att_list_free(att_list);
@@ -1113,7 +1113,7 @@ MAILLIB::ATYPE IMAPwrapper::getType()const
1113 1113
1114const QString&IMAPwrapper::getName()const 1114const QString&IMAPwrapper::getName()const
1115{ 1115{
1116 qDebug("Get name: %s",account->getAccountName().latin1()); 1116 odebug << "Get name: " << account->getAccountName().latin1() << "" << oendl;
1117 return account->getAccountName(); 1117 return account->getAccountName();
1118} 1118}
1119 1119
@@ -1129,7 +1129,7 @@ void IMAPwrapper::mvcpAllMails(const FolderP&fromFolder,
1129{ 1129{
1130 if (targetWrapper != this) { 1130 if (targetWrapper != this) {
1131 AbstractMail::mvcpAllMails(fromFolder,targetFolder,targetWrapper,moveit); 1131 AbstractMail::mvcpAllMails(fromFolder,targetFolder,targetWrapper,moveit);
1132 qDebug("Using generic"); 1132 odebug << "Using generic" << oendl;
1133 return; 1133 return;
1134 } 1134 }
1135 mailimap_set *set = 0; 1135 mailimap_set *set = 0;
@@ -1148,7 +1148,7 @@ void IMAPwrapper::mvcpAllMails(const FolderP&fromFolder,
1148 if ( err != MAILIMAP_NO_ERROR ) { 1148 if ( err != MAILIMAP_NO_ERROR ) {
1149 QString error_msg = tr("error copy mails: %1").arg(m_imap->imap_response); 1149 QString error_msg = tr("error copy mails: %1").arg(m_imap->imap_response);
1150 Global::statusMessage(error_msg); 1150 Global::statusMessage(error_msg);
1151 qDebug(error_msg); 1151 odebug << error_msg << oendl;
1152 return; 1152 return;
1153 } 1153 }
1154 if (moveit) { 1154 if (moveit) {
@@ -1159,7 +1159,7 @@ void IMAPwrapper::mvcpAllMails(const FolderP&fromFolder,
1159void IMAPwrapper::mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) 1159void IMAPwrapper::mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit)
1160{ 1160{
1161 if (targetWrapper != this) { 1161 if (targetWrapper != this) {
1162 qDebug("Using generic"); 1162 odebug << "Using generic" << oendl;
1163 AbstractMail::mvcpMail(mail,targetFolder,targetWrapper,moveit); 1163 AbstractMail::mvcpMail(mail,targetFolder,targetWrapper,moveit);
1164 return; 1164 return;
1165 } 1165 }
@@ -1178,7 +1178,7 @@ void IMAPwrapper::mvcpMail(const RecMailP&mail,const QString&targetFolder,Abstra
1178 if ( err != MAILIMAP_NO_ERROR ) { 1178 if ( err != MAILIMAP_NO_ERROR ) {
1179 QString error_msg = tr("error copy mail: %1").arg(m_imap->imap_response); 1179 QString error_msg = tr("error copy mail: %1").arg(m_imap->imap_response);
1180 Global::statusMessage(error_msg); 1180 Global::statusMessage(error_msg);
1181 qDebug(error_msg); 1181 odebug << error_msg << oendl;
1182 return; 1182 return;
1183 } 1183 }
1184 if (moveit) { 1184 if (moveit) {