summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/libmailwrapper/mhwrapper.cpp27
1 files changed, 15 insertions, 12 deletions
diff --git a/noncore/net/mail/libmailwrapper/mhwrapper.cpp b/noncore/net/mail/libmailwrapper/mhwrapper.cpp
index 85f9cf0..5adba55 100644
--- a/noncore/net/mail/libmailwrapper/mhwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/mhwrapper.cpp
@@ -68,7 +68,7 @@ void MHwrapper::listMessages(const QString & mailbox, QList<RecMail> &target )
68 } 68 }
69 QString f = buildPath(mailbox); 69 QString f = buildPath(mailbox);
70 int r = mailsession_select_folder(m_storage->sto_session,(char*)mailbox.latin1()); 70 int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1());
71 if (r!=MAIL_NO_ERROR) { 71 if (r!=MAIL_NO_ERROR) {
72 qDebug("error selecting folder!"); 72 qDebug("listMessages: error selecting folder!");
73 return; 73 return;
74 } 74 }
@@ -237,16 +237,19 @@ encodedString* MHwrapper::fetchRawBody(const RecMail&mail)
237void MHwrapper::deleteMails(const QString & mailbox,QList<RecMail> &target) 237void MHwrapper::deleteMails(const QString & mailbox,QList<RecMail> &target)
238{ 238{
239#if 0 239 QString f = buildPath(mailbox);
240 QString p = MHPath+"/"; 240 int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1());
241 p+=mailbox; 241 if (r!=MAIL_NO_ERROR) {
242 mailmbox_folder*f = 0; 242 qDebug("deleteMails: error selecting folder!");
243 int r = mailmbox_init(p.latin1(),0,1,0,&f);
244 if (r != MAIL_NO_ERROR) {
245 qDebug("Error init folder");
246 return; 243 return;
247 } 244 }
248 deleteMails(f,target); 245 RecMail*c = 0;
249 mailmbox_done(f); 246 for (unsigned int i=0; i < target.count();++i) {
250#endif 247 c = target.at(i);
248 r = mailsession_remove_message(m_storage->sto_session,c->getNumber());
249 if (r != MAIL_NO_ERROR) {
250 qDebug("error deleting mail");
251 break;
252 }
253 }
251} 254}
252 255