summaryrefslogtreecommitdiff
path: root/noncore/net/mail/libmailwrapper/mhwrapper.cpp
Unidiff
Diffstat (limited to 'noncore/net/mail/libmailwrapper/mhwrapper.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/libmailwrapper/mhwrapper.cpp60
1 files changed, 30 insertions, 30 deletions
diff --git a/noncore/net/mail/libmailwrapper/mhwrapper.cpp b/noncore/net/mail/libmailwrapper/mhwrapper.cpp
index 403afcf..765a21c 100644
--- a/noncore/net/mail/libmailwrapper/mhwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/mhwrapper.cpp
@@ -18,5 +18,5 @@ MHwrapper::MHwrapper(const QString & mbox_dir,const QString&mbox_name)
18 MHPath=MHPath.left(MHPath.length()-1); 18 MHPath=MHPath.left(MHPath.length()-1);
19 } 19 }
20 odebug << MHPath << oendl; 20 odebug << MHPath << oendl;
21 QDir dir(MHPath); 21 QDir dir(MHPath);
22 if (!dir.exists()) { 22 if (!dir.exists()) {
@@ -35,5 +35,5 @@ void MHwrapper::init_storage()
35 r = mh_mailstorage_init(m_storage,(char*)pre.latin1(),0,0,0); 35 r = mh_mailstorage_init(m_storage,(char*)pre.latin1(),0,0,0);
36 if (r != MAIL_NO_ERROR) { 36 if (r != MAIL_NO_ERROR) {
37 odebug << "error initializing storage" << oendl; 37 odebug << "error initializing storage" << oendl;
38 mailstorage_free(m_storage); 38 mailstorage_free(m_storage);
39 m_storage = 0; 39 m_storage = 0;
@@ -43,5 +43,5 @@ void MHwrapper::init_storage()
43 r = mailstorage_connect(m_storage); 43 r = mailstorage_connect(m_storage);
44 if (r!=MAIL_NO_ERROR) { 44 if (r!=MAIL_NO_ERROR) {
45 odebug << "error connecting storage" << oendl; 45 odebug << "error connecting storage" << oendl;
46 mailstorage_free(m_storage); 46 mailstorage_free(m_storage);
47 m_storage = 0; 47 m_storage = 0;
@@ -72,5 +72,5 @@ void MHwrapper::listMessages(const QString & mailbox, QValueList<Opie::Core::OSm
72 int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1()); 72 int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1());
73 if (r!=MAIL_NO_ERROR) { 73 if (r!=MAIL_NO_ERROR) {
74 odebug << "listMessages: error selecting folder!" << oendl; 74 odebug << "listMessages: error selecting folder!" << oendl;
75 return; 75 return;
76 } 76 }
@@ -92,5 +92,5 @@ QValueList<Opie::Core::OSmartPointer<Folder> >* MHwrapper::listFolders()
92 int r = mailsession_list_folders(m_storage->sto_session,NULL,&flist); 92 int r = mailsession_list_folders(m_storage->sto_session,NULL,&flist);
93 if (r != MAIL_NO_ERROR || !flist) { 93 if (r != MAIL_NO_ERROR || !flist) {
94 odebug << "error getting folder list" << oendl; 94 odebug << "error getting folder list" << oendl;
95 return folders; 95 return folders;
96 } 96 }
@@ -112,10 +112,10 @@ void MHwrapper::deleteMail(const RecMailP&mail)
112 int r = mailsession_select_folder(m_storage->sto_session,(char*)mail->getMbox().latin1()); 112 int r = mailsession_select_folder(m_storage->sto_session,(char*)mail->getMbox().latin1());
113 if (r!=MAIL_NO_ERROR) { 113 if (r!=MAIL_NO_ERROR) {
114 odebug << "error selecting folder!" << oendl; 114 odebug << "error selecting folder!" << oendl;
115 return; 115 return;
116 } 116 }
117 r = mailsession_remove_message(m_storage->sto_session,mail->getNumber()); 117 r = mailsession_remove_message(m_storage->sto_session,mail->getNumber());
118 if (r != MAIL_NO_ERROR) { 118 if (r != MAIL_NO_ERROR) {
119 odebug << "error deleting mail" << oendl; 119 odebug << "error deleting mail" << oendl;
120 } 120 }
121} 121}
@@ -142,5 +142,5 @@ RecBodyP MHwrapper::fetchBody( const RecMailP &mail )
142 r = mailsession_get_message(m_storage->sto_session, mail->getNumber(), &msg); 142 r = mailsession_get_message(m_storage->sto_session, mail->getNumber(), &msg);
143 if (r != MAIL_NO_ERROR) { 143 if (r != MAIL_NO_ERROR) {
144 odebug << "Error fetching mail " << mail->getNumber() << "" << oendl; 144 odebug << "Error fetching mail " << mail->getNumber() << "" << oendl;
145 return body; 145 return body;
146 } 146 }
@@ -152,5 +152,5 @@ RecBodyP MHwrapper::fetchBody( const RecMailP &mail )
152void MHwrapper::mbox_progress( size_t current, size_t maximum ) 152void MHwrapper::mbox_progress( size_t current, size_t maximum )
153{ 153{
154 odebug << "MH " << current << " von " << maximum << "" << oendl; 154 odebug << "MH " << current << " von " << maximum << "" << oendl;
155} 155}
156 156
@@ -185,11 +185,11 @@ int MHwrapper::createMbox(const QString&folder,const FolderP&pfolder,const QStri
185 f+=folder; 185 f+=folder;
186 } 186 }
187 odebug << f << oendl; 187 odebug << f << oendl;
188 int r = mailsession_create_folder(m_storage->sto_session,(char*)f.latin1()); 188 int r = mailsession_create_folder(m_storage->sto_session,(char*)f.latin1());
189 if (r != MAIL_NO_ERROR) { 189 if (r != MAIL_NO_ERROR) {
190 odebug << "error creating folder " << r << "" << oendl; 190 odebug << "error creating folder " << r << "" << oendl;
191 return 0; 191 return 0;
192 } 192 }
193 odebug << "Folder created" << oendl; 193 odebug << "Folder created" << oendl;
194 return 1; 194 return 1;
195} 195}
@@ -204,10 +204,10 @@ void MHwrapper::storeMessage(const char*msg,size_t length, const QString&Folder)
204 int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1()); 204 int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1());
205 if (r!=MAIL_NO_ERROR) { 205 if (r!=MAIL_NO_ERROR) {
206 odebug << "error selecting folder!" << oendl; 206 odebug << "error selecting folder!" << oendl;
207 return; 207 return;
208 } 208 }
209 r = mailsession_append_message(m_storage->sto_session,(char*)msg,length); 209 r = mailsession_append_message(m_storage->sto_session,(char*)msg,length);
210 if (r!=MAIL_NO_ERROR) { 210 if (r!=MAIL_NO_ERROR) {
211 odebug << "error storing mail" << oendl; 211 odebug << "error storing mail" << oendl;
212 } 212 }
213 return; 213 return;
@@ -226,5 +226,5 @@ encodedString* MHwrapper::fetchRawBody(const RecMailP&mail)
226 int r = mailsession_select_folder(m_storage->sto_session,(char*)mail->getMbox().latin1()); 226 int r = mailsession_select_folder(m_storage->sto_session,(char*)mail->getMbox().latin1());
227 if (r!=MAIL_NO_ERROR) { 227 if (r!=MAIL_NO_ERROR) {
228 odebug << "error selecting folder!" << oendl; 228 odebug << "error selecting folder!" << oendl;
229 return result; 229 return result;
230 } 230 }
@@ -250,5 +250,5 @@ void MHwrapper::deleteMails(const QString & mailbox,const QValueList<RecMailP> &
250 int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1()); 250 int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1());
251 if (r!=MAIL_NO_ERROR) { 251 if (r!=MAIL_NO_ERROR) {
252 odebug << "deleteMails: error selecting folder!" << oendl; 252 odebug << "deleteMails: error selecting folder!" << oendl;
253 return; 253 return;
254 } 254 }
@@ -257,5 +257,5 @@ void MHwrapper::deleteMails(const QString & mailbox,const QValueList<RecMailP> &
257 r = mailsession_remove_message(m_storage->sto_session,(*it)->getNumber()); 257 r = mailsession_remove_message(m_storage->sto_session,(*it)->getNumber());
258 if (r != MAIL_NO_ERROR) { 258 if (r != MAIL_NO_ERROR) {
259 odebug << "error deleting mail" << oendl; 259 odebug << "error deleting mail" << oendl;
260 break; 260 break;
261 } 261 }
@@ -273,5 +273,5 @@ int MHwrapper::deleteAllMail(const FolderP&tfolder)
273 int r = mailsession_select_folder(m_storage->sto_session,(char*)tfolder->getName().latin1()); 273 int r = mailsession_select_folder(m_storage->sto_session,(char*)tfolder->getName().latin1());
274 if (r!=MAIL_NO_ERROR) { 274 if (r!=MAIL_NO_ERROR) {
275 odebug << "error selecting folder!" << oendl; 275 odebug << "error selecting folder!" << oendl;
276 return 0; 276 return 0;
277 } 277 }
@@ -279,5 +279,5 @@ int MHwrapper::deleteAllMail(const FolderP&tfolder)
279 r = mailsession_get_messages_list(m_storage->sto_session,&l); 279 r = mailsession_get_messages_list(m_storage->sto_session,&l);
280 if (r != MAIL_NO_ERROR) { 280 if (r != MAIL_NO_ERROR) {
281 odebug << "Error message list" << oendl; 281 odebug << "Error message list" << oendl;
282 res = 0; 282 res = 0;
283 } 283 }
@@ -310,5 +310,5 @@ int MHwrapper::deleteMbox(const FolderP&tfolder)
310 310
311 if (r != MAIL_NO_ERROR) { 311 if (r != MAIL_NO_ERROR) {
312 odebug << "error deleting mail box" << oendl; 312 odebug << "error deleting mail box" << oendl;
313 return 0; 313 return 0;
314 } 314 }
@@ -328,8 +328,8 @@ int MHwrapper::deleteMbox(const FolderP&tfolder)
328 removeMboxfailed = false; 328 removeMboxfailed = false;
329 if(!process->start(OProcess::Block, OProcess::All) ) { 329 if(!process->start(OProcess::Block, OProcess::All) ) {
330 odebug << "could not start process" << oendl; 330 odebug << "could not start process" << oendl;
331 return 0; 331 return 0;
332 } 332 }
333 odebug << "mail box deleted" << oendl; 333 odebug << "mail box deleted" << oendl;
334 return 1; 334 return 1;
335} 335}
@@ -380,13 +380,13 @@ void MHwrapper::mvcpMail(const RecMailP&mail,const QString&targetFolder,Abstract
380 } 380 }
381 if (targetWrapper != this) { 381 if (targetWrapper != this) {
382 odebug << "Using generic" << oendl; 382 odebug << "Using generic" << oendl;
383 Genericwrapper::mvcpMail(mail,targetFolder,targetWrapper,moveit); 383 Genericwrapper::mvcpMail(mail,targetFolder,targetWrapper,moveit);
384 return; 384 return;
385 } 385 }
386 odebug << "Using internal routines for move/copy" << oendl; 386 odebug << "Using internal routines for move/copy" << oendl;
387 QString tf = buildPath(targetFolder); 387 QString tf = buildPath(targetFolder);
388 int r = mailsession_select_folder(m_storage->sto_session,(char*)mail->getMbox().latin1()); 388 int r = mailsession_select_folder(m_storage->sto_session,(char*)mail->getMbox().latin1());
389 if (r != MAIL_NO_ERROR) { 389 if (r != MAIL_NO_ERROR) {
390 odebug << "Error selecting source mailbox" << oendl; 390 odebug << "Error selecting source mailbox" << oendl;
391 return; 391 return;
392 } 392 }
@@ -397,5 +397,5 @@ void MHwrapper::mvcpMail(const RecMailP&mail,const QString&targetFolder,Abstract
397 } 397 }
398 if (r != MAIL_NO_ERROR) { 398 if (r != MAIL_NO_ERROR) {
399 odebug << "Error copy/moving mail internal (" << r << ")" << oendl; 399 odebug << "Error copy/moving mail internal (" << r << ")" << oendl;
400 } 400 }
401} 401}
@@ -409,5 +409,5 @@ void MHwrapper::mvcpAllMails(const FolderP&fromFolder,
409 } 409 }
410 if (targetWrapper != this) { 410 if (targetWrapper != this) {
411 odebug << "Using generic" << oendl; 411 odebug << "Using generic" << oendl;
412 Genericwrapper::mvcpAllMails(fromFolder,targetFolder,targetWrapper,moveit); 412 Genericwrapper::mvcpAllMails(fromFolder,targetFolder,targetWrapper,moveit);
413 return; 413 return;
@@ -416,5 +416,5 @@ void MHwrapper::mvcpAllMails(const FolderP&fromFolder,
416 int r = mailsession_select_folder(m_storage->sto_session,(char*)fromFolder->getName().latin1()); 416 int r = mailsession_select_folder(m_storage->sto_session,(char*)fromFolder->getName().latin1());
417 if (r!=MAIL_NO_ERROR) { 417 if (r!=MAIL_NO_ERROR) {
418 odebug << "error selecting source folder!" << oendl; 418 odebug << "error selecting source folder!" << oendl;
419 return; 419 return;
420 } 420 }
@@ -423,5 +423,5 @@ void MHwrapper::mvcpAllMails(const FolderP&fromFolder,
423 r = mailsession_get_messages_list(m_storage->sto_session,&l); 423 r = mailsession_get_messages_list(m_storage->sto_session,&l);
424 if (r != MAIL_NO_ERROR) { 424 if (r != MAIL_NO_ERROR) {
425 odebug << "Error message list" << oendl; 425 odebug << "Error message list" << oendl;
426 } 426 }
427 unsigned j = 0; 427 unsigned j = 0;
@@ -436,5 +436,5 @@ void MHwrapper::mvcpAllMails(const FolderP&fromFolder,
436 } 436 }
437 if (r != MAIL_NO_ERROR) { 437 if (r != MAIL_NO_ERROR) {
438 odebug << "Error copy/moving mail internal (" << r << ")" << oendl; 438 odebug << "Error copy/moving mail internal (" << r << ")" << oendl;
439 break; 439 break;
440 } 440 }